MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / LightEffect

Method LightEffect

GTE/Graphics/LightEffect.cpp:12–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10using namespace gte;
11
12LightEffect::LightEffect(std::shared_ptr<ProgramFactory> const& factory,
13 BufferUpdater const& updater,
14 ProgramSources const& vsSource,
15 ProgramSources const& psSource,
16 std::shared_ptr<Material> const& material,
17 std::shared_ptr<Lighting> const& lighting,
18 std::shared_ptr<LightCameraGeometry> const& geometry)
19 :
20 mMaterial(material),
21 mLighting(lighting),
22 mGeometry(geometry)
23{
24 int32_t api = factory->GetAPI();
25 mProgram = factory->CreateFromSources(*vsSource[api], *psSource[api], "");
26 if (mProgram)
27 {
28 mBufferUpdater = updater;
29 mProgram->GetVertexShader()->Set("PVWMatrix", mPVWMatrixConstant);
30 }
31 else
32 {
33 LogError("Failed to compile shader programs.");
34 }
35}
36
37void LightEffect::SetPVWMatrixConstant(std::shared_ptr<ConstantBuffer> const& buffer)
38{

Callers

nothing calls this directly

Calls 3

CreateFromSourcesMethod · 0.80
GetAPIMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected