mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-25 11:52:05 +00:00
Rename reserved GLSL word on AMD GPU
This commit is contained in:
@@ -40,7 +40,7 @@ varying vec3 clipping_planes_dots;
|
||||
varying vec4 model_pos;
|
||||
varying vec4 world_pos;
|
||||
varying float weight;
|
||||
varying float active;
|
||||
varying float island_active;
|
||||
varying vec2 vertex_uv;
|
||||
|
||||
void projection_axes(vec3 n, out vec3 t, out vec3 b)
|
||||
@@ -81,7 +81,7 @@ void main()
|
||||
// Mikkelsen surface-gradient bump; see the 140 variant for the full rationale. Scale-exact
|
||||
// for a conformal LSCM map (no global 1/tiling assumption), and gated by the paint weight
|
||||
// via a multiply so the branch stays uniform (use_vertex_uv is a uniform).
|
||||
vec2 uv = (active > 0.5)
|
||||
vec2 uv = (island_active > 0.5)
|
||||
? vec2(dot(island_delta_lin.xy, vertex_uv), dot(island_delta_lin.zw, vertex_uv)) + island_delta_tr
|
||||
: vertex_uv;
|
||||
float h = texture2D(height_tex, uv).r;
|
||||
|
||||
@@ -17,7 +17,7 @@ varying vec3 clipping_planes_dots;
|
||||
varying vec4 model_pos;
|
||||
varying vec4 world_pos;
|
||||
varying float weight;
|
||||
varying float active;
|
||||
varying float island_active;
|
||||
varying vec2 vertex_uv;
|
||||
|
||||
void main()
|
||||
@@ -28,7 +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_normal.x;
|
||||
active = v_normal.y;
|
||||
vertex_uv = v_tex_coord;
|
||||
weight = v_normal.x;
|
||||
island_active = v_normal.y;
|
||||
vertex_uv = v_tex_coord;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ uniform vec2 uv_offset;
|
||||
uniform bool invert;
|
||||
uniform bool use_vertex_uv; // true: sample at vertex_uv with a derived tangent frame (LSCM)
|
||||
// A 2x3 affine (columns packed as lin = (m00, m01, m10, m11), tr = (m02, m12)) applied to the uv of
|
||||
// the island currently being dragged in the UV editor (active > 0.5). Identity when nothing is
|
||||
// the island currently being dragged in the UV editor (island_active > 0.5). Identity when nothing is
|
||||
// dragged, so this whole path is a no-op then. Lets a UV island drag move the bump on the model with
|
||||
// only a uniform update
|
||||
uniform vec4 island_delta_lin;
|
||||
@@ -70,7 +70,7 @@ in vec3 clipping_planes_dots;
|
||||
in vec4 model_pos;
|
||||
in vec4 world_pos;
|
||||
in float weight;
|
||||
in float active;
|
||||
in float island_active;
|
||||
in vec2 vertex_uv;
|
||||
|
||||
out vec4 out_color;
|
||||
@@ -125,8 +125,8 @@ void main()
|
||||
// derivatives are well defined; the paint weight gates the result by a plain multiply (k)
|
||||
// rather than a per-fragment branch, keeping it that way.
|
||||
// The dragged island's uv rides a uniform affine so its bump moves without a rebuild; every
|
||||
// other vertex (active == 0) samples its baked uv unchanged.
|
||||
vec2 uv = (active > 0.5)
|
||||
// other vertex (island_active == 0) samples its baked uv unchanged.
|
||||
vec2 uv = (island_active > 0.5)
|
||||
? vec2(dot(island_delta_lin.xy, vertex_uv), dot(island_delta_lin.zw, vertex_uv)) + island_delta_tr
|
||||
: vertex_uv;
|
||||
float h = texture(height_tex, uv).r;
|
||||
|
||||
@@ -27,7 +27,7 @@ out vec3 clipping_planes_dots;
|
||||
out vec4 model_pos;
|
||||
out vec4 world_pos;
|
||||
out float weight;
|
||||
out float active;
|
||||
out float island_active;
|
||||
out vec2 vertex_uv;
|
||||
|
||||
void main()
|
||||
@@ -38,7 +38,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_normal.x;
|
||||
active = v_normal.y;
|
||||
vertex_uv = v_tex_coord;
|
||||
weight = v_normal.x;
|
||||
island_active = v_normal.y;
|
||||
vertex_uv = v_tex_coord;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user