-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Remove hand tuning of light projection near/far for a scene in CSM example #312
base: master
Are you sure you want to change the base?
Conversation
@arbmarton is this PR something you're aware of and do you agree? |
@JoeyDeVries no it is not something I'm aware of. @lhog Thank you for taking an interest in the CSM example! Could you please elaborate on the changes? I hadn't read the diff yet completely but please note that the article on the website heavily references the code. So with a code update an article update is needed too, and I currently do not have the time for that, maybe in august. |
Also if you have suggestions I think it would be best to discuss them on the Disqus page under the article, in that way others can learn from our trail of thought talking about your ideas. I'm subscribed to email notifications, so I will definitely see your comment there. |
Apart from some cosmetic changes, the essence of it is to teach how to fit znear/zfar values to match the current scene. Instead the code takes all scene objects (cubes and ground plane) and project them in light view space. Upon the projection, minimum and maximum values of Z are calculated and then applied to construct light-space projection matrix. Ideally there should be additional checks on whether an object lies within AABB of main camera frustum re-projected into light view space, but I don't think I actually implemented it. As for the site change, you have
So this will need to change to explain how znear and zfar could be calculated from the scene itself (though in a slightly naive way) |
While automatic tuning is beneficial, I don't think going straight to automatic tuning would work for the article's educational strength. It would be a lot of information straight at once. I'll leave the specifics to you @arbmarton and wether you want to include this, but if you do it's best suited as an extra at (or close to) the end of the chapter in my opinion. |
Up to you guys, but I found myself guessing why |
No description provided.