Shadow Mapping in igl::opengl::glfw::Viewer#2155
Merged
alecjacobson merged 4 commits intomainfrom Feb 3, 2023
Merged
Conversation
Contributor
Author
|
In general, raw matcaps won't look very good with hard shadows. If the matcap has an well-approximate-able light-direction and has a near constant "dark-side", then it can look alright. For now, I don't have C++ code to approximate light directions or filter matcaps, but if someone has those, then this PR's shader will now handle them alright. The example above uses Another example. libigl-shadow-matcaps.mov |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Shadows!
Before:


After:
Pretty straightforward shadow mapping implementation for directional lights. I'm guessing this could be optimized, but I'd like to have something in there for visualization of things where close contact is important, like, contact simulations.
I left a few notes about the funny coordinate system for our current positional lights. I didn't change that yet, but I think if we upgrade this to handle point lights then it'd worth reconsidering the coordinate system lights live in.
For now lights are turned off by default and can be turned on with
'S','s'. That'll also switch to directional lights.I kinda like the floor in those renderings, but for now it's just ad hoc for the new tutorial entry. (actual tutorial entry to follow in that repo). Try it out in
113_Shadows