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

overlay_face_wireframe_frag.glsl « shaders « modes « draw « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9414d25e71e6ab81907db44954c4e4404088bb8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

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;
}