Falcor
Falcor copied to clipboard
IgnoreHit not working
Hi,
I took a simple ray tracing example that should ignore the rays that hit a transparent material but it seems that the IgnoreHit is not working.
I tried to just ignore all the hits, like this:
[shader("anyhit")] void TestAnyHit(inout TestRayPayload rayData, BuiltinIntersectionAttribs attribs) { IgnoreHit(); }
But the results is still the same. Should I do anything else to ignore a hit?
Thank you =)
2 possible issues:
- The material are not really transparent. Search for
D3D12_RAYTRACING_GEOMETRY_FLAG_OPAQUE
inRtModel.cpp
. If we set this flag, the AHS will never be called. We're only marking materials as transparent if their base color map contains an alpha channel (which is wrong, but that's the current behavior) - You don't add the AHS to the
RtProgram
you create
I'm guessing it's probably the first. If the material uses a constant transprency value, the material won't be marked as transparent. Material::setBaseColor()
should check for the alpha value and if it's not 1 set the alpha mode to AlphaModeMask
It was the first option! It is working now, thank you!!! =)
Re-opening it. We need to fix it in a future release