mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-07 14:04:03 -06:00
Reduce branches in shader.
part of the further fallout of CURA-7147
This commit is contained in:
parent
7ed59503d6
commit
d078c465ee
1 changed files with 5 additions and 10 deletions
|
@ -68,11 +68,9 @@ fragment =
|
|||
|
||||
finalColor = (-normal.y > u_overhangAngle) ? u_overhangColor : finalColor;
|
||||
|
||||
if(u_renderError > 0.5)
|
||||
{
|
||||
vec3 grid = vec3(f_vertex.x - floor(f_vertex.x - 0.5), f_vertex.y - floor(f_vertex.y - 0.5), f_vertex.z - floor(f_vertex.z - 0.5));
|
||||
finalColor.a = dot(grid, grid) < 0.245 ? 0.667 : 1.0;
|
||||
}
|
||||
vec3 grid = vec3(f_vertex.x - floor(f_vertex.x - 0.5), f_vertex.y - floor(f_vertex.y - 0.5), f_vertex.z - floor(f_vertex.z - 0.5));
|
||||
finalColor.a = (u_renderError > 0.5) && dot(grid, grid) < 0.245 ? 0.667 : 1.0;
|
||||
|
||||
gl_FragColor = finalColor;
|
||||
}
|
||||
|
||||
|
@ -144,11 +142,8 @@ fragment41core =
|
|||
finalColor = (u_faceId != gl_PrimitiveID) ? ((-normal.y > u_overhangAngle) ? u_overhangColor : finalColor) : u_faceColor;
|
||||
|
||||
frag_color = finalColor;
|
||||
if(u_renderError > 0.5)
|
||||
{
|
||||
vec3 grid = f_vertex - round(f_vertex);
|
||||
frag_color.a = dot(grid, grid) < 0.245 ? 0.667 : 1.0;
|
||||
}
|
||||
vec3 grid = f_vertex - round(f_vertex);
|
||||
frag_color.a = (u_renderError > 0.5) && dot(grid, grid) < 0.245 ? 0.667 : 1.0;
|
||||
}
|
||||
|
||||
[defaults]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue