Cut: Fix model rendering

This commit is contained in:
Noisyfox 2023-11-01 23:48:34 +08:00
parent 3ec927a841
commit 090a9247cb
8 changed files with 151 additions and 63 deletions

View file

@ -35,6 +35,8 @@ uniform SlopeDetection slope;
uniform vec2 z_range;
// Clipping plane - general orientation. Used by the SLA gizmo.
uniform vec4 clipping_plane;
// Color clip plane - general orientation. Used by the cut gizmo.
uniform vec4 color_clip_plane;
attribute vec3 v_position;
attribute vec3 v_normal;
@ -43,6 +45,7 @@ attribute vec3 v_normal;
varying vec2 intensity;
varying vec3 clipping_planes_dots;
varying float color_clip_plane_dot;
varying vec4 world_pos;
varying float world_normal_z;
@ -74,4 +77,5 @@ void main()
gl_Position = projection_matrix * position;
// Fill in the scalars for fragment shader clipping. Fragments with any of these components lower than zero are discarded.
clipping_planes_dots = vec3(dot(world_pos, clipping_plane), world_pos.z - z_range.x, z_range.y - world_pos.z);
color_clip_plane_dot = dot(world_pos, color_clip_plane);
}