Repository navigation
PlanarShadowMap: clear the shadow map as a depth texture - #55
Open
ASDAlexander77 wants to merge 1 commit into
Open
ASDAlexander77 wants to merge 1 commit into
ASDAlexander77 wants to merge 1 commit into
Conversation
PlanarShadowMap::Clear cleared its depth texture with clearTextureFloat, which
NVRHI refuses for depth-stencil textures ("Use clearDepthStencilTexture
instead"), so standalone planar shadow maps were never cleared. Clear depth to
1 with clearDepthStencilTexture over the view's subresources, as
CascadedShadowMap::Clear does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ASDAlexander77
added a commit
to ASDAlexander77/native_ts_graphics
that referenced
this pull request
Oct 10, 2026
Two Donut patches, also NVIDIA-RTX/Donut#55 and #56: - Donut-planar-shadow-map-clear: PlanarShadowMap::Clear cleared its depth texture with clearTextureFloat, which NVRHI refuses for depth textures; clear it with clearDepthStencilTexture, as CascadedShadowMap::Clear does. - Donut-planar-shadow-map-whole-scene-depth-range: SetupWholeSceneDirectionalLightView gave the projection the scene's depth range along the light negated, right only for scenes centered on the light's node (D3D clamps the rest to the near or far plane, Vulkan clips it away). The interop's planar shadow maps now clear and fit with these functions; the scene bounds still grow by 1% first, so that geometry on them isn't on the light's near or far plane, which Vulkan clips at. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
PlanarShadowMap::Clearclears the shadow map withclearTextureFloat, but the texture has a depth format, and NVRHI refuses that:So a standalone
PlanarShadowMap(created with a resolution, not as a cascade of aCascadedShadowMap) never gets cleared, on any API.Change
Clear depth to 1 with
clearDepthStencilTextureover the view's subresources (stencil too if the format has one), asCascadedShadowMap::Cleardoes.Found with a standalone planar shadow map on D3D11, D3D12 and Vulkan; after the change the error is gone and the shadow map is cleared each time it's re-rendered.
🤖 Generated with Claude Code