This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/draw/modes/shaders/paint_weight_vert.glsl
Campbell Barton 9bc47ed0f6 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.
2019-01-21 23:55:53 +11:00

21 lines
455 B
GLSL

uniform mat4 ModelViewProjectionMatrix;
uniform mat4 ModelMatrix;
in float weight;
in vec3 pos;
out vec2 weight_interp; /* (weight, alert) */
void main()
{
gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
/* Separate actual weight and alerts for independent interpolation */
weight_interp = max(vec2(weight, -weight), 0.0);
#ifdef USE_WORLD_CLIP_PLANES
world_clip_planes_calc_clip_distance((ModelMatrix * vec4(pos, 1.0)).xyz);
#endif
}