[Bf-blender-cvs] [c6eb5651ba2] blender2.8: Eevee: Fix error when using texture coordinate on world shaders

Clément Foucault noreply at git.blender.org
Wed Oct 17 12:18:09 CEST 2018


Commit: c6eb5651ba26db3fa26179f2124c58f8c94b5ca3
Author: Clément Foucault
Date:   Wed Oct 17 12:17:56 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBc6eb5651ba26db3fa26179f2124c58f8c94b5ca3

Eevee: Fix error when using texture coordinate on world shaders

Compilation errors were happening on OSX with errors of the type:
```ERROR: Input of fragment shader 'viewNormal' not written by vertex shader```

===================================================================

M	source/blender/draw/engines/eevee/shaders/background_vert.glsl

===================================================================

diff --git a/source/blender/draw/engines/eevee/shaders/background_vert.glsl b/source/blender/draw/engines/eevee/shaders/background_vert.glsl
index b81aae9bcda..c849a577316 100644
--- a/source/blender/draw/engines/eevee/shaders/background_vert.glsl
+++ b/source/blender/draw/engines/eevee/shaders/background_vert.glsl
@@ -17,4 +17,14 @@ void main()
 	gl_Position = vec4(pos, 1.0, 1.0);
 	varposition = viewPosition = vec3(pos, -1.0);
 	varnormal = normalize(-varposition);
+
+#ifndef VOLUMETRICS
+	/* Not used in practice but needed to avoid compilation errors. */
+	worldPosition = viewPosition;
+	worldNormal = viewNormal = varnormal;
+#endif
+
+#ifdef ATTRIB
+	pass_attrib(viewPosition);
+#endif
 }



More information about the Bf-blender-cvs mailing list