#Min-reduction sampler pattern

9 messages · Page 1 of 1 (latest)

maiden rivet
#

Neither Metal nor WebGPU have reduction samplers, so for my Hi-Z occlusion culling I need to emulate them inside of my shaders for those platforms.

Where can I find information about what pixels the reduction sampler chooses in the various cases? (ie right in the middle of a pixel, towards the side of a pixel, at the texture edge, etc)

pearl meteor
#

Are you talking about min/max filter modes? It’s the same as what’s used for bilinear filtering.

maiden rivet
#

Yes, I'm trying to search for the bilinear sampling pattern but I haven't been able to find anything for that either

pearl meteor
#

If mips aren’t involved you can use Gather to get the 4 texels used for filtering

maiden rivet
#

This is the line I need to emulate:

//sample the depth pyramid at that specific level
float depth = textureLod(sampler2D(depthPyramid, depthPyramidSampler), ndcCorners[i], miplevel).x;

I'm not seeing a textureGatherLod function in my searching. Is there a way to specify a specific mip level when gathering?

pearl meteor
#

I don’t think there’s a gather that lets you select the mip level

maiden rivet
#

that seems like a pretty big gap in API coverage. is there a reason for that?

pearl meteor
pearl meteor