-
Notifications
You must be signed in to change notification settings - Fork 22
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
UE4 Atmosphere shader breaks with Ray Tracing Enabled #1
Comments
How exactly does it break? does it just disappear? |
Hey Dimev, Yes. I can tell you exactly how. I get a The issue is in your Get Max Distance custom expression node. Any ideas how we could re-write that Texture2DSampleLevel function to not need this struct? Maybe we can add an input to Get Max Distance to replace that or just try and do it all with nodes?
|
Someone else also had this issue in the 4.25 preview The code I'm using here essentially makes sure the distance returned by the depth buffer is correct, because using the scene depth node divided by the dot product of the forward and camera vector directly results in the depth not being 100% accurate at large distances. I assume the issue has something to do with the material being involved in raytracing. maybe it can be fixed by somehow making the material not a closest hit shader, but I'll have to look at it, and maybe a different workaround of the max distance thing. |
If you have any ideas I may be able to implement, happy to try. If there is any way to do it without HLSL that'd be safer of course. |
The weird depth thing is because the ue4 devs added a very small value to DeviceZToWorldZ to avoid dividing by 0 in one shader in the engine (which is a stupid hack, just do proper divide by zero checking), causing the depth to be inaccurate, and needing this workaround (written by Dexyfex, not me) There's probably a way to get around this with only nodes, but that needs investigation. Probably dividing the resulting depth by some values using nodes may work, but I haven't had success with that so far |
I found a fix for the issue, I'll soon upload a 4.25 version of the project and close this.
|
I uploaded the version with the fix, should work now |
Heya,
I have a project that requires ray tracing enabled even though my space scene does not use it. When I enable ray tracing in the project settings the shader stops working. Any ideas how to fix?
The text was updated successfully, but these errors were encountered: