mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
make xray error noise depend on background color
This commit is contained in:
parent
4a8385e3e8
commit
1b2cc7f7a7
1 changed files with 4 additions and 2 deletions
|
@ -61,7 +61,8 @@ fragment =
|
||||||
float intersection_count = texture2D(u_layer2, v_uvs).r * 255.0;
|
float intersection_count = texture2D(u_layer2, v_uvs).r * 255.0;
|
||||||
if(mod(intersection_count, 2.0) >= 1.0)
|
if(mod(intersection_count, 2.0) >= 1.0)
|
||||||
{
|
{
|
||||||
if (hash12(v_uvs) > 0.5)
|
float lightness = (result.r + result.g + result.b) / 3.0;
|
||||||
|
if (hash12(v_uvs) < lightness)
|
||||||
{
|
{
|
||||||
result = result * (1.0 - u_xray_error_strength) + u_xray_error_strength * u_error_color;
|
result = result * (1.0 - u_xray_error_strength) + u_xray_error_strength * u_error_color;
|
||||||
}
|
}
|
||||||
|
@ -149,7 +150,8 @@ fragment41core =
|
||||||
float intersection_count = texture(u_layer2, v_uvs).r * 255.0;
|
float intersection_count = texture(u_layer2, v_uvs).r * 255.0;
|
||||||
if(mod(intersection_count, 2.0) >= 1.0)
|
if(mod(intersection_count, 2.0) >= 1.0)
|
||||||
{
|
{
|
||||||
if (hash12(v_uvs) > 0.5)
|
float lightness = (result.r + result.g + result.b) / 3.0;
|
||||||
|
if (hash12(v_uvs) < lightness)
|
||||||
{
|
{
|
||||||
result = result * (1.0 - u_xray_error_strength) + u_xray_error_strength * u_error_color;
|
result = result * (1.0 - u_xray_error_strength) + u_xray_error_strength * u_error_color;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue