From 2873439ec8d6ee172cc5c936dc237c9b69eb596d Mon Sep 17 00:00:00 2001 From: Sascha Willems Date: Sun, 1 Sep 2024 19:08:39 +0200 Subject: [PATCH] Fix ray tracing related validation errors --- shaders/glsl/raytracinggltf/anyhit.rahit | 8 +++----- shaders/glsl/raytracinggltf/anyhit.rahit.spv | Bin 7052 -> 7120 bytes .../raytracingshadows/closesthit.rchit.spv | Bin 5840 -> 5844 bytes 3 files changed, 3 insertions(+), 5 deletions(-) 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 61b05eb83f169b7b4d54567c6eb005f0c2ee815b..94915183696e1148c390806554ba63789c24442d 100644 GIT binary patch delta 658 zcmZ8eJugFH7=7M;-QG%@3SuCr#vo#DL`qo7V8Cc`qxUvVw3>=R4E+O^ri003GRj@> z2dq|$fyq~?ueMYX&hzn}H+MgAnFxD5aZP+mx+EySf1TYjyX7-EbjR7zoGu(5H?E=U5AfE0#`-iB=92lxeM zEByg06a4`TtrYP^kY#N=2iDn~J2Pj_%-p^A+4HO(4y84rND&uP;;b}f@z}h!J&cmZKK1|7R+;@A)=hz?o=59~` diff --git a/shaders/glsl/raytracingshadows/closesthit.rchit.spv b/shaders/glsl/raytracingshadows/closesthit.rchit.spv index 6b84f0a06f166810cd0d4475ba3a4745bbb99ef5..92b2b6d7e5a921bdf62ad7a16702b6ada5bbc291 100644 GIT binary patch delta 41 wcmcbhdqtOxnMs+Qfn_5b4~qyJ!x;t!hV-2Hpv20M+{6mkh!BR&N-XPy0LfemX8-^I delta 37 scmcbjdqJ0tnMs+QfpsGr4~qaR!x;t!hV-0xkIa$~*NBkKYAox70H2Hr8UO$Q