Add new scene textures SceneStencil and ObjectLayer to sample Stencil buffer

This commit is contained in:
Wojtek Figat
2025-10-07 18:10:14 +02:00
parent f8dbf363b6
commit 2f1f380062
5 changed files with 37 additions and 1 deletions

View File

@@ -444,6 +444,16 @@ API_ENUM() enum class MaterialSceneTextures
/// The scene world-space position (relative to the render view origin).
/// </summary>
WorldPosition = 11,
/// <summary>
/// The scene stencil.
/// </summary>
SceneStencil = 12,
/// <summary>
/// The object layer index.
/// </summary>
ObjectLayer = 13,
};
/// <summary>

View File

@@ -393,6 +393,10 @@ void MaterialParameter::Bind(BindMeta& meta) const
case MaterialSceneTextures::Specular:
view = meta.CanSampleGBuffer ? meta.Buffers->GBuffer2->View() : nullptr;
break;
case MaterialSceneTextures::SceneStencil:
case MaterialSceneTextures::ObjectLayer:
view = meta.CanSampleDepth ? meta.Buffers->DepthBuffer->ViewStencil() : nullptr;
break;
default: ;
}
}