Texture instancing colormap Extend W bug

noticed this bug with the material colormap extend W behavior broken

colormapextendwbug.toe (4.5 KB)

uv_vs_tex3d_vs_tex2d.toe (7.8 KB)

here is a more detailed example showing the expected behavior using tex3d and uv space in which the extend behavior works as expected

Hey @davispolito ,

Thanks for sending these in. Just to be super clear, the potential bug you are pointing out is that in the MATs with the Texture 3D TOPs with ‘2D Texture Array’, the Extend W mode doesn’t do anything, right?

If so, the way the ‘2D Texture Array’ type is setup, that really is the expected behaviour, they don’t work with the Extend W mode.

Refer to this paragraph from the wiki for the Texture 3D TOP:
“The Texture 3D TOP can also create a 2D Texture Array . 2D Texture arrays are much like 3d textures, except are sampled using a non-normalized w texture coordinate. (i.e, 0 is the first slice, 1 is the 2nd slice, 2 is the 3rd slice etc.). Texture arrays also don’t support blending between different slices when sampling at coordinate that falls between two slices. This a much faster alternative to 3d textures when interpolation between slices is not required. The non-normalized w coordinate makes it very easy to directly access a particular slice in the array. 2D Texture arrays also don’t have a concept of w extend mode: they only work in their 0->(N-1) range.”

Thanks,
Varad

Ah, I guess that makes sense.

But I don’t quite understand why a 2d texture arrays non interpolating behavior would negate the ability to have the extend W effect seeing as it’s essentially a wrap around.

I.e. if you were to supply a number beyond N-1. It would wrap around and maintain the non interpolating behavior but the Nth value would go to the 0th texture and n+1 value go to the 1st texture.

That does make intuitive sense. I’m guessing the reason is in the depths of the code. I will look into it and based on the findings start an internal discussion for making this work. Thanks!

2 Likes

Hey @davispolito ,

So simply put, 2D texture arrays don’t work with Extend W mode because GPUs just don’t support that right now

Varad