Add support for main view information in Surface materials during subpass rendering (eg. shadow depth)

This commit is contained in:
Wojtek Figat
2022-07-29 16:57:57 +02:00
parent 22209108c9
commit 6cf91b1da4
9 changed files with 72 additions and 15 deletions

View File

@@ -22,6 +22,8 @@ PACK_STRUCT(struct DeferredMaterialShaderData {
Matrix ViewMatrix;
Matrix PrevViewProjectionMatrix;
Matrix PrevWorldMatrix;
Matrix MainViewProjectionMatrix;
Float4 MainScreenSize;
Float3 ViewPos;
float ViewFar;
Float3 ViewDir;
@@ -86,6 +88,8 @@ void DeferredMaterialShader::Bind(BindParameters& params)
Matrix::Transpose(view.View, materialData->ViewMatrix);
Matrix::Transpose(drawCall.Surface.PrevWorld, materialData->PrevWorldMatrix);
Matrix::Transpose(view.PrevViewProjection, materialData->PrevViewProjectionMatrix);
Matrix::Transpose(view.MainViewProjection, materialData->MainViewProjectionMatrix);
materialData->MainScreenSize = view.MainScreenSize;
materialData->ViewPos = view.Position;
materialData->ViewFar = view.Far;
materialData->ViewDir = view.Direction;