-
Notifications
You must be signed in to change notification settings - Fork 188
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
Improve beam rendering #108
Conversation
Store a 'depth' together with the transparency, and face it if the next 'opaque' surface is closer than that depth.
This gives beams a soft edge if close to surfaces.
This is a good contribution, thank you! I just gave it a quick try and noticed one issue: the beams are missing end caps. For example, in the baseq2 Also, did you check performance? On your screenshots, there is a significant difference: 136 FPS on the old code vs. 105 FPS on the new code. But I didn't notice anything that dramatic during my test. |
This provides a measurable performance difference.
About the framerate: This large difference is due to the "current" screenshot having been made with the build from Steam (ie a Release build), while I took the "new" screenshot with a Debug build. About the end caps: Sure, I can look at that. |
End caps (end spheres, really) are now on the branch, enjoy! |
…intersection logic into path_tracer_hit_shaders.h.
As you may have noticed, version 1.5 of q2rtx has been released today, featuring ray queries. This pull request didn't quite make it into this update, but it's still a good one. Prior to release, I've updated the PR branch to work with ray queries and with the transparency UBO changes made in r1.5; it's pushed into the |
Hey, thanks for providing the updated branch. I'll play around a bit, maybe I can find something wrt the performance drop. |
So I tried to look into the performance drop. |
An additional observation: the contents of the shader don't matter either. Just having As for an explanation... no idea. Blame the driver? Perhaps it's taking a different code path and/or doing something weird when an intersection shader is present? Perhaps a way to deal with the issue would try to rearrange the pipelines, try to leave the intersection shader out of the pipelines that don't really use it (eg direct, indirect lighting). Maybe I give it a try, even if it'll complicate the pipeline creation & handling, and seems more like a workaround for some other issue elsewhere. |
Hello again. I was able to "rearrange" the pipelines, exclude the intersection shader (actually, all "transparency" shaders) from the pipelines that currently don't use them - see the latest commits. Turned out it wasn't as complicated as I feared. For me this brought the frametime onto the same level as with ray queries, so perhaps give it a spin. FWIW, if nothing else, consider cherry-picking c63c0e3, as that replaces some magic numbers with symbolic constants. |
This was a great investigation, thank you! I've made some minor changes - re-enabled the particles/sprites for the first indirect bounce, but not beams, because the particles can affect smooth specular reflections. This is merged now. |
Q2RTX currently supports beam rendering; however, it has some shortcomings:
To make the beams look a bit better, this pull request contains the following changes:
Image for comparison (using a small test map):