Refactor material shaders to use separate constant buffer (slot 1) for shared per-view constants
This commit is contained in:
@@ -12,17 +12,9 @@
|
||||
#include "Engine/Renderer/DrawCall.h"
|
||||
|
||||
PACK_STRUCT(struct DecalMaterialShaderData {
|
||||
Matrix ViewProjectionMatrix;
|
||||
Matrix WorldMatrix;
|
||||
Matrix ViewMatrix;
|
||||
Matrix InvWorld;
|
||||
Matrix SVPositionToWorld;
|
||||
Float3 ViewPos;
|
||||
float ViewFar;
|
||||
Float3 ViewDir;
|
||||
float TimeParam;
|
||||
Float4 ViewInfo;
|
||||
Float4 ScreenSize;
|
||||
});
|
||||
|
||||
DrawPass DecalMaterialShader::GetDrawModes() const
|
||||
@@ -58,15 +50,7 @@ void DecalMaterialShader::Bind(BindParameters& params)
|
||||
|
||||
// Setup material constants
|
||||
{
|
||||
Matrix::Transpose(view.Frustum.GetMatrix(), materialData->ViewProjectionMatrix);
|
||||
Matrix::Transpose(drawCall.World, materialData->WorldMatrix);
|
||||
Matrix::Transpose(view.View, materialData->ViewMatrix);
|
||||
materialData->ViewPos = view.Position;
|
||||
materialData->ViewFar = view.Far;
|
||||
materialData->ViewDir = view.Direction;
|
||||
materialData->TimeParam = params.TimeParam;
|
||||
materialData->ViewInfo = view.ViewInfo;
|
||||
materialData->ScreenSize = view.ScreenSize;
|
||||
|
||||
// Matrix for transformation from world space to decal object space
|
||||
Matrix invWorld;
|
||||
|
||||
Reference in New Issue
Block a user