Refactor material shaders to use separate constant buffer (slot 1) for shared per-view constants

This commit is contained in:
Wojtek Figat
2022-11-27 12:06:31 +01:00
parent 189575efec
commit 835a230323
26 changed files with 92 additions and 194 deletions

View File

@@ -2,6 +2,7 @@
// Version: @0
#define MATERIAL 1
#define USE_PER_VIEW_CONSTANTS 1
@3
// Enables/disables smooth terrain chunks LOD transitions (with morphing higher LOD near edges to the lower LOD in the neighbour)
#define USE_SMOOTH_LOD_TRANSITION 1
@@ -16,15 +17,7 @@
@7
// Primary constant buffer (with additional material parameters)
META_CB_BEGIN(0, Data)
float4x4 ViewProjectionMatrix;
float4x4 WorldMatrix;
float4x4 ViewMatrix;
float3 ViewPos;
float ViewFar;
float3 ViewDir;
float TimeParam;
float4 ViewInfo;
float4 ScreenSize;
float3 WorldInvScale;
float WorldDeterminantSign;
float PerInstanceRandom;