فهرست منبع

NORMAL_TYPE support for TriPlanarUtils.glsllib

Ryan McDonough 6 ماه پیش
والد
کامیت
885f8f75f2
1فایلهای تغییر یافته به همراه7 افزوده شده و 1 حذف شده
  1. 7 1
      jme3-core/src/main/resources/Common/ShaderLib/TriPlanarUtils.glsllib

+ 7 - 1
jme3-core/src/main/resources/Common/ShaderLib/TriPlanarUtils.glsllib

@@ -1,6 +1,10 @@
 #ifndef __TRIPLANAR_UTILS_MODULE__
     #define __TRIPLANAR_UTILS_MODULE__
     
+    #ifndef NORMAL_TYPE
+        #define NORMAL_TYPE -1.0
+    #endif
+    
     vec3 triBlending;    
 
     void TriPlanarUtils_calculateBlending(vec3 geometryNormal){
@@ -45,6 +49,7 @@
         
         // blend the results of the 3 planar projections.
         vec4 tex = normalize(col1 * triBlending.x + col2 * triBlending.y + col3 * triBlending.z);
+        tex.y *= NORMAL_TYPE;   
       
         return tex;
     }    
@@ -60,7 +65,8 @@
         col3.xyz = col3.xyz * vec3(2.0) - vec3(1.0);
         
         // blend the results of the 3 planar projections.
-        vec4 tex = normalize(col1 * triBlending.x + col2 * triBlending.y + col3 * triBlending.z);
+        vec4 tex = normalize(col1 * triBlending.x + col2 * triBlending.y + col3 * triBlending.z);        
+        tex.y *= NORMAL_TYPE;        
       
         return tex;
     }