Fix ray tracing related validation errors

This commit is contained in:
Sascha Willems 2024-09-01 19:08:39 +02:00
parent 359a3b07ad
commit 2873439ec8
3 changed files with 3 additions and 5 deletions

View file

@ -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;
}
// }
}
}