-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Implement trapezoidal shadow maps (TSM) #599
Comments
I did some poking around and I am not too well versed on the generation of shadows, but from what I understand, each light renders the depth pass of the frustum from its perspective. The whole point of this technique would be to skew the coordinates of the render to fit the frustum to the full texture size, now I'm not sure what we can do to intercept the shadow map generation but I imagine this technique could be stored in a matrix and applied during the depth pass render. I wonder if passing some augmentation matrix could work, but I'm not exactly sure where, if anyone has any ideas on how I could augment the depth pass that would help, because it almost looks like its just linking some depth pass to the shadow map. |
Related to #262. Is this a different technique? |
Looks different. After some skimming, I don't see the same math or technique but that one seems to improve the quality a bit. I think in that one he is stretching the AABB of the frustum up to get less of the pixelation on the edge although you can still see a bit of the same pixelation in the second image they provided. I think the frustum could be corrected even more by getting the bound trapezoid of the frustum then scaling that to the full texture resolution of the depth map. Also I think that snippet is good as an addon for now but it would be nice to have that as an option in the directional light eventually. I'll keep trying to augment the shadowmaps using TSM in my own fork for now, and I'll make a PR when I'm done. |
Now that godotengine/godot#37678 was merged, shadowmapping quality was hugely improved. @jedStevens Please test the current |
Closing per the above comment. |
I was thinking of implementing TSM for the engine, but I'm not sure it's worth it if Vulkan is coming. I suppose it could be useful for 3.2 users. Let me know if this is something worth while.
This link describes the technique: https://www.comp.nus.edu.sg/~tants/tsm/tsm.pdf
Essentially it transforms the shadow maps into a trapezoid shape to increase quality of shadows. I notice in 3.2 there are some ugly artifacts with directional lights and it'd be a nice option to flick on TSM for the light to increase the shadow quality.
I assume that Godot doesn't do this already but I thought I'd leave it here for now to start a discussion on the quality of the shadows as is.
This could be a good solution, unless someone has a better idea in the works I am unaware of.
The text was updated successfully, but these errors were encountered: