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

Consider implementing shadows on planets based on normal maps. #288

Open
smcameron opened this issue Jul 1, 2020 · 0 comments
Open

Consider implementing shadows on planets based on normal maps. #288

smcameron opened this issue Jul 1, 2020 · 0 comments

Comments

@smcameron
Copy link
Owner

smcameron commented Jul 1, 2020

Shadows as opposed to just shading. Technique is summarized here: http://enbdev.com/doc_normalmappingshadows.htm
PDF is here: http://enbdev.com/NormalMappingShadows.pdf (PDF just seems to be slides with approximately the same info as the web page, maybe slightly more, but it's not a paper.)

This could theoretically render the long shadows you should see on a cratered planet around the terminator. There would likely be some head-spinning complexity around the cube map seams though.

I think a once sentence summary (found on reddit) is like so: "For each fragment you effectively reconstruct a 1d slice of the height field by integrating along a line on the normal map in the direction of the light source".

or to quote the link:

How it works

The light ray is an axis for computing slope of normal map. Trace from hit point to light direction and compute sum of dot products between normal map and light direction. If slope is bigger than 0, pixel is shadowed. If slope is also bigger than previous maximal value, increase hardness of shadow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant