I use 3d texture to blend 3 2D textures
when the 2D texture have mipmap on then the blending disappears at a certain distance or angle from the camera so I think it’s the mipmap in the 3rd axis of the 3D texture that’s kicking in
so is it possible to turn off mipmap in the z axis of a 3d texture?
Nope.
Like normal 2D textures, each mipmap is a reduced by half in all dimensions. So a 3D texture is sampled at a lower mip, you’re always sampling a mipmap that’s a lower resolution in all axis.
But I think you’re asking the wrong question. And I think you’re mis-diagnosing the problem. When using a 3D texture, it calculates the mip map level in the same way as any other texture, using the maximum screen space derivative of the UVs. So the issue on those angles isn’t the z axis, at least not necessarily.
Part of the problem is anisotropic filtering, or rather the lack of anisotropic filtering for 3D textures. Most GPUs don’t support anisotropic filtering for 3D textures, if any at all. So 3D textures get blurry at extreme angles just like 2D textures do with anisotropic filtering disabled.
So, what’s the solution? Well, you can use an LOD sampler, like tex3Dlod(), and calculate the mip level yourself. Maybe using the min or average rather than max.
Here’s how to calculate the mip level for a 2D texture: