Added cascaded shadow maps suppot for directional lights.#988
Conversation
…iewDependentState
…ht specific support into CollectResourceRequirements
…setting max distance for single shadow maps
…image layout that is usable in the fragment shader.
… of shadow maps, and moved to early in code block
…s causing link errors
…yback of the camera position.
…to the setup of ViewDependentState backend.
lufriem
left a comment
There was a problem hiding this comment.
I don't claim to really understand how shadows work but I noticed some trivial things, so did this unsolicited review. Very excited about that change!
| double shadowMapBias = 0.005; | ||
| double lambda = 0.5; | ||
|
|
||
| // Shadow backend. |
|
|
||
| using namespace vsg; | ||
|
|
||
| CommandGraph::CommandGraph() |
There was a problem hiding this comment.
Could this be simply left as =default; in the header?
There was a problem hiding this comment.
It could, but it doesn't really gain anything. I like have even empty code blocks there so it's easy to add/remove debug output from the constructors.
|
|
||
| // This is the heart of what makes Vulkan offscreen rendering | ||
| // work: render passes that follow are blocked from using this | ||
| // passes' color attachment in their fragment shaders until all |
There was a problem hiding this comment.
old hang up started with example as starting place for the render to texture, so have deleted this comment block.
| } | ||
|
|
||
| // use an image barrier to transition the initial shadow map array layout to VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL | ||
| // so that whole shadow map is usable in fragment shader even when only portions of it have been set using a render to texture pass |
| } | ||
| else | ||
| { | ||
| warn("RecordTraversal::apply(const CommandGraph& commandGraph) cannot traverse as commandGraph->device = ", cg->device); |
There was a problem hiding this comment.
cg->device would be always be nullptr here, so maybe simplify that warning by getting rid of the (always-nullptr) parameter and write that directly into the text string?
…ave lights and shadow maps recorded for it or not.
No description provided.