Go to the source code of this file.
#define LIGHTING_COMMON |
"uniform vec3 Ambient;\n" \ "uniform vec4 LightPos[8];\n" \ "uniform vec4 LightColor[8];\n" \ "uniform float LightCount;\n" \ "varying vec4 oColor;\n" \ "varying vec2 oTexCoord;\n" \ "varying vec3 oNormal;\n" \ "varying vec3 oVPos;\n" \ "vec4 DoLight()\n" \ "{\n" \ " vec3 norm = normalize(oNormal);\n" \ " vec3 light = Ambient;\n" \ " for (int i = 0; i < int(LightCount); i++)\n" \ " {\n" \ " vec3 ltp = (LightPos[i].xyz - oVPos);\n" \ " float ldist = length(ltp);\n" \ " ltp = normalize(ltp);\n" \ " light += clamp(LightColor[i].rgb * oColor.rgb * (dot(norm, ltp) / ldist), 0.0,1.0);\n" \ " }\n" \ " return vec4(light, oColor.a);\n" \ "}\n"
Definition at line 96 of file Render_GL_Device.cpp.