mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
16 lines
482 B
HLSL
16 lines
482 B
HLSL
Texture2D<float> g_DepthTexture : register(t0);
|
|
RWTexture2D<float> g_Output : register(u0);
|
|
sampler depth_sampler : register(s0);
|
|
|
|
[numthreads(8, 8, 1)]
|
|
void main(uint3 PixCoord : SV_DispatchThreadID) {
|
|
uint2 dimensions;
|
|
g_Output.GetDimensions(dimensions.x, dimensions.y);
|
|
|
|
float2 co = float2(PixCoord.xy) / float2(dimensions);
|
|
|
|
float4 depths = g_DepthTexture.GatherRed(depth_sampler, co);
|
|
g_Output[PixCoord.xy] = min(min(depths.x, depths.y), min(depths.z, depths.w));
|
|
}
|
|
|