13 BufferUpdater const& updater, std::shared_ptr<Material>
const& material,
14 std::shared_ptr<Lighting>
const& lighting)
16 LightingEffect(factory, updater, msVSSource, msPSSource, material, lighting, nullptr)
51 " vec4 materialEmissive;\n" 52 " vec4 materialAmbient;\n" 57 " vec4 lightingAmbient;\n" 58 " vec4 lightingAttenuation;\n" 61 "layout(location = 0) in vec3 modelPosition;\n" 63 "layout(location = 0) out vec4 vertexColor;\n" 67 " vec3 ambient = lightingAttenuation.w * lightingAmbient.rgb;\n" 68 " vertexColor.rgb = materialEmissive.rgb + materialAmbient.rgb * ambient;\n" 69 " vertexColor.a = 1.0f;\n" 70 "#if GTE_USE_MAT_VEC\n" 71 " gl_Position = pvwMatrix * vec4(modelPosition, 1.0f);\n" 73 " gl_Position = vec4(modelPosition, 1.0f) * pvwMatrix;\n" 78 "layout(location = 0) in vec4 vertexColor;\n" 80 "layout(location = 0) out vec4 pixelColor0;\n" 84 " pixelColor0 = vertexColor;\n" 91 " float4x4 pvwMatrix;\n" 96 " float4 materialEmissive;\n" 97 " float4 materialAmbient;\n" 102 " float4 lightingAmbient;\n" 103 " float4 lightingAttenuation;\n" 108 " float3 modelPosition : POSITION;\n" 113 " float4 vertexColor : COLOR0;\n" 114 " float4 clipPosition : SV_POSITION;\n" 117 "VS_OUTPUT VSMain(VS_INPUT input)\n" 119 " VS_OUTPUT output;\n" 121 " float3 ambient = lightingAttenuation.w * lightingAmbient.rgb;\n" 122 " output.vertexColor.rgb = materialEmissive.rgb + materialAmbient.rgb * ambient;\n" 123 " output.vertexColor.a = 1.0f;\n" 124 "#if GTE_USE_MAT_VEC\n" 125 " output.clipPosition = mul(pvwMatrix, float4(input.modelPosition, 1.0f));\n" 127 " output.clipPosition = mul(float4(input.modelPosition, 1.0f), pvwMatrix);\n" 134 " float4 vertexColor : COLOR0;\n" 139 " float4 pixelColor0 : SV_TARGET0;\n" 142 "PS_OUTPUT PSMain(PS_INPUT input)\n" 144 " PS_OUTPUT output;\n" 145 " output.pixelColor0 = input.vertexColor;\n" static std::string const msGLSLVSSource
virtual void UpdateMaterialConstant()
std::shared_ptr< Material > mMaterial
Vector4< float > attenuation
std::function< void(std::shared_ptr< Buffer > const &)> BufferUpdater
static std::string const * msPSSource[ProgramFactory::PF_NUM_API]
static std::string const * msVSSource[ProgramFactory::PF_NUM_API]
static std::string const msGLSLPSSource
std::shared_ptr< Lighting > mLighting
virtual void UpdateLightingConstant()
GLsizei const GLchar *const * string
std::shared_ptr< ConstantBuffer > mLightingConstant
std::shared_ptr< ConstantBuffer > mMaterialConstant
Vector4< float > emissive
AmbientLightEffect(std::shared_ptr< ProgramFactory > const &factory, BufferUpdater const &updater, std::shared_ptr< Material > const &material, std::shared_ptr< Lighting > const &lighting)
virtual void UpdateLightingConstant()
std::shared_ptr< VisualProgram > mProgram
virtual void UpdateMaterialConstant()
static std::string const msHLSLSource