feat(render): Screen-space decal system decoupled from forward/deferred pipelines#76
Draft
feat(render): Screen-space decal system decoupled from forward/deferred pipelines#76
Conversation
…ipelines Co-authored-by: bluesky013 <35895395+bluesky013@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Design decal system with decoupled forward and deferred rendering
feat(render): Screen-space decal system decoupled from forward/deferred pipelines
Mar 8, 2026
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.
Adds a screen-space decal system designed to be pipeline-agnostic — it works after any opaque pass (forward, deferred, MSAA) by reading only a depth buffer and a color render target.
Architecture
render/core— pipeline-agnostic layerDecalFeatureProcessor— manages up to 16DecalInstanceobjects; uploads aDecalPassInfoUBO (DECAL_PASS_INFO) to the render graph each frame viaRender()DecalInstance— stores per-decal OBB (world-to-local matrix), RGBA tint color, and blend factorrender/adaptor— pipeline-specific layerDecalPass(extendsFullScreenPass) — color and depth resource names are injected at construction, so the pass can be wired to any opaque pass's outputs without modificationDecalComponent— actor component; creates/destroysDecalInstancevia the feature processor, updates the OBB matrix on transform changeShader (
assets/shaders/decal.hlsl)Full-screen triangle → sample depth → reconstruct world position via
InvViewProj→ per-decal OBB test (unit-cube in local space) → alpha-blend with painter's algorithm:Pipeline integration (
DefaultForwardPipeline)DecalPassis inserted between the forward pass and post-processing. It usesLoadOp::LOAD+ alpha blending to composite ontoForwardColorin-place — no extra buffer, no change to post-processing. When noDecalFeatureProcessoris registered,DecalPass::Setup()is a no-op.Supporting changes
SceneViewInfo/ HLSLViewInfoextended withInvViewProj(precomputed inSceneView::Update()) — useful for any depth-reconstruction effect beyond decalsdecal.tech: alpha blending, no depth write, no face cullingDecalFeatureProcessorandDecalComponentregistered inRenderModule💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.