[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/games/astrododge/data/shaders
From:       Rivo Laks <rivolaks () hot ! ee>
Date:       2009-08-07 18:00:56
Message-ID: 1249668056.256681.28704.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1008525 by rivol:

Don't let N.L be negative.

 M  +1 -1      material-asteroid.frag  
 M  +1 -1      material-object.frag  
 M  +1 -1      material-ship.frag  


--- trunk/playground/games/astrododge/data/shaders/material-asteroid.frag #1008524:1008525
@@ -5,7 +5,7 @@
 {
     vec3 texColor = texture2D(diffuseTexture, gl_TexCoord[0].xy).rgb;
     
-    float NdotL = dot(N, L);
+    float NdotL = max(dot(N, L), 0.0);
 
     return Lcolor * texColor * NdotL;
 }
--- trunk/playground/games/astrododge/data/shaders/material-object.frag #1008524:1008525
@@ -13,7 +13,7 @@
     vec3 specular = vec3(3.0)*gloss;
     float specularity = 30.0;
 
-    float NdotL = dot(N, L);
+    float NdotL = max(dot(N, L), 0.0);
     vec3 R = 2.0 * NdotL * N - L;
     vec3 V = normalize(-vertexEye.xyz);
     float spec = pow(max(dot(R, V), 0.0), specularity);
--- trunk/playground/games/astrododge/data/shaders/material-ship.frag #1008524:1008525
@@ -9,7 +9,7 @@
     float specular = 3.0;
     float specularity = 30.0;
 
-    float NdotL = dot(N, L);
+    float NdotL = max(dot(N, L), 0.0);
     vec3 R = 2.0 * NdotL * N - L;
     vec3 V = normalize(-vertexEye.xyz);
     float spec = pow(max(dot(R, V), 0.0), specularity);
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic