56 lines
1.2 KiB
Plaintext
56 lines
1.2 KiB
Plaintext
Shader "Hidden/PostProcessing/Copy"
|
|
{
|
|
HLSLINCLUDE
|
|
|
|
#include "Packages/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl"
|
|
|
|
TEXTURE2D_SAMPLER2D(_MainTex, sampler_MainTex);
|
|
|
|
float4 Frag(VaryingsDefault i) : SV_Target
|
|
{
|
|
float4 color = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoordStereo);
|
|
return color;
|
|
}
|
|
|
|
float4 FragKillNaN(VaryingsDefault i) : SV_Target
|
|
{
|
|
float4 color = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoordStereo);
|
|
|
|
if (AnyIsNan(color))
|
|
{
|
|
color = (0.0).xxxx;
|
|
}
|
|
|
|
return color;
|
|
}
|
|
|
|
ENDHLSL
|
|
|
|
SubShader
|
|
{
|
|
Cull Off ZWrite Off ZTest Always
|
|
|
|
// 0 - Fullscreen triangle copy
|
|
Pass
|
|
{
|
|
HLSLPROGRAM
|
|
|
|
#pragma vertex VertDefault
|
|
#pragma fragment Frag
|
|
|
|
ENDHLSL
|
|
}
|
|
|
|
// 1 - Fullscreen triangle copy + NaN killer
|
|
Pass
|
|
{
|
|
HLSLPROGRAM
|
|
|
|
#pragma vertex VertDefault
|
|
#pragma fragment FragKillNaN
|
|
|
|
ENDHLSL
|
|
}
|
|
}
|
|
}
|