15 std::shared_ptr<Material>
const& material, std::shared_ptr<Lighting>
const& lighting,
16 std::shared_ptr<LightCameraGeometry>
const& geometry)
22 int api = factory->GetAPI();
23 mProgram = factory->CreateFromSources(*vsSource[api], *psSource[api],
"");
77 "vec4 lit(float NdotL, float NdotH, float m)\n" 79 " float ambient = 1.0;\n" 80 " float diffuse = max(NdotL, 0.0);\n" 81 " float specular = step(0.0, NdotL) * pow(max(NdotH, 0.0), m);\n" 82 " return vec4(ambient, diffuse, specular, 1.0);\n" virtual void UpdateMaterialConstant()
LightingEffect(std::shared_ptr< ProgramFactory > const &factory, BufferUpdater const &updater, std::string const *vsSource[], std::string const *psSource[], std::shared_ptr< Material > const &material, std::shared_ptr< Lighting > const &lighting, std::shared_ptr< LightCameraGeometry > const &geometry)
void SetPVWMatrixConstant(std::shared_ptr< ConstantBuffer > const &pvwMatrix)
std::function< void(std::shared_ptr< Buffer > const &)> BufferUpdater
std::shared_ptr< ConstantBuffer > mGeometryConstant
virtual void UpdateGeometryConstant()
virtual void UpdateLightingConstant()
GLsizei const GLchar *const * string
BufferUpdater mBufferUpdater
std::shared_ptr< ConstantBuffer > mLightingConstant
static std::string GetShaderSourceLitFunctionGLSL()
std::shared_ptr< ConstantBuffer > mMaterialConstant
std::shared_ptr< ConstantBuffer > mPVWMatrixConstant
std::shared_ptr< VisualProgram > mProgram