make xray counting color hardcoded value

Somewhere between the xray.shader and the xray_composite.shader the colors are stored as unsigned int.
Since we want to count the integer number of faces behind a pixel in the red channel, we simply use a color with an r value of 1/255.
This commit is contained in:
Tim Kuipers 2019-10-22 11:27:30 +02:00
parent b515a0f744
commit 4a8385e3e8
4 changed files with 6 additions and 8 deletions

View file

@ -58,7 +58,7 @@ fragment =
result = layer0 * layer0.a + result * (1.0 - layer0.a);
float intersection_count = (texture2D(u_layer2, v_uvs).r * 255.0) / 5.0;
float intersection_count = texture2D(u_layer2, v_uvs).r * 255.0;
if(mod(intersection_count, 2.0) >= 1.0)
{
if (hash12(v_uvs) > 0.5)
@ -146,7 +146,7 @@ fragment41core =
result = layer0 * layer0.a + result * (1.0 - layer0.a);
float intersection_count = (texture(u_layer2, v_uvs).r * 255.0) / 5.0;
float intersection_count = texture(u_layer2, v_uvs).r * 255.0;
if(mod(intersection_count, 2.0) >= 1.0)
{
if (hash12(v_uvs) > 0.5)