forked from LukasBanana/LLGL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample.hlsl
More file actions
38 lines (31 loc) · 709 Bytes
/
Copy pathExample.hlsl
File metadata and controls
38 lines (31 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// HLSL shader version 4.0 (for Direct3D 11/ 12)
cbuffer Matrices : register(b0)
{
float4x4 wvpMatrix;
};
struct InputVS
{
float3 position : POSITION;
float2 texCoord : TEXCOORD;
};
struct OutputVS
{
float4 position : SV_Position;
float2 texCoord : TEXCOORD;
};
// Vertex shader main function
OutputVS VS(InputVS inp)
{
OutputVS outp;
outp.position = mul(wvpMatrix, float4(inp.position, 1));
outp.texCoord = inp.texCoord;
return outp;
}
Texture2D colorMap : register(t1);
SamplerState colorMapSampler : register(s2);
// Pixel shader main function
float4 PS(OutputVS inp) : SV_Target
{
float4 color = colorMap.Sample(colorMapSampler, inp.texCoord);
return lerp((float4)1, color, color.a);
};