diff options
Diffstat (limited to 'source/blender/draw/engines/overlay/shaders/extra_wire_frag.glsl')
-rw-r--r-- | source/blender/draw/engines/overlay/shaders/extra_wire_frag.glsl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/draw/engines/overlay/shaders/extra_wire_frag.glsl b/source/blender/draw/engines/overlay/shaders/extra_wire_frag.glsl index 3281d0f8f9a..7e469aee18d 100644 --- a/source/blender/draw/engines/overlay/shaders/extra_wire_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/extra_wire_frag.glsl @@ -1,11 +1,10 @@ -uniform vec4 color; - noperspective in vec2 stipple_coord; flat in vec2 stipple_start; flat in vec4 finalColor; -out vec4 fragColor; +layout(location = 0) out vec4 fragColor; +layout(location = 1) out vec4 lineOutput; void main() { @@ -15,7 +14,15 @@ void main() const float dash_width = 6.0; const float dash_factor = 0.5; + lineOutput = pack_line_data(gl_FragCoord.xy, stipple_start, stipple_coord); + float dist = distance(stipple_start, stipple_coord); + + if (fragColor.a == 0.0) { + /* Disable stippling. */ + dist = 0.0; + } + fragColor.a = 1.0; if (fract(dist / dash_width) > dash_factor) { |