diff options
Diffstat (limited to 'modules/snap_context/resources/primitive_id_frag.glsl')
-rw-r--r-- | modules/snap_context/resources/primitive_id_frag.glsl | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/modules/snap_context/resources/primitive_id_frag.glsl b/modules/snap_context/resources/primitive_id_frag.glsl new file mode 100644 index 00000000..43801425 --- /dev/null +++ b/modules/snap_context/resources/primitive_id_frag.glsl @@ -0,0 +1,22 @@ +#version 120 + +uniform bool use_clip_planes; +varying vec4 clip_distance; + +uniform float offset; + +flat varying float primitive_id_var; + +void main() +{ + if (use_clip_planes && + ((clip_distance[0] < 0) || + (clip_distance[1] < 0) || + (clip_distance[2] < 0) || + (clip_distance[3] < 0))) + { + discard; + } + + gl_FragColor = vec4(offset + primitive_id_var, 0, 0, 0); +} |