lightFragmentShaderBlinnPhong top-level property

ShaderObject lightFragmentShaderBlinnPhong
final

Implementation

final ShaderObject lightFragmentShaderBlinnPhong =
    ShaderObject("LightBlinnPhongF")
      ..AddVaryingVars([vPosition, vNormal, vTexUV])
      ..AddUniformVars([uLightDescs, uLightTypes, uShininess])
      ..AddUniformVars([uEyePosition, uTexture])
      ..SetBodyWithMain([
        """
ColorComponents acc = CombinedLight(${vPosition},
                                    ${vNormal},
                                    ${uEyePosition},
                                    ${uLightDescs},
                                    ${uLightTypes},
                                    ${uShininess});

${oFragColor}.rgb = acc.diffuse +
                    acc.specular +
                    texture(${uTexture}, ${vTexUV}).rgb;
${oFragColor}.a = 1.0;
"""
      ], prolog: [
        StdLibShader
      ]);