Allow for a clip plane with Surface

This commit is contained in:
Grant Sanderson
2023-01-13 21:42:34 -08:00
parent 1c1325ff8d
commit dae51abc17
4 changed files with 35 additions and 0 deletions

View File

@ -7,6 +7,7 @@ uniform vec3 camera_position;
uniform float reflectiveness;
uniform float gloss;
uniform float shadow;
uniform vec4 clip_plane;
in vec3 point;
in vec3 du_point;
@ -28,6 +29,10 @@ void main(){
v_color = color;
gl_Position = get_gl_Position(xyz_coords);
if(clip_plane.xyz != vec3(0.0, 0.0, 0.0)){
gl_ClipDistance[0] = dot(vec4(point, 1.0), clip_plane);
}
v_color = finalize_color(
color,
xyz_coords,