Skip to content

Conversation

pixelpunk-DE
Copy link

fixes xverse-engine/XV3DGS-UEPlugin #31

In the custom material function discard was changed to alpha = 0.0f.
Because discard does not seem to be supported in HW ray tracing.

@bell-one
Copy link

bell-one commented Jun 4, 2024

Hello pixelpunk,

I have issue with my unreal 5.2 with hardware raytracing
and I tried your commit with two binary files chang but it doesn't show any different with my project,

Is there anything for me to do more then changing M_GS_relight.uasset / M_GS_unlit.uasset in plugins?

@pixelpunk-DE
Copy link
Author

Yes, that's all that changed.
On both materials it should change in this custom node:
image

from discard to alpha = 0.0f;

Which errors do you have in the shader of the original branch?

@Ben-Garcia-DB-Solutions
Copy link

Ben-Garcia-DB-Solutions commented Jun 20, 2024

Implimenting this fix also works for me. Although I found I have the edit

if (power > 0.0f)
  	discard;

to be

if (power > 0.0f)
   	return 0.0f;

to get rid of errors. I think this is the correct adjustment but I don't know HLSL at all so not committing it!

@pixelpunk-DE
Copy link
Author

Yes. I am not an HLSL expert myself. But as far as I understand is that the discard operation is a rasterize operation, which is not supported in SM5+ raytracing.
So instead of discarding the pixel, we set it to be transparent. That adds a bit to the shader costs but makes it work with h/w rt.

So please feel free to add it :)

@LindenChance
Copy link

Thanks so much for finding this. I had to replace 2 discard statements to get mine working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants