refactor: externalize builtin object id and grid shader assets

This commit is contained in:
2026-04-02 23:15:19 +08:00
parent c63dcf2229
commit ffb62ddd9c
15 changed files with 578 additions and 7 deletions

View File

@@ -0,0 +1,23 @@
// XC_BUILTIN_OBJECT_ID_D3D12_VS
cbuffer PerObjectConstants : register(b0) {
float4x4 gProjectionMatrix;
float4x4 gViewMatrix;
float4x4 gModelMatrix;
float4 gObjectIdColor;
};
struct VSInput {
float3 position : POSITION;
};
struct PSInput {
float4 position : SV_POSITION;
};
PSInput MainVS(VSInput input) {
PSInput output;
float4 positionWS = mul(gModelMatrix, float4(input.position, 1.0));
float4 positionVS = mul(gViewMatrix, positionWS);
output.position = mul(gProjectionMatrix, positionVS);
return output;
}