Scene loading/saving improvements, transform gizmo, entity creation
This commit is contained in:
46
renderer/shaders.jai
Normal file
46
renderer/shaders.jai
Normal 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
|
||||
Reference in New Issue
Block a user