Eevee: Fix volumetric shaders compilation error
authorClément Foucault <foucault.clem@gmail.com>
Tue, 14 May 2019 17:58:26 +0000 (19:58 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Tue, 14 May 2019 17:59:07 +0000 (19:59 +0200)
source/blender/gpu/shaders/gpu_shader_material.glsl

index 6a3d6c3b1427a6dd6fe07973a1e91c3549846a9d..94770aa2ebf2340a39c685b60acec1d6f0ad6318 100644 (file)
@@ -3376,11 +3376,11 @@ void node_output_world(Closure surface, Closure volume, out Closure result)
 #endif /* VOLUMETRICS */
 }
 
 #endif /* VOLUMETRICS */
 }
 
-#ifndef VOLUMETRICS
 /* TODO : clean this ifdef mess */
 /* EEVEE output */
 void world_normals_get(out vec3 N)
 {
 /* TODO : clean this ifdef mess */
 /* EEVEE output */
 void world_normals_get(out vec3 N)
 {
+#ifndef VOLUMETRICS
 #  ifdef HAIR_SHADER
   vec3 B = normalize(cross(worldNormal, hairTangent));
   float cos_theta;
 #  ifdef HAIR_SHADER
   vec3 B = normalize(cross(worldNormal, hairTangent));
   float cos_theta;
@@ -3398,8 +3398,12 @@ void world_normals_get(out vec3 N)
 #  else
   N = gl_FrontFacing ? worldNormal : -worldNormal;
 #  endif
 #  else
   N = gl_FrontFacing ? worldNormal : -worldNormal;
 #  endif
+#else
+  generated_from_orco(vec3(0.0), N);
+#endif
 }
 
 }
 
+#ifndef VOLUMETRICS
 void node_eevee_specular(vec4 diffuse,
                          vec4 specular,
                          float roughness,
 void node_eevee_specular(vec4 diffuse,
                          vec4 specular,
                          float roughness,