31 lines
581 B
Text
31 lines
581 B
Text
struct STDVertex {
|
|
float3 pos;
|
|
float4 col;
|
|
};
|
|
|
|
struct VertexOut {
|
|
float4 pos : SV_Position;
|
|
float4 col;
|
|
};
|
|
|
|
struct STDCamera {
|
|
float4x4 mvp;
|
|
float3 position;
|
|
float3 direction;
|
|
};
|
|
[vk::binding(1, 0)]
|
|
StructuredBuffer<STDVertex> vertices;
|
|
[vk::binding(0, 0)]
|
|
uniform ConstantBuffer<STDCamera> camera;
|
|
|
|
[shader("vertex")]
|
|
VertexOut vsMain(uint vertex_id: SV_VertexID, uint instance_id: SV_InstanceID){
|
|
return VertexOut(mul(camera.mvp, float4(vertices[vertex_id].pos, 1.0)), vertices[vertex_id].col);
|
|
}
|
|
|
|
|
|
[shader("pixel")]
|
|
float4 fsMain(VertexOut fsIn){
|
|
return fsIn.col;
|
|
}
|
|
|