Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-01-21 15:51:34 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-01-21 15:55:53 +0300
commit9bc47ed0f6d0db9e43af30c741a7e5ac347cbecd (patch)
treeca8dbd6ce37e3529a3c5fe8c0bc944c535128ec3 /source/blender/draw/modes/shaders/overlay_face_orientation_vert.glsl
parent0c829e8240eebd7ce4ed9d61f8682c0d6bf534f4 (diff)
Fix clipping shaders with some AMD/Intel drivers
Caused: error: unsized array index must be constant Use hard coded number of clipping planes, copying the 4th to 5 & 6 when only 4 are used.
Diffstat (limited to 'source/blender/draw/modes/shaders/overlay_face_orientation_vert.glsl')
-rw-r--r--source/blender/draw/modes/shaders/overlay_face_orientation_vert.glsl12
1 files changed, 1 insertions, 11 deletions
diff --git a/source/blender/draw/modes/shaders/overlay_face_orientation_vert.glsl b/source/blender/draw/modes/shaders/overlay_face_orientation_vert.glsl
index 2d025bc65ee..f9f2679fe81 100644
--- a/source/blender/draw/modes/shaders/overlay_face_orientation_vert.glsl
+++ b/source/blender/draw/modes/shaders/overlay_face_orientation_vert.glsl
@@ -1,11 +1,6 @@
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 ModelMatrix;
-#ifdef USE_WORLD_CLIP_PLANES
-uniform vec4 WorldClipPlanes[6];
-uniform int WorldClipPlanesLen;
-#endif
-
in vec3 pos;
void main()
@@ -13,11 +8,6 @@ void main()
gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
#ifdef USE_WORLD_CLIP_PLANES
- {
- vec3 worldPosition = (ModelMatrix * vec4(pos, 1.0)).xyz;
- for (int i = 0; i < WorldClipPlanesLen; i++) {
- gl_ClipDistance[i] = dot(WorldClipPlanes[i].xyz, worldPosition) + WorldClipPlanes[i].w;
- }
- }
+ world_clip_planes_calc_clip_distance((ModelMatrix * vec4(pos, 1.0)).xyz);
#endif
}