Scene loading/saving improvements, transform gizmo, entity creation

This commit is contained in:
2024-10-19 19:45:04 +02:00
parent fae8ea7cba
commit 3d98ba0023
15 changed files with 985 additions and 460 deletions

46
renderer/shaders.jai Normal file
View File

@@ -0,0 +1,46 @@
TRANSFORM_GIZMO_SHADER :: #string BEGIN
cbuffer CameraData : register(b0)
{
float4x4 projection;
float4x4 view;
};
cbuffer Model : register(b1)
{
float4x4 model;
};
cbuffer Material : register(b2)
{
float4 color;
};
struct PSInput {
float4 position : SV_POSITION;
};
struct PS_OUTPUT {
float4 color : SV_Target0;
};
PSInput VS(float3 pos : POSITION) {
float4 position = float4(pos.x, pos.y, pos.z, 1.0);
PSInput input;
input.position = mul(position, model);
input.position = mul(input.position, view);
input.position = mul(input.position, projection);
return input;
}
PS_OUTPUT PS(PSInput input) {
PS_OUTPUT output;
output.color.rgb = color.rgb;
output.color.a = 1.0;
return output;
}
BEGIN