mirror of
https://git.stillkill.net/MinecraftLeak/Narration-NoGeneratedLevel-20170216.git
synced 2026-10-22 21:22:18 +01:00
40 lines
933 B
HLSL
40 lines
933 B
HLSL
#include "ShaderConstants.fxh"
|
|
|
|
struct GeometryShaderInput
|
|
{
|
|
float4 pos : SV_POSITION;
|
|
float4 color : COLOR;
|
|
#ifdef INSTANCEDSTEREO
|
|
uint instanceID : SV_InstanceID;
|
|
#endif
|
|
};
|
|
|
|
// Per-pixel color data passed through the pixel shader.
|
|
struct GeometryShaderOutput
|
|
{
|
|
float4 pos : SV_POSITION;
|
|
float4 color : COLOR;
|
|
#ifdef INSTANCEDSTEREO
|
|
uint renTarget_id : SV_RenderTargetArrayIndex;
|
|
#endif
|
|
};
|
|
|
|
// passes through the triangles, except changint the viewport id to match the instance
|
|
[maxvertexcount(3)]
|
|
void main(triangle GeometryShaderInput input[3], inout TriangleStream<GeometryShaderOutput> outStream)
|
|
{
|
|
GeometryShaderOutput output = (GeometryShaderOutput)0;
|
|
|
|
#ifdef INSTANCEDSTEREO
|
|
int i = input[0].instanceID;
|
|
#endif
|
|
for (int j = 0; j < 3; j++)
|
|
{
|
|
output.pos = input[j].pos;
|
|
output.color = input[j].color;
|
|
#ifdef INSTANCEDSTEREO
|
|
output.renTarget_id = i;
|
|
#endif
|
|
outStream.Append(output);
|
|
}
|
|
} |