47 lines
1.2 KiB
Plaintext
47 lines
1.2 KiB
Plaintext
Shader "Builtin Gaussian Splat Composite"
|
|
{
|
|
SubShader
|
|
{
|
|
Pass
|
|
{
|
|
Name "GaussianComposite"
|
|
Tags { "LightMode" = "GaussianComposite" }
|
|
Cull Off
|
|
ZWrite Off
|
|
ZTest Always
|
|
Blend One OneMinusSrcAlpha
|
|
HLSLPROGRAM
|
|
#pragma target 4.5
|
|
#pragma vertex MainVS
|
|
#pragma fragment MainPS
|
|
|
|
Texture2D GaussianSplatAccumulationTexture;
|
|
|
|
struct VSOutput
|
|
{
|
|
float4 position : SV_POSITION;
|
|
};
|
|
|
|
VSOutput MainVS(uint vertexId : SV_VertexID)
|
|
{
|
|
const float2 positions[3] = {
|
|
float2(-1.0f, -1.0f),
|
|
float2(-1.0f, 3.0f),
|
|
float2( 3.0f, -1.0f)
|
|
};
|
|
|
|
VSOutput output;
|
|
output.position = float4(positions[vertexId], 1.0f, 1.0f);
|
|
return output;
|
|
}
|
|
|
|
float4 MainPS(VSOutput input) : SV_TARGET
|
|
{
|
|
const int2 pixelCoord = int2(input.position.xy);
|
|
return GaussianSplatAccumulationTexture.Load(int3(pixelCoord, 0));
|
|
}
|
|
ENDHLSL
|
|
}
|
|
}
|
|
}
|