Move shaders into glsl and hlsl directories
Move `data/shaders` to `data/shaders/glsl` Move `data/hlsl` to `data/shaders/hlsl` Fix up shader paths in the cpp files to point to the new glsl location. `data/shaders/hlsl/compile.py` still overwrites the glsl .spv files (for now). Issue: #723
This commit is contained in:
parent
cac1d2e850
commit
ca884587a4
1043 changed files with 1207 additions and 1201 deletions
43
data/shaders/hlsl/geometryshader/normaldebug.geom
Normal file
43
data/shaders/hlsl/geometryshader/normaldebug.geom
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
// Copyright 2020 Google LLC
|
||||
|
||||
struct UBO
|
||||
{
|
||||
float4x4 projection;
|
||||
float4x4 model;
|
||||
};
|
||||
|
||||
cbuffer ubo : register(b1) { UBO ubo; }
|
||||
|
||||
struct VSOutput
|
||||
{
|
||||
[[vk::location(0)]] float4 Pos : POSITION0;
|
||||
[[vk::location(1)]] float3 Normal : NORMAL0;
|
||||
};
|
||||
|
||||
struct GSOutput
|
||||
{
|
||||
float4 Pos : SV_POSITION;
|
||||
[[vk::location(0)]] float3 Color : COLOR0;
|
||||
};
|
||||
|
||||
[maxvertexcount(6)]
|
||||
void main(triangle VSOutput input[3], inout LineStream<GSOutput> outStream)
|
||||
{
|
||||
float normalLength = 0.02;
|
||||
for(int i=0; i<3; i++)
|
||||
{
|
||||
float3 pos = input[i].Pos.xyz;
|
||||
float3 normal = input[i].Normal.xyz;
|
||||
|
||||
GSOutput output = (GSOutput)0;
|
||||
output.Pos = mul(ubo.projection, mul(ubo.model, float4(pos, 1.0)));
|
||||
output.Color = float3(1.0, 0.0, 0.0);
|
||||
outStream.Append( output );
|
||||
|
||||
output.Pos = mul(ubo.projection, mul(ubo.model, float4(pos + normal * normalLength, 1.0)));
|
||||
output.Color = float3(0.0, 0.0, 1.0);
|
||||
outStream.Append( output );
|
||||
|
||||
outStream.RestartStrip();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue