This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/gpu/shaders/gpu_shader_3D_polyline_vert.glsl
Clément Foucault d712f1f83a GPU: Add Polyline shader (wide line emulation)
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
2020-04-23 23:07:48 +02:00

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
}