diff options
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_3D_line_dashed_frag.glsl')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_3D_line_dashed_frag.glsl | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_line_dashed_frag.glsl b/source/blender/gpu/shaders/gpu_shader_3D_line_dashed_frag.glsl new file mode 100644 index 00000000000..2c13284cf34 --- /dev/null +++ b/source/blender/gpu/shaders/gpu_shader_3D_line_dashed_frag.glsl @@ -0,0 +1,24 @@ + +/* Same code as 2D version actually, maybe we should deduplicate that? */ + +#if __VERSION__ == 120 + noperspective varying float distance_along_line; + #define fragColor gl_FragColor +#else + noperspective in float distance_along_line; + out vec4 fragColor; +#endif + +uniform float dash_width; +uniform float dash_width_on; +uniform vec4 color1; +uniform vec4 color2; + +void main() +{ + if (mod(distance_along_line, dash_width) <= dash_width_on) { + fragColor = color1; + } else { + fragColor = color2; + } +} |