diff --git a/shaders/glsl/raytracinggltf/anyhit.rahit b/shaders/glsl/raytracinggltf/anyhit.rahit index da54723c..7ca0bea0 100644 --- a/shaders/glsl/raytracinggltf/anyhit.rahit +++ b/shaders/glsl/raytracinggltf/anyhit.rahit @@ -12,7 +12,6 @@ #extension GL_EXT_scalar_block_layout : require #extension GL_EXT_shader_explicit_arithmetic_types_int64 : require -layout(location = 0) rayPayloadInEXT vec3 hitValue; layout(location = 3) rayPayloadInEXT uint payloadSeed; hitAttributeEXT vec2 attribs; @@ -40,10 +39,9 @@ void main() vec4 color = texture(textures[nonuniformEXT(geometryNode.textureIndexBaseColor)], tri.uv); // If the alpha value of the texture at the current UV coordinates is below a given threshold, we'll ignore this intersection // That way ray traversal will be stopped and the miss shader will be invoked -// if (color.a < 0.9) { - //if (((gl_LaunchIDEXT.y * gl_LaunchSizeEXT.x + gl_LaunchIDEXT.x) % 4) == 0) { - if(rnd(payloadSeed) > color.a) { + if (color.a < 0.9) { + if(rnd(payloadSeed) > color.a) { ignoreIntersectionEXT; } -// } + } } \ No newline at end of file diff --git a/shaders/glsl/raytracinggltf/anyhit.rahit.spv b/shaders/glsl/raytracinggltf/anyhit.rahit.spv index 61b05eb8..94915183 100644 Binary files a/shaders/glsl/raytracinggltf/anyhit.rahit.spv and b/shaders/glsl/raytracinggltf/anyhit.rahit.spv differ diff --git a/shaders/glsl/raytracingshadows/closesthit.rchit.spv b/shaders/glsl/raytracingshadows/closesthit.rchit.spv index 6b84f0a0..92b2b6d7 100644 Binary files a/shaders/glsl/raytracingshadows/closesthit.rchit.spv and b/shaders/glsl/raytracingshadows/closesthit.rchit.spv differ