This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/draw/modes/shaders/overlay_face_wireframe_frag.glsl
Clément Foucault e49d955541 Wireframe: Refactor to use GL_LINES instead of triangles with alpha blend
This gets rid of the progressive fading of the edges as it does not work
with depth perception (sorting problem with alpha blending).
2019-02-18 14:17:57 +01:00

24 lines
431 B
GLSL

uniform vec3 wireColor;
uniform vec3 rimColor;
flat in float edgeSharpness;
in float facing;
out vec4 fragColor;
void main()
{
if (edgeSharpness < 0.0) {
discard;
}
float facing_clamped = clamp(abs(facing), 0.0, 1.0);
vec3 final_front_col = mix(rimColor, wireColor, 0.4);
vec3 final_rim_col = mix(rimColor, wireColor, 0.1);
fragColor.rgb = mix(final_rim_col, final_front_col, facing_clamped);
fragColor.a = 1.0f;
}