Refactor: GLSL: Cleanup Clip Space vs. NDC Space naming #105423
|
@ -23,7 +23,7 @@ void main()
|
||||||
pos.y * abs((pos.y > 0.0) ? amax.y : amin.y));
|
pos.y * abs((pos.y > 0.0) ? amax.y : amin.y));
|
||||||
|
|
||||||
vec3 world_pos = (model_mat * vec4(final_pos, 1.0)).xyz;
|
vec3 world_pos = (model_mat * vec4(final_pos, 1.0)).xyz;
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
finalColor = color;
|
finalColor = color;
|
||||||
|
|
||||||
edgeStart = edgePos = ((gl_Position.xy / gl_Position.w) * 0.5 + 0.5) * sizeViewport;
|
edgeStart = edgePos = ((gl_Position.xy / gl_Position.w) * 0.5 + 0.5) * sizeViewport;
|
||||||
|
|
|
@ -123,9 +123,9 @@ void main()
|
||||||
|
|
||||||
view_clipping_distances(wpos1);
|
view_clipping_distances(wpos1);
|
||||||
|
|
||||||
vec4 p0 = point_world_to_ndc(wpos0);
|
vec4 p0 = point_world_to_homogenous(wpos0);
|
||||||
vec4 p1 = point_world_to_ndc(wpos1);
|
vec4 p1 = point_world_to_homogenous(wpos1);
|
||||||
vec4 p2 = point_world_to_ndc(wpos2);
|
vec4 p2 = point_world_to_homogenous(wpos2);
|
||||||
|
|
||||||
gl_Position = p1;
|
gl_Position = p1;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ void main()
|
||||||
mat4 model_mat = extract_matrix_packed_data(inst_obmat, state_color, bone_color);
|
mat4 model_mat = extract_matrix_packed_data(inst_obmat, state_color, bone_color);
|
||||||
|
|
||||||
vec3 world_pos = (model_mat * vec4(pos, 1.0)).xyz;
|
vec3 world_pos = (model_mat * vec4(pos, 1.0)).xyz;
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
finalColor.rgb = mix(state_color.rgb, bone_color.rgb, 0.5);
|
finalColor.rgb = mix(state_color.rgb, bone_color.rgb, 0.5);
|
||||||
finalColor.a = 1.0;
|
finalColor.a = 1.0;
|
||||||
|
|
|
@ -8,7 +8,7 @@ void main()
|
||||||
finalColor.a = 1.0;
|
finalColor.a = 1.0;
|
||||||
|
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
edgeStart = edgePos = ((gl_Position.xy / gl_Position.w) * 0.5 + 0.5) * sizeViewport.xy;
|
edgeStart = edgePos = ((gl_Position.xy / gl_Position.w) * 0.5 + 0.5) * sizeViewport.xy;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec3 world_pos = boundbox[gl_VertexID];
|
vec3 world_pos = boundbox[gl_VertexID];
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
/* Result in a position at 1.0 (far plane). Small epsilon to avoid precision issue.
|
/* Result in a position at 1.0 (far plane). Small epsilon to avoid precision issue.
|
||||||
* This mimics the effect of infinite projection matrix
|
* This mimics the effect of infinite projection matrix
|
||||||
|
|
|
@ -7,7 +7,7 @@ void main()
|
||||||
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
||||||
|
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
view_clipping_distances(world_pos);
|
view_clipping_distances(world_pos);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ void main()
|
||||||
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
||||||
|
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
vert.flag = data;
|
vert.flag = data;
|
||||||
|
|
||||||
view_clipping_distances(world_pos);
|
view_clipping_distances(world_pos);
|
||||||
|
|
|
@ -8,11 +8,11 @@
|
||||||
finalColor = vec4(0.0); \
|
finalColor = vec4(0.0); \
|
||||||
return;
|
return;
|
||||||
|
|
||||||
void output_line(vec2 offset, vec4 color, vec3 out_world_pos, vec4 out_ndc_pos)
|
void output_line(vec2 offset, vec4 color, vec3 out_world_pos, vec4 out_hs_pos)
|
||||||
{
|
{
|
||||||
finalColor = color;
|
finalColor = color;
|
||||||
gl_Position = out_ndc_pos;
|
gl_Position = out_hs_pos;
|
||||||
gl_Position.xy += offset * out_ndc_pos.w;
|
gl_Position.xy += offset * out_hs_pos.w;
|
||||||
view_clipping_distances(out_world_pos);
|
view_clipping_distances(out_world_pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ void main()
|
||||||
/* Perform vertex shader for each input primitive. */
|
/* Perform vertex shader for each input primitive. */
|
||||||
vec3 in_pos[2];
|
vec3 in_pos[2];
|
||||||
vec3 world_pos[2];
|
vec3 world_pos[2];
|
||||||
vec4 ndc_pos[2];
|
vec4 hs_pos[2];
|
||||||
uint vert_flag[2];
|
uint vert_flag[2];
|
||||||
|
|
||||||
/* Input prim is LineList. */
|
/* Input prim is LineList. */
|
||||||
|
@ -39,7 +39,7 @@ void main()
|
||||||
in_pos[i] = vertex_fetch_attribute((input_line_id * 2) + i, pos, vec3).xyz;
|
in_pos[i] = vertex_fetch_attribute((input_line_id * 2) + i, pos, vec3).xyz;
|
||||||
vert_flag[i] = (uint)vertex_fetch_attribute((input_line_id * 2) + i, data, uchar);
|
vert_flag[i] = (uint)vertex_fetch_attribute((input_line_id * 2) + i, data, uchar);
|
||||||
world_pos[i] = point_object_to_world(in_pos[i]);
|
world_pos[i] = point_object_to_world(in_pos[i]);
|
||||||
ndc_pos[i] = point_world_to_ndc(world_pos[i]);
|
hs_pos[i] = point_world_to_homogenous(world_pos[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Perform Geometry shader equivalent calculation. */
|
/* Perform Geometry shader equivalent calculation. */
|
||||||
|
@ -103,7 +103,7 @@ void main()
|
||||||
:
|
:
|
||||||
vec4(inner_color.rgb, 0.0);
|
vec4(inner_color.rgb, 0.0);
|
||||||
|
|
||||||
vec2 v1_2 = (ndc_pos[1].xy / ndc_pos[1].w - ndc_pos[0].xy / ndc_pos[0].w);
|
vec2 v1_2 = (hs_pos[1].xy / hs_pos[1].w - hs_pos[0].xy / hs_pos[0].w);
|
||||||
vec2 offset = sizeEdge * 4.0 * sizeViewportInv; /* 4.0 is eyeballed */
|
vec2 offset = sizeEdge * 4.0 * sizeViewportInv; /* 4.0 is eyeballed */
|
||||||
|
|
||||||
if (abs(v1_2.x * sizeViewport.x) < abs(v1_2.y * sizeViewport.y)) {
|
if (abs(v1_2.x * sizeViewport.x) < abs(v1_2.y * sizeViewport.y)) {
|
||||||
|
@ -122,7 +122,7 @@ void main()
|
||||||
output_line(offset * 2.0,
|
output_line(offset * 2.0,
|
||||||
vec4(colorActiveSpline.rgb, 0.0),
|
vec4(colorActiveSpline.rgb, 0.0),
|
||||||
world_pos[output_prim_vert_id],
|
world_pos[output_prim_vert_id],
|
||||||
ndc_pos[output_prim_vert_id]);
|
hs_pos[output_prim_vert_id]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
DISCARD_VERTEX
|
DISCARD_VERTEX
|
||||||
|
@ -132,19 +132,19 @@ void main()
|
||||||
case 1: {
|
case 1: {
|
||||||
/* draw the outline. */
|
/* draw the outline. */
|
||||||
output_line(
|
output_line(
|
||||||
offset, outer_color, world_pos[output_prim_vert_id], ndc_pos[output_prim_vert_id]);
|
offset, outer_color, world_pos[output_prim_vert_id], hs_pos[output_prim_vert_id]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2: {
|
case 2: {
|
||||||
/* draw the core of the line. */
|
/* draw the core of the line. */
|
||||||
output_line(
|
output_line(
|
||||||
vec2(0.0), inner_color, world_pos[output_prim_vert_id], ndc_pos[output_prim_vert_id]);
|
vec2(0.0), inner_color, world_pos[output_prim_vert_id], hs_pos[output_prim_vert_id]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3: {
|
case 3: {
|
||||||
/* draw the outline. */
|
/* draw the outline. */
|
||||||
output_line(
|
output_line(
|
||||||
-offset, outer_color, world_pos[output_prim_vert_id], ndc_pos[output_prim_vert_id]);
|
-offset, outer_color, world_pos[output_prim_vert_id], hs_pos[output_prim_vert_id]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 4: {
|
case 4: {
|
||||||
|
@ -153,7 +153,7 @@ void main()
|
||||||
output_line(offset * -2.0,
|
output_line(offset * -2.0,
|
||||||
vec4(colorActiveSpline.rgb, 0.0),
|
vec4(colorActiveSpline.rgb, 0.0),
|
||||||
world_pos[output_prim_vert_id],
|
world_pos[output_prim_vert_id],
|
||||||
ndc_pos[output_prim_vert_id]);
|
hs_pos[output_prim_vert_id]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ void main()
|
||||||
}
|
}
|
||||||
|
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
gl_PointSize = (!is_gpencil) ? sizeVertex * 2.0 : sizeVertexGpencil * 2.0;
|
gl_PointSize = (!is_gpencil) ? sizeVertex * 2.0 : sizeVertexGpencil * 2.0;
|
||||||
view_clipping_distances(world_pos);
|
view_clipping_distances(world_pos);
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ void main()
|
||||||
}
|
}
|
||||||
|
|
||||||
vec3 world_pos = point_object_to_world(final_pos);
|
vec3 world_pos = point_object_to_world(final_pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
finalColor = colorWireEdit;
|
finalColor = colorWireEdit;
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ void main()
|
||||||
|
|
||||||
vec3 world_pos = xAxis * pos.x + yAxis * pos.y + origin;
|
vec3 world_pos = xAxis * pos.x + yAxis * pos.y + origin;
|
||||||
|
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
view_clipping_distances(world_pos);
|
view_clipping_distances(world_pos);
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ void main()
|
||||||
{
|
{
|
||||||
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
||||||
|
|
||||||
gl_Position = point_world_to_ndc(pPosition);
|
gl_Position = point_world_to_homogenous(pPosition);
|
||||||
finalColor = pColor;
|
finalColor = pColor;
|
||||||
gl_PointSize = pSize;
|
gl_PointSize = pSize;
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ void main()
|
||||||
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
||||||
|
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
bool is_multiframe = (vflag & GP_EDIT_MULTIFRAME) != 0u;
|
bool is_multiframe = (vflag & GP_EDIT_MULTIFRAME) != 0u;
|
||||||
bool is_stroke_sel = (vflag & GP_EDIT_STROKE_SELECTED) != 0u;
|
bool is_stroke_sel = (vflag & GP_EDIT_STROKE_SELECTED) != 0u;
|
||||||
|
|
|
@ -17,7 +17,7 @@ void main()
|
||||||
}
|
}
|
||||||
|
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
/* Small offset in Z */
|
/* Small offset in Z */
|
||||||
gl_Position.z -= 3e-4;
|
gl_Position.z -= 3e-4;
|
||||||
|
|
|
@ -26,7 +26,7 @@ void main()
|
||||||
finalColor = vec4(weight_to_rgb(weight), 1.0);
|
finalColor = vec4(weight_to_rgb(weight), 1.0);
|
||||||
|
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
view_clipping_distances(world_pos);
|
view_clipping_distances(world_pos);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ void main()
|
||||||
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
||||||
|
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
weightColor = vec4(weight_to_rgb(weight), 1.0);
|
weightColor = vec4(weight_to_rgb(weight), 1.0);
|
||||||
|
|
||||||
view_clipping_distances(world_pos);
|
view_clipping_distances(world_pos);
|
||||||
|
|
|
@ -61,7 +61,7 @@ void main()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
finalColor.a *= (test_occlusion()) ? alpha : 1.0;
|
finalColor.a *= (test_occlusion()) ? alpha : 1.0;
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ void main()
|
||||||
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
||||||
|
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
fclem marked this conversation as resolved
|
|||||||
|
|
||||||
uvec4 m_data = data & uvec4(dataMask);
|
uvec4 m_data = data & uvec4(dataMask);
|
||||||
fclem marked this conversation as resolved
Clément Foucault
commented
You still need to fix the merge errors. This will not compile as You still need to fix the merge errors. This will not compile as `point_view_to_ndc` does not exist anymore.
You only removed the merge tags, but you need to remove what was below the `<<<<<<< HEAD` and do the renaming of what was above `>>>>>>> main`.
|
|||||||
|
|
||||||
|
|
|
@ -82,8 +82,8 @@ void main()
|
||||||
|
|
||||||
vec3 world_pos0 = point_object_to_world(in_pos0);
|
vec3 world_pos0 = point_object_to_world(in_pos0);
|
||||||
vec3 world_pos1 = point_object_to_world(in_pos1);
|
vec3 world_pos1 = point_object_to_world(in_pos1);
|
||||||
vec4 out_pos0 = point_world_to_ndc(world_pos0);
|
vec4 out_pos0 = point_world_to_homogenous(world_pos0);
|
||||||
fclem marked this conversation as resolved
Clément Foucault
commented
Here Here
|
|||||||
vec4 out_pos1 = point_world_to_ndc(world_pos1);
|
vec4 out_pos1 = point_world_to_homogenous(world_pos1);
|
||||||
uvec4 m_data0 = uvec4(in_data0) & uvec4(dataMask);
|
uvec4 m_data0 = uvec4(in_data0) & uvec4(dataMask);
|
||||||
fclem marked this conversation as resolved
Clément Foucault
commented
Same thing here. Same thing here.
|
|||||||
uvec4 m_data1 = uvec4(in_data1) & uvec4(dataMask);
|
uvec4 m_data1 = uvec4(in_data1) & uvec4(dataMask);
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
finalColor = mix(colorWire, colorVertexSelect, selection);
|
finalColor = mix(colorWire, colorVertexSelect, selection);
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ vec3 weight_to_rgb(float t)
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
if (useWeight) {
|
if (useWeight) {
|
||||||
finalColor = vec4(weight_to_rgb(selection), 1.0);
|
finalColor = vec4(weight_to_rgb(selection), 1.0);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec3 world_pos = point_object_to_world(vec3(au, 0.0));
|
vec3 world_pos = point_object_to_world(vec3(au, 0.0));
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
/* Snap vertices to the pixel grid to reduce artifacts. */
|
/* Snap vertices to the pixel grid to reduce artifacts. */
|
||||||
vec2 half_viewport_res = sizeViewport * 0.5;
|
vec2 half_viewport_res = sizeViewport * 0.5;
|
||||||
vec2 half_pixel_offset = sizeViewportInv * 0.5;
|
vec2 half_pixel_offset = sizeViewportInv * 0.5;
|
||||||
|
|
|
@ -45,14 +45,14 @@ void main()
|
||||||
/* Vertex shader per input vertex. */
|
/* Vertex shader per input vertex. */
|
||||||
vec3 world_pos0 = point_object_to_world(vec3(root_au0, 0.0));
|
vec3 world_pos0 = point_object_to_world(vec3(root_au0, 0.0));
|
||||||
vec3 world_pos1 = point_object_to_world(vec3(root_au1, 0.0));
|
vec3 world_pos1 = point_object_to_world(vec3(root_au1, 0.0));
|
||||||
vec4 ndc_pos0 = point_world_to_ndc(world_pos0);
|
vec4 hs_pos0 = point_world_to_homogenous(world_pos0);
|
||||||
vec4 ndc_pos1 = point_world_to_ndc(world_pos1);
|
vec4 hs_pos1 = point_world_to_homogeous(world_pos1);
|
||||||
|
|
||||||
/* Snap vertices to the pixel grid to reduce artifacts. */
|
/* Snap vertices to the pixel grid to reduce artifacts. */
|
||||||
vec2 half_viewport_res = sizeViewport * 0.5;
|
vec2 half_viewport_res = sizeViewport * 0.5;
|
||||||
vec2 half_pixel_offset = sizeViewportInv * 0.5;
|
vec2 half_pixel_offset = sizeViewportInv * 0.5;
|
||||||
ndc_pos0.xy = floor(ndc_pos0.xy * half_viewport_res) / half_viewport_res + half_pixel_offset;
|
hs_pos0.xy = floor(hs_pos0.xy * half_viewport_res) / half_viewport_res + half_pixel_offset;
|
||||||
ndc_pos1.xy = floor(ndc_pos1.xy * half_viewport_res) / half_viewport_res + half_pixel_offset;
|
hs_pos1.xy = floor(hs_pos1.xy * half_viewport_res) / half_viewport_res + half_pixel_offset;
|
||||||
|
|
||||||
#ifdef USE_EDGE_SELECT
|
#ifdef USE_EDGE_SELECT
|
||||||
bool is_select0 = (root_flag0 & EDGE_UV_SELECT) != 0;
|
bool is_select0 = (root_flag0 & EDGE_UV_SELECT) != 0;
|
||||||
|
@ -74,19 +74,19 @@ void main()
|
||||||
* actual pixels are at 0.75, 1.0 is used for the background. */
|
* actual pixels are at 0.75, 1.0 is used for the background. */
|
||||||
float depth0 = is_select0 ? 0.25 : 0.35;
|
float depth0 = is_select0 ? 0.25 : 0.35;
|
||||||
float depth1 = is_select1 ? 0.25 : 0.35;
|
float depth1 = is_select1 ? 0.25 : 0.35;
|
||||||
ndc_pos0.z = depth0;
|
hs_pos0.z = depth0;
|
||||||
ndc_pos1.z = depth1;
|
hs_pos1.z = depth1;
|
||||||
|
|
||||||
/* Avoid precision loss. */
|
/* Avoid precision loss. */
|
||||||
vec2 stipplePos0 = 500.0 + 500.0 * (ndc_pos0.xy / ndc_pos0.w);
|
vec2 stipplePos0 = 500.0 + 500.0 * (hs_pos0.xy / hs_pos0.w);
|
||||||
vec2 stipplePos1 = 500.0 + 500.0 * (ndc_pos1.xy / ndc_pos1.w);
|
vec2 stipplePos1 = 500.0 + 500.0 * (hs_pos1.xy / hs_pos1.w);
|
||||||
vec2 stippleStart0 = stipplePos0;
|
vec2 stippleStart0 = stipplePos0;
|
||||||
vec2 stippleStart1 = stipplePos1;
|
vec2 stippleStart1 = stipplePos1;
|
||||||
|
|
||||||
/* Geometry shader equivalent calculations. */
|
/* Geometry shader equivalent calculations. */
|
||||||
vec2 ss_pos[2];
|
vec2 ss_pos[2];
|
||||||
fclem marked this conversation as resolved
Clément Foucault
commented
This should become This should become `ndc_pos` since it is the position after the division.
|
|||||||
ss_pos[0] = ndc_pos0.xy / ndc_pos0.w;
|
ss_pos[0] = hs_pos0.xy / hs_pos0.w;
|
||||||
ss_pos[1] = ndc_pos1.xy / ndc_pos1.w;
|
ss_pos[1] = hs_pos1.xy / hs_pos1.w;
|
||||||
|
|
||||||
float half_size = sizeEdge;
|
float half_size = sizeEdge;
|
||||||
|
|
||||||
|
@ -108,19 +108,19 @@ void main()
|
||||||
switch (quad_vertex_id) {
|
switch (quad_vertex_id) {
|
||||||
case 1: /* vertex A */
|
case 1: /* vertex A */
|
||||||
case 3:
|
case 3:
|
||||||
do_vertex(ndc_pos1, selectionFac1, stippleStart1, stipplePos1, half_size, edge_ofs.xy);
|
do_vertex(hs_pos1, selectionFac1, stippleStart1, stipplePos1, half_size, edge_ofs.xy);
|
||||||
break;
|
break;
|
||||||
case 0: /* B */
|
case 0: /* B */
|
||||||
do_vertex(ndc_pos0, selectionFac0, stippleStart0, stipplePos0, half_size, edge_ofs.xy);
|
do_vertex(hs_pos0, selectionFac0, stippleStart0, stipplePos0, half_size, edge_ofs.xy);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2: /* C */
|
case 2: /* C */
|
||||||
case 4:
|
case 4:
|
||||||
do_vertex(ndc_pos0, selectionFac0, stippleStart0, stipplePos0, -half_size, -edge_ofs.xy);
|
do_vertex(hs_pos0, selectionFac0, stippleStart0, stipplePos0, -half_size, -edge_ofs.xy);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5: /* D */
|
case 5: /* D */
|
||||||
do_vertex(ndc_pos1, selectionFac1, stippleStart1, stipplePos1, -half_size, -edge_ofs.xy);
|
do_vertex(hs_pos1, selectionFac1, stippleStart1, stipplePos1, -half_size, -edge_ofs.xy);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec3 world_pos = point_object_to_world(vec3(au, 0.0));
|
vec3 world_pos = point_object_to_world(vec3(au, 0.0));
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
finalColor = ((flag & FACE_UV_SELECT) != 0) ? colorFaceDot : vec4(colorWire.rgb, 1.0);
|
finalColor = ((flag & FACE_UV_SELECT) != 0) ? colorFaceDot : vec4(colorWire.rgb, 1.0);
|
||||||
gl_PointSize = pointSize;
|
gl_PointSize = pointSize;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec3 world_pos = point_object_to_world(vec3(au, 0.0));
|
vec3 world_pos = point_object_to_world(vec3(au, 0.0));
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
bool is_selected = (flag & FACE_UV_SELECT) != 0u;
|
bool is_selected = (flag & FACE_UV_SELECT) != 0u;
|
||||||
bool is_active = (flag & FACE_UV_ACTIVE) != 0u;
|
bool is_active = (flag & FACE_UV_ACTIVE) != 0u;
|
||||||
|
|
|
@ -5,7 +5,7 @@ void main()
|
||||||
/* `pos` contains the coordinates of a quad (-1..1). but we need the coordinates of an image
|
/* `pos` contains the coordinates of a quad (-1..1). but we need the coordinates of an image
|
||||||
* plane (0..1) */
|
* plane (0..1) */
|
||||||
vec3 image_pos = pos * 0.5 + 0.5;
|
vec3 image_pos = pos * 0.5 + 0.5;
|
||||||
vec4 position = point_object_to_ndc(image_pos);
|
vec4 position = point_object_to_homogenous(image_pos);
|
||||||
gl_Position = position;
|
gl_Position = position;
|
||||||
uvs = image_pos.xy;
|
uvs = image_pos.xy;
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@ float area_ratio_to_stretch(float ratio, float tot_ratio)
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec3 world_pos = point_object_to_world(vec3(pos, 0.0));
|
vec3 world_pos = point_object_to_world(vec3(pos, 0.0));
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
#ifdef STRETCH_ANGLE
|
#ifdef STRETCH_ANGLE
|
||||||
vec2 v1 = angle_to_v2(uv_angles.x * M_PI);
|
vec2 v1 = angle_to_v2(uv_angles.x * M_PI);
|
||||||
|
|
|
@ -9,6 +9,6 @@ void main()
|
||||||
/* `pos` contains the coordinates of a quad (-1..1). but we need the coordinates of an image
|
/* `pos` contains the coordinates of a quad (-1..1). but we need the coordinates of an image
|
||||||
* plane (0..1) */
|
* plane (0..1) */
|
||||||
vec3 image_pos = pos * 0.5 + 0.5;
|
vec3 image_pos = pos * 0.5 + 0.5;
|
||||||
vec4 position = point_object_to_ndc(image_pos);
|
vec4 position = point_object_to_homogenous(image_pos);
|
||||||
gl_Position = position;
|
gl_Position = position;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ void main()
|
||||||
* Vertices are between 0.0 and 0.2, Edges between 0.2 and 0.4
|
* Vertices are between 0.0 and 0.2, Edges between 0.2 and 0.4
|
||||||
* actual pixels are at 0.75, 1.0 is used for the background. */
|
* actual pixels are at 0.75, 1.0 is used for the background. */
|
||||||
float depth = is_selected ? (is_pinned ? 0.05 : 0.10) : 0.15;
|
float depth = is_selected ? (is_pinned ? 0.05 : 0.10) : 0.15;
|
||||||
gl_Position = vec4(point_world_to_ndc(world_pos).xy, depth, 1.0);
|
gl_Position = vec4(point_world_to_homogenous(world_pos).xy, depth, 1.0);
|
||||||
gl_PointSize = pointSize;
|
gl_PointSize = pointSize;
|
||||||
|
|
||||||
/* calculate concentric radii in pixels */
|
/* calculate concentric radii in pixels */
|
||||||
|
|
|
@ -13,7 +13,7 @@ void main()
|
||||||
float screen_size = mul_project_m4_v3_zfac(p) * sizePixel;
|
float screen_size = mul_project_m4_v3_zfac(p) * sizePixel;
|
||||||
vec3 world_pos = p + screen_pos * screen_size;
|
vec3 world_pos = p + screen_pos * screen_size;
|
||||||
|
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
/* Convert to screen position [0..sizeVp]. */
|
/* Convert to screen position [0..sizeVp]. */
|
||||||
edgePos = edgeStart = ((gl_Position.xy / gl_Position.w) * 0.5 + 0.5) * sizeViewport.xy;
|
edgePos = edgeStart = ((gl_Position.xy / gl_Position.w) * 0.5 + 0.5) * sizeViewport.xy;
|
||||||
|
|
|
@ -42,7 +42,7 @@ void main()
|
||||||
ls_cell_location = ls_cell_location * 2.0 - 1.0;
|
ls_cell_location = ls_cell_location * 2.0 - 1.0;
|
||||||
|
|
||||||
vec3 ws_cell_location = (model_mat * vec4(ls_cell_location, 1.0)).xyz;
|
vec3 ws_cell_location = (model_mat * vec4(ls_cell_location, 1.0)).xyz;
|
||||||
gl_Position = point_world_to_ndc(ws_cell_location);
|
gl_Position = point_world_to_homogenous(ws_cell_location);
|
||||||
gl_PointSize = sizeVertex * 2.0;
|
gl_PointSize = sizeVertex * 2.0;
|
||||||
|
|
||||||
finalColor = color_from_id(color_id);
|
finalColor = color_from_id(color_id);
|
||||||
|
|
|
@ -9,7 +9,7 @@ void main()
|
||||||
finalColor = vec4(obmat[0][3], obmat[1][3], obmat[2][3], obmat[3][3]);
|
finalColor = vec4(obmat[0][3], obmat[1][3], obmat[2][3], obmat[3][3]);
|
||||||
|
|
||||||
vec3 world_pos = (ModelMatrix * vec4(pos, 1.0)).xyz;
|
vec3 world_pos = (ModelMatrix * vec4(pos, 1.0)).xyz;
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
gl_PointSize = sizeVertex * 2.0;
|
gl_PointSize = sizeVertex * 2.0;
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
gl_PointSize = sizeObjectCenter;
|
gl_PointSize = sizeObjectCenter;
|
||||||
float radius = 0.5 * sizeObjectCenter;
|
float radius = 0.5 * sizeObjectCenter;
|
||||||
|
|
|
@ -209,7 +209,7 @@ void main()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
/* Convert to screen position [0..sizeVp]. */
|
/* Convert to screen position [0..sizeVp]. */
|
||||||
edgePos = edgeStart = ((gl_Position.xy / gl_Position.w) * 0.5 + 0.5) * sizeViewport.xy;
|
edgePos = edgeStart = ((gl_Position.xy / gl_Position.w) * 0.5 + 0.5) * sizeViewport.xy;
|
||||||
|
|
|
@ -10,7 +10,7 @@ vec2 screen_position(vec4 p)
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
#ifdef SELECT_EDGES
|
#ifdef SELECT_EDGES
|
||||||
/* HACK: to avoid losing sub-pixel object in selections, we add a bit of randomness to the
|
/* HACK: to avoid losing sub-pixel object in selections, we add a bit of randomness to the
|
||||||
|
|
|
@ -5,6 +5,6 @@
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
view_clipping_distances(world_pos);
|
view_clipping_distances(world_pos);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@ void main()
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
if (isCameraBackground) {
|
if (isCameraBackground) {
|
||||||
/* Model matrix converts to view position to avoid jittering (see #91398). */
|
/* Model matrix converts to view position to avoid jittering (see #91398). */
|
||||||
gl_Position = point_view_to_ndc(world_pos);
|
gl_Position = point_view_to_homogenous(world_pos);
|
||||||
/* Camera background images are not really part of the 3D space.
|
/* Camera background images are not really part of the 3D space.
|
||||||
* It makes no sense to apply clipping on them. */
|
* It makes no sense to apply clipping on them. */
|
||||||
view_clipping_distances_bypass();
|
view_clipping_distances_bypass();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
view_clipping_distances(world_pos);
|
view_clipping_distances(world_pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ void main()
|
||||||
vec3 world_pos;
|
vec3 world_pos;
|
||||||
if (hairThicknessRes > 1) {
|
if (hairThicknessRes > 1) {
|
||||||
/* Calculate the thickness, thicktime, worldpos taken into account the outline. */
|
/* Calculate the thickness, thicktime, worldpos taken into account the outline. */
|
||||||
float outline_width = point_world_to_ndc(center_wpos).w * 1.25 * sizeViewportInv.y *
|
float outline_width = point_world_to_homogenous (center_wpos).w * 1.25 * sizeViewportInv.y *
|
||||||
fclem marked this conversation as resolved
Clément Foucault
commented
Did you run Did you run `make format`? there is an extra blank space here that should have been fixed by clang format.
|
|||||||
drw_view.wininv[1][1];
|
drw_view.wininv[1][1];
|
||||||
thickness += outline_width;
|
thickness += outline_width;
|
||||||
float thick_time = float(gl_VertexID % hairThicknessRes) / float(hairThicknessRes - 1);
|
float thick_time = float(gl_VertexID % hairThicknessRes) / float(hairThicknessRes - 1);
|
||||||
|
@ -59,7 +59,7 @@ void main()
|
||||||
world_pos = center_wpos;
|
world_pos = center_wpos;
|
||||||
}
|
}
|
||||||
|
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
#ifdef USE_GEOM
|
#ifdef USE_GEOM
|
||||||
vert.pos = point_world_to_view(world_pos);
|
vert.pos = point_world_to_view(world_pos);
|
||||||
|
|
|
@ -32,8 +32,8 @@ void main()
|
||||||
vec3 ray_ori = pos;
|
vec3 ray_ori = pos;
|
||||||
vec3 ray_dir = (is_persp) ? (drw_view.viewinv[3].xyz - pos) : drw_view.viewinv[2].xyz;
|
vec3 ray_dir = (is_persp) ? (drw_view.viewinv[3].xyz - pos) : drw_view.viewinv[2].xyz;
|
||||||
vec3 isect = ray_plane_intersection(ray_ori, ray_dir, gpDepthPlane);
|
vec3 isect = ray_plane_intersection(ray_ori, ray_dir, gpDepthPlane);
|
||||||
vec4 ndc = point_world_to_ndc(isect);
|
vec4 hs = point_world_to_homogenous(isect);
|
||||||
fclem marked this conversation as resolved
Clément Foucault
commented
Rename to Rename to `hs_isect`.
|
|||||||
gl_FragDepth = (ndc.z / ndc.w) * 0.5 + 0.5;
|
gl_FragDepth = (hs.z / hs.w) * 0.5 + 0.5;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
gl_FragDepth = gl_FragCoord.z;
|
gl_FragDepth = gl_FragCoord.z;
|
||||||
|
|
|
@ -30,7 +30,7 @@ void main()
|
||||||
{
|
{
|
||||||
vec3 world_pos = pointcloud_get_pos();
|
vec3 world_pos = pointcloud_get_pos();
|
||||||
|
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
/* Small bias to always be on top of the geom. */
|
/* Small bias to always be on top of the geom. */
|
||||||
gl_Position.z -= 1e-3;
|
gl_Position.z -= 1e-3;
|
||||||
|
|
|
@ -29,7 +29,7 @@ void main()
|
||||||
{
|
{
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
|
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
#ifdef USE_GEOM
|
#ifdef USE_GEOM
|
||||||
vert.pos = point_world_to_view(world_pos);
|
vert.pos = point_world_to_view(world_pos);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -46,7 +46,7 @@ void main()
|
||||||
vertex_id_from_index_id(4 * line_prim_id + i), pos, vec3);
|
vertex_id_from_index_id(4 * line_prim_id + i), pos, vec3);
|
||||||
world_pos[i] = point_object_to_world(in_pos);
|
world_pos[i] = point_object_to_world(in_pos);
|
||||||
view_pos[i] = point_world_to_view(world_pos[i]);
|
view_pos[i] = point_world_to_view(world_pos[i]);
|
||||||
gl_pos[i] = point_world_to_ndc(world_pos[i]);
|
gl_pos[i] = point_world_to_homogenous(world_pos[i]);
|
||||||
gl_pos[i].z -= 1e-3;
|
gl_pos[i].z -= 1e-3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ void main()
|
||||||
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
||||||
|
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
bool is_select = (nor.w > 0.0);
|
bool is_select = (nor.w > 0.0);
|
||||||
bool is_hidden = (nor.w < 0.0);
|
bool is_hidden = (nor.w < 0.0);
|
||||||
|
|
|
@ -9,7 +9,7 @@ void main()
|
||||||
bool is_hidden = (nor.w < 0.0);
|
bool is_hidden = (nor.w < 0.0);
|
||||||
|
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
/* Add offset in Z to avoid Z-fighting and render selected wires on top. */
|
/* Add offset in Z to avoid Z-fighting and render selected wires on top. */
|
||||||
/* TODO: scale this bias using Z-near and Z-far range. */
|
/* TODO: scale this bias using Z-near and Z-far range. */
|
||||||
gl_Position.z -= (is_select ? 2e-4 : 1e-4);
|
gl_Position.z -= (is_select ? 2e-4 : 1e-4);
|
||||||
|
|
|
@ -6,7 +6,7 @@ void main()
|
||||||
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
||||||
|
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
uv_interp = mu;
|
uv_interp = mu;
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ void main()
|
||||||
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
||||||
|
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
finalColor = srgb_to_linear_attr(ac);
|
finalColor = srgb_to_linear_attr(ac);
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ void main()
|
||||||
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
GPU_INTEL_VERTEX_SHADER_WORKAROUND
|
||||||
|
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
/* Separate actual weight and alerts for independent interpolation */
|
/* Separate actual weight and alerts for independent interpolation */
|
||||||
weight_interp = max(vec2(weight, -weight), 0.0);
|
weight_interp = max(vec2(weight, -weight), 0.0);
|
||||||
|
|
|
@ -9,7 +9,7 @@ void main()
|
||||||
bool is_hidden = (nor.w < 0.0) && useSelect;
|
bool is_hidden = (nor.w < 0.0) && useSelect;
|
||||||
|
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
/* Add offset in Z to avoid Z-fighting and render selected wires on top. */
|
/* Add offset in Z to avoid Z-fighting and render selected wires on top. */
|
||||||
/* TODO: scale this bias using Z-near and Z-far range. */
|
/* TODO: scale this bias using Z-near and Z-far range. */
|
||||||
gl_Position.z -= (is_select ? 2e-4 : 1e-4);
|
gl_Position.z -= (is_select ? 2e-4 : 1e-4);
|
||||||
|
|
|
@ -21,7 +21,7 @@ void main()
|
||||||
vec3 world_pos = part_pos;
|
vec3 world_pos = part_pos;
|
||||||
|
|
||||||
#ifdef USE_DOTS
|
#ifdef USE_DOTS
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
/* World sized points. */
|
/* World sized points. */
|
||||||
gl_PointSize = sizePixel * draw_size * drw_view.winmat[1][1] * sizeViewport.y / gl_Position.w;
|
gl_PointSize = sizePixel * draw_size * drw_view.winmat[1][1] * sizeViewport.y / gl_Position.w;
|
||||||
#else
|
#else
|
||||||
|
@ -34,7 +34,7 @@ void main()
|
||||||
world_pos += rotate(pos, part_rot) * draw_size;
|
world_pos += rotate(pos, part_rot) * draw_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Coloring */
|
/* Coloring */
|
||||||
|
|
|
@ -5,5 +5,5 @@
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec3 world_pos = pointcloud_get_pos();
|
vec3 world_pos = pointcloud_get_pos();
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
finalColor = vec4(selection);
|
finalColor = vec4(selection);
|
||||||
finalColor.a *= opacity;
|
finalColor.a *= opacity;
|
||||||
|
|
|
@ -26,7 +26,7 @@ void main()
|
||||||
thickness,
|
thickness,
|
||||||
thick_time);
|
thick_time);
|
||||||
|
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
mask_weight = 1.0 - (selection_opacity - retrieve_selection() * selection_opacity);
|
mask_weight = 1.0 - (selection_opacity - retrieve_selection() * selection_opacity);
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
faceset_color = mix(vec3(1.0), fset, faceSetsOpacity);
|
faceset_color = mix(vec3(1.0), fset, faceSetsOpacity);
|
||||||
mask_color = 1.0 - (msk * maskOpacity);
|
mask_color = 1.0 - (msk * maskOpacity);
|
||||||
|
|
|
@ -4,6 +4,6 @@
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
finalColor = attribute_value;
|
finalColor = attribute_value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ void main()
|
||||||
time,
|
time,
|
||||||
thickness,
|
thickness,
|
||||||
thick_time);
|
thick_time);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
|
|
||||||
if (is_point_domain) {
|
if (is_point_domain) {
|
||||||
finalColor = texelFetch(color_tx, hair_get_base_id());
|
finalColor = texelFetch(color_tx, hair_get_base_id());
|
||||||
|
|
|
@ -4,6 +4,6 @@
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
finalColor = attribute_value;
|
finalColor = attribute_value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,6 @@
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec3 world_pos = pointcloud_get_pos();
|
vec3 world_pos = pointcloud_get_pos();
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
finalColor = pointcloud_get_customdata_vec4(attribute_tx);
|
finalColor = pointcloud_get_customdata_vec4(attribute_tx);
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,5 +95,5 @@ void main()
|
||||||
pos += rotated_pos * cellSize;
|
pos += rotated_pos * cellSize;
|
||||||
|
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
}
|
}
|
||||||
|
|
|
@ -189,5 +189,5 @@ void main()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
vec3 world_pos = point_object_to_world(pos);
|
vec3 world_pos = point_object_to_world(pos);
|
||||||
gl_Position = point_world_to_ndc(world_pos);
|
gl_Position = point_world_to_homogenous(world_pos);
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,7 @@ void main()
|
||||||
|
|
||||||
float facing = dot(wnor, V);
|
float facing = dot(wnor, V);
|
||||||
|
|
||||||
gl_Position = point_world_to_ndc(wpos);
|
gl_Position = point_world_to_homogenous(wpos);
|
||||||
|
|
||||||
#ifndef CUSTOM_DEPTH_BIAS
|
#ifndef CUSTOM_DEPTH_BIAS
|
||||||
float facing_ratio = clamp(1.0 - facing * facing, 0.0, 1.0);
|
float facing_ratio = clamp(1.0 - facing * facing, 0.0, 1.0);
|
||||||
|
|
Loading…
Reference in New Issue
Here.