Merge branch 'master' into 1.5
This commit is contained in:
@@ -435,6 +435,11 @@ API_ENUM() enum class MaterialSceneTextures
|
||||
/// The material shading mode.
|
||||
/// </summary>
|
||||
ShadingModel = 10,
|
||||
|
||||
/// <summary>
|
||||
/// The scene world-space position (relative to the render view origin).
|
||||
/// </summary>
|
||||
WorldPosition = 11,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -439,6 +439,7 @@ void MaterialParameter::Bind(BindMeta& meta) const
|
||||
switch (type)
|
||||
{
|
||||
case MaterialSceneTextures::SceneDepth:
|
||||
case MaterialSceneTextures::WorldPosition:
|
||||
view = meta.CanSampleDepth
|
||||
? meta.Buffers->DepthBuffer->GetDescription().Flags & GPUTextureFlags::ReadOnlyDepthView
|
||||
? meta.Buffers->DepthBuffer->ViewReadOnlyDepth()
|
||||
|
||||
@@ -18,6 +18,7 @@ PACK_STRUCT(struct PostFxMaterialShaderData {
|
||||
Float4 ViewInfo;
|
||||
Float4 ScreenSize;
|
||||
Float4 TemporalAAJitter;
|
||||
Matrix InverseViewProjectionMatrix;
|
||||
});
|
||||
|
||||
void PostFxMaterialShader::Bind(BindParameters& params)
|
||||
@@ -44,6 +45,7 @@ void PostFxMaterialShader::Bind(BindParameters& params)
|
||||
// Setup material constants
|
||||
{
|
||||
Matrix::Transpose(view.View, materialData->ViewMatrix);
|
||||
Matrix::Transpose(view.IVP, materialData->InverseViewProjectionMatrix);
|
||||
materialData->ViewPos = view.Position;
|
||||
materialData->ViewFar = view.Far;
|
||||
materialData->ViewDir = view.Direction;
|
||||
|
||||
Reference in New Issue
Block a user