Fix SSR shader on D3D10
This commit is contained in:
BIN
Content/Shaders/SSR.flax
(Stored with Git LFS)
BIN
Content/Shaders/SSR.flax
(Stored with Git LFS)
Binary file not shown.
@@ -3,6 +3,10 @@
|
|||||||
#include "./Flax/Common.hlsl"
|
#include "./Flax/Common.hlsl"
|
||||||
#include "./Flax/Collisions.hlsl"
|
#include "./Flax/Collisions.hlsl"
|
||||||
|
|
||||||
|
#if CAN_USE_GATHER
|
||||||
|
#define CAN_USE_GLOBAL_SURFACE_ATLAS 1
|
||||||
|
#endif
|
||||||
|
|
||||||
// This must match C++
|
// This must match C++
|
||||||
#define GLOBAL_SURFACE_ATLAS_CHUNKS_RESOLUTION 40 // Amount of chunks (in each direction) to split atlas draw distance for objects culling
|
#define GLOBAL_SURFACE_ATLAS_CHUNKS_RESOLUTION 40 // Amount of chunks (in each direction) to split atlas draw distance for objects culling
|
||||||
#define GLOBAL_SURFACE_ATLAS_CHUNKS_GROUP_SIZE 4
|
#define GLOBAL_SURFACE_ATLAS_CHUNKS_GROUP_SIZE 4
|
||||||
|
|||||||
@@ -70,4 +70,30 @@ float4 TextureGatherRed(Texture2D<float> tex, SamplerState sam, float2 uv, int2
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float4 TextureGatherGreen(Texture2D tex, SamplerState sam, float2 uv)
|
||||||
|
{
|
||||||
|
#if CAN_USE_GATHER
|
||||||
|
return tex.GatherGreen(sam, uv);
|
||||||
|
#else
|
||||||
|
float x = tex.Sample(sam, uv, int2(0, 1)).g;
|
||||||
|
float y = tex.Sample(sam, uv, int2(1, 1)).g;
|
||||||
|
float z = tex.Sample(sam, uv, int2(1, 0)).g;
|
||||||
|
float w = tex.Sample(sam, uv, int2(0, 0)).g;
|
||||||
|
return float4(x, y, z, w);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
float4 TextureGatherBlue(Texture2D tex, SamplerState sam, float2 uv)
|
||||||
|
{
|
||||||
|
#if CAN_USE_GATHER
|
||||||
|
return tex.GatherBlue(sam, uv);
|
||||||
|
#else
|
||||||
|
float x = tex.Sample(sam, uv, int2(0, 1)).b;
|
||||||
|
float y = tex.Sample(sam, uv, int2(1, 1)).b;
|
||||||
|
float z = tex.Sample(sam, uv, int2(1, 0)).b;
|
||||||
|
float w = tex.Sample(sam, uv, int2(0, 0)).b;
|
||||||
|
return float4(x, y, z, w);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ float4 PS_RayTracePass(Quad_VS2PS input) : SV_Target0
|
|||||||
float3 reflectWS = ScreenSpaceReflectionDirection(input.TexCoord, gBuffer, gBufferData.ViewPos, TemporalEffect, TemporalTime, BRDFBias);
|
float3 reflectWS = ScreenSpaceReflectionDirection(input.TexCoord, gBuffer, gBufferData.ViewPos, TemporalEffect, TemporalTime, BRDFBias);
|
||||||
|
|
||||||
// Fallback to Global SDF and Global Surface Atlas tracing
|
// Fallback to Global SDF and Global Surface Atlas tracing
|
||||||
#if USE_GLOBAL_SURFACE_ATLAS
|
#if USE_GLOBAL_SURFACE_ATLAS && CAN_USE_GLOBAL_SURFACE_ATLAS
|
||||||
GlobalSDFTrace sdfTrace;
|
GlobalSDFTrace sdfTrace;
|
||||||
float maxDistance = 100000;
|
float maxDistance = 100000;
|
||||||
float selfOcclusionBias = GlobalSDF.CascadeVoxelSize[0];
|
float selfOcclusionBias = GlobalSDF.CascadeVoxelSize[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user