Add new scene textures SceneStencil and ObjectLayer to sample Stencil buffer
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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: ;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user