Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2019-12-03 03:06:40 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-12-03 03:06:40 +0300
commit37cd7b25dc87d53ee68dde3c9cf0809e200a26fd (patch)
tree125a4e9b2e17fc449b8845653d9d7d27f4ac7c90 /source/blender/draw/engines/overlay/shaders/wireframe_frag.glsl
parent1e480840a2123a6b61e7aa3e6f7935b6654f9981 (diff)
Overlay: Wireframe: Fix Edges not being culled correctly
Diffstat (limited to 'source/blender/draw/engines/overlay/shaders/wireframe_frag.glsl')
-rw-r--r--source/blender/draw/engines/overlay/shaders/wireframe_frag.glsl13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/draw/engines/overlay/shaders/wireframe_frag.glsl b/source/blender/draw/engines/overlay/shaders/wireframe_frag.glsl
index 0c6a3a651b9..edfe720da0c 100644
--- a/source/blender/draw/engines/overlay/shaders/wireframe_frag.glsl
+++ b/source/blender/draw/engines/overlay/shaders/wireframe_frag.glsl
@@ -1,14 +1,25 @@
-in vec3 finalColor;
flat in vec2 edgeStart;
+
+#ifndef SELECT_EDGES
+in vec3 finalColor;
noperspective in vec2 edgePos;
layout(location = 0) out vec4 fragColor;
layout(location = 1) out vec4 lineOutput;
+#endif
void main()
{
+ /* Needed only because of wireframe slider.
+ * If we could get rid of it would be nice because of performance drain of discard. */
+ if (edgeStart.r == -1.0) {
+ discard;
+ }
+
+#ifndef SELECT_EDGES
lineOutput = pack_line_data(gl_FragCoord.xy, edgeStart, edgePos);
fragColor.rgb = finalColor;
fragColor.a = 1.0;
+#endif
}