Browse Source
Color, depth and motion vectors are now provided as regular texture inputs to the compute shaders, by blitting them from the game camera ahead of time.
mac-autoexp
Color, depth and motion vectors are now provided as regular texture inputs to the compute shaders, by blitting them from the game camera ahead of time.
mac-autoexp
9 changed files with 167 additions and 36 deletions
-
34Assets/Resources/Shaders/FSR2CopyDepth.shader
-
10Assets/Resources/Shaders/FSR2CopyDepth.shader.meta
-
34Assets/Resources/Shaders/FSR2CopyMotionVectors.shader
-
10Assets/Resources/Shaders/FSR2CopyMotionVectors.shader.meta
-
9Assets/Scripts/Fsr2.cs
-
8Assets/Scripts/Fsr2Context.cs
-
81Assets/Scripts/Fsr2Controller.cs
-
10Assets/Scripts/Fsr2Pipeline.cs
-
7Assets/Scripts/SubsampleTest.cs
@ -0,0 +1,34 @@ |
|||
Shader "FSR2/FSR2CopyDepth" |
|||
{ |
|||
Properties |
|||
{ |
|||
_MainTex ("Texture", 2D) = "" {} |
|||
} |
|||
SubShader { |
|||
|
|||
Pass { |
|||
ZTest Always Cull Off ZWrite Off |
|||
|
|||
HLSLPROGRAM |
|||
#include "UnityCG.cginc" |
|||
|
|||
struct v2f { |
|||
float4 vertex : SV_POSITION; |
|||
float2 texCoord : TEXCOORD0; |
|||
}; |
|||
|
|||
#pragma vertex vert_img |
|||
#pragma fragment frag |
|||
|
|||
sampler2D _CameraDepthTexture; |
|||
|
|||
fixed4 frag(v2f i) : COLOR |
|||
{ |
|||
return tex2D(_CameraDepthTexture, i.texCoord); |
|||
} |
|||
ENDHLSL |
|||
|
|||
} |
|||
} |
|||
Fallback Off |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
fileFormatVersion: 2 |
|||
guid: f9861a441b68ea4409f6d6828d4ef5b2 |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
preprocessorOverride: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
@ -0,0 +1,34 @@ |
|||
Shader "FSR2/CopyMotionVectors" |
|||
{ |
|||
Properties |
|||
{ |
|||
_MainTex ("Texture", 2D) = "" {} |
|||
} |
|||
SubShader { |
|||
|
|||
Pass { |
|||
ZTest Always Cull Off ZWrite Off |
|||
|
|||
HLSLPROGRAM |
|||
#include "UnityCG.cginc" |
|||
|
|||
struct v2f { |
|||
float4 vertex : SV_POSITION; |
|||
float2 texCoord : TEXCOORD0; |
|||
}; |
|||
|
|||
#pragma vertex vert_img |
|||
#pragma fragment frag |
|||
|
|||
sampler2D_half _CameraMotionVectorsTexture; |
|||
|
|||
fixed4 frag(v2f i) : COLOR |
|||
{ |
|||
return tex2D(_CameraMotionVectorsTexture, i.texCoord); |
|||
} |
|||
ENDHLSL |
|||
|
|||
} |
|||
} |
|||
Fallback Off |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
fileFormatVersion: 2 |
|||
guid: ea3aa42789e56b84db6c1326db8b6c37 |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
preprocessorOverride: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue