-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Add raytraced shadows #2932
Comments
This sounds like screen-space contact shadows, which are supported in Also, most games can't live with perfectly hard shadows nowadays. They need soft shadows somehow. If you want to use fully baked lightmapping and have dynamic objects still cast shadow maps, #2354 is likely a better solution. |
Judging by the Way SSCS glitches, my method clearly avoids some of the issues, as SSCS clearly don't get each individual pixel's world point and then ray cast to all possible affecting lights to look for occlusion between the point and the lights, something that SSCS obviously isn't doing on a per-pixel level or it'd have a continuous, perfectly hard shadow without that white gap. Perfect, Hard shadows versus Imperfect (due to things like Shadow map resolution limitations, PP, and Shadow acne), Soft shadows that are also more complicated to use right.. it's a trade off, and also depends on the style. #2354 is a good proposal, however it has very little to do with this proposal, aside from improving Shadows.. My proposal would probably suffer from a significant performance drop when used (atleast on older, pre RT hardware), and would probably require RTX to work in a playable form, as it is asking for 120 million rays per light (if each light affects whole screen) per second for 1080p 60 fps, and considering that an RTX 2060 is supposedly capable of shooting 5 Billion rays per second (according to https://en.wikipedia.org/wiki/List_of_Nvidia_graphics_processing_units#GeForce_20_series), that'd amount to a total of ~40 Lights taking up full screen for a standard 16:9 1080p 60 fps XP, however that is only IF RTX can be used for the occlusion tests like intended, which I mean, probably, but might not be the case... |
@mrjustaguy What you described above is essentially a high level overview of ray traced shadows. Which, as you know, is really only feasible on the highest-end graphics cards right now. RTX hardware provides two improvements necessary:
Without RTX hardware you are limited to using data the renderer already has available like shadowmaps, or, as Calinou pointed out above, the depth map. |
Ok, I managed to make a Proof of Concept for a way to get the desired effect for Directional Lights, but without RT, However it is unclear how GPU friendly it is, and would probably at the very least need Compute POC.zip (made in current stable) Idea Behind it:
Proof of Concept Notes: This means the things that aren't done that need to be for real world application are:
This would likely outperform Ray Traced directional Shadows in the OP because this is just 2 Depth Rasterizations, one being the Camera, and other being the Directional Light for all the points the 1st Depth map provides, and would result with the same thing as the OP desired, and would also possibly allow for having Soft shadows by in the 2nd Depth map rendering, by depth testing around the point it's testing. |
seems like duplicate of #3073, and figured out how to get Directional Shadows to look fairly good and RT Should probably be discussed on a broader level (Shadows, Reflections, AO, things like that), with a higher quality proposal. |
Disclaimer: This is Just an idea, I'm no rendering expert and the feasibility (On Current Hardware and Future Hardware) and possible performance of this is highly questionable and as such is not expected to be Seriously Implemented, especially in any near future, but is here instead more for providing inspiration for anyone in the field trying to deal with this issue. Should this end up being doable and implemented, that'd be great to see, but I doubt that'll be the case as to my understanding GPUs have a very Rigid Rendering Pipeline that wouldn't play nice with the idea (as in just wouldn't want to do it)
Describe the project you are working on
A game requiring Good Shadows
Describe the problem or limitation you are having in your project
Shadow Maps are a Pain to get to look Good and without issues like Peter-panning, Shadow Acne etc...
Describe the feature / enhancement and how it helps to overcome the problem or limitation
The Idea's to Not use Shadow maps, but instead, to detect for each pixel, which lights would normally affect it, and to see if said lights are occluded or not (so under shadow or not)
Reasoning:
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
If this enhancement will not be used often, can it be worked around with a few lines of script?
No
Is there a reason why this should be core and not an add-on in the asset library?
Rendering is Core
The text was updated successfully, but these errors were encountered: