Hi all,
I'm currently implementing a light probe system. I'm passing the captured data of my 8 closest (specular) light probes to the shader as a TextureCubeArray. I'm using a workflow similar to clustered lighting to determine the list of which probes are needed.
Because I have a list, with a variable number of applicable probes per pixel, I need to use SampleGrad in my evaluation loop as the shader otherwise tries to enforce an unroll.
This is the call to my local specular probes (shader model 5 SampleGrad) :
float3 EnvColor = Loc_Spec.SampleGrad(LinearSampler, float4(dir, lightProbeIndex), SampleGrad_Probe_DDX, SampleGrad_Probe_DDY, LOD).rgb;
My problem: It always samples the first cube in the array. I can pass whatever for 'lightProbeIndex', it does not make a difference.
Capturing the executable however, shows that Loc_Spec is a correctly build array of 8 cubes, each with 6 correctly ordered faces, as expected.
Has anyone encountered a similar problem with SampleGrad before?
Greetings.
PS: Captured Texture/Sampler characteristics below for added info.
Texture
Type: Cube Array
Width/Height: 128
Depth: 1
Array Size: 48
Format: R11G11B10_FLOAT
Sampler
Addressing: UVW: CLAMP
Filter: ANISOTROPIC 16x
LOD Clamp: 0-FLT_MAX
Mip Bias: 0