817 B、36行 生 Blame 履歴
1struct VertexInput {
2 float2 positions;
3 float3 colors;
4 float2 texCoord;
5};
6
7struct UniformBuffer {
8 float4x4 model;
9 float4x4 view;
10 float4x4 proj;
11};
12ConstantBuffer<UniformBuffer> ubo;
13
14struct VertexOutput {
15 float4 pos: SV_Position;
16 float3 color;
17 float2 texCoord;
18};
19
20[shader("vertex")]
21VertexOutput vertMain(VertexInput inVert) {
22 VertexOutput outVert;
23 outVert.pos = mul(ubo.proj, mul(ubo.view, mul(ubo.model, float4(inVert.positions, 0.0, 1.0))));
24 outVert.color = inVert.colors;
25 outVert.texCoord = inVert.texCoord;
26 return outVert;
27}
28
29Sampler2D texture;
30
31[shader("fragment")]
32float4 fragMain(VertexOutput inVert) : SV_Target {
33 //return float4(inVert.texCoord, 0.0, 1.0);
34 //return float4(inVert.color * texture.Sample(inVert.texCoord).rgb, 1.0);
35 return texture.Sample(inVert.texCoord);
36}