j
This commit is contained in:
parent
998858c685
commit
5210e22684
2 changed files with 4 additions and 0 deletions
Binary file not shown.
|
|
@ -15,6 +15,10 @@ vec4 PhongShading(void)
|
||||||
vec3 N = normalize(vNrm);
|
vec3 N = normalize(vNrm);
|
||||||
vec3 L = normalize(gl_LightSource[0].position.xyz-vPos.xyz);
|
vec3 L = normalize(gl_LightSource[0].position.xyz-vPos.xyz);
|
||||||
|
|
||||||
|
if(gl_LightSource[0].position.w < 0.5){
|
||||||
|
L = normalize(gl_LightSource[0].position.xyz);
|
||||||
|
}
|
||||||
|
|
||||||
vec4 ambient = gl_FrontLightProduct[0].ambient;
|
vec4 ambient = gl_FrontLightProduct[0].ambient;
|
||||||
|
|
||||||
float dcoef = max(dot(L, N), 0.0);
|
float dcoef = max(dot(L, N), 0.0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue