This new shader is able to emulate smooth wide lines drawing using a geometry shader. This shader needs viewportSize and lineWidth uniforms to be set. There is multiple variants to replace the usage of wide lines for most shaders. This patch only fix the gizmo_types files and the navigation gizmo. Other areas could be fixed afterward, I just limited the patch size. Fix T57570. Reviewed By: billreynish Differential Revision: https://developer.blender.org/D7487
29 lines
419 B
GLSL
29 lines
419 B
GLSL
|
|
uniform mat4 ModelViewProjectionMatrix;
|
|
uniform mat4 ModelMatrix;
|
|
uniform vec4 ClipPlane;
|
|
|
|
in vec3 pos;
|
|
|
|
#if !defined(UNIFORM)
|
|
in vec4 color;
|
|
|
|
out vec4 finalColor_g;
|
|
#endif
|
|
|
|
#ifdef CLIP
|
|
out float clip_g;
|
|
#endif
|
|
|
|
void main()
|
|
{
|
|
gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
|
|
#if !defined(UNIFORM)
|
|
finalColor_g = color;
|
|
#endif
|
|
|
|
#ifdef CLIP
|
|
clip_g = dot(ModelMatrix * vec4(pos, 1.0), ClipPlane);
|
|
#endif
|
|
}
|