mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-12 11:37:42 +00:00
Add texture displacement bump and UV-check shaders
This commit is contained in:
@@ -1,22 +1,24 @@
|
||||
#version 110
|
||||
|
||||
// See resources/shaders/140/texture_displacement_bump.vs for full documentation; this is the
|
||||
// GLSL 1.10 compatibility variant.
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
|
||||
uniform mat4 volume_world_matrix;
|
||||
// Clipping plane, x = min z, y = max z. Used by the FFF and SLA previews to clip with a top / bottom plane.
|
||||
uniform vec2 z_range;
|
||||
// Clipping plane - general orientation. Used by the SLA gizmo.
|
||||
uniform vec4 clipping_plane;
|
||||
|
||||
attribute vec3 v_position;
|
||||
// Per-vertex paint weight for the currently active texture-displacement layer, 0..1.
|
||||
attribute float v_weight;
|
||||
attribute vec3 v_position;
|
||||
attribute vec3 v_normal; // .x = paint weight (0/1); .y = 1 for the dragged island's vertices
|
||||
attribute vec2 v_tex_coord; // precomputed texture uv, used only when use_vertex_uv is set
|
||||
|
||||
varying vec3 clipping_planes_dots;
|
||||
varying vec4 model_pos;
|
||||
varying vec4 world_pos;
|
||||
varying float weight;
|
||||
varying float active;
|
||||
varying vec2 vertex_uv;
|
||||
|
||||
void main()
|
||||
{
|
||||
@@ -26,5 +28,7 @@ void main()
|
||||
gl_Position = projection_matrix * view_model_matrix * model_pos;
|
||||
clipping_planes_dots = vec3(dot(world_pos, clipping_plane), world_pos.z - z_range.x, z_range.y - world_pos.z);
|
||||
|
||||
weight = v_weight;
|
||||
weight = v_normal.x;
|
||||
active = v_normal.y;
|
||||
vertex_uv = v_tex_coord;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user