Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed hardware ray tracing issue #32

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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 :)

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.

3 participants