textureCubeGrad?

Hi,

I know this is not strictly optix related but I need to do mipmapping on a cubemap but it seems there is no textureCubeGrad function in CUDA. Why is that? Mipmapping seems to be quite essential for a lot of things unless you want to trace many, many rays.

Does anyone know how to manually calculate the proper lod level for a cubemap?

Kind regards
Michael

Hi,

tex3DGrad() or texCubemapLod() could be the CUDA function you are looking for.
(in CUDA C Programming Guide https://docs.nvidia.com/pdf/CUDA_C_Programming_Guide.pdf)

maybe also take a look at my question: tex2D in OptiX7

in an existing app which uses a version earlier than OptiX 7.0.0 it was rtTex3DGrad
or rtTexCubemapLod :
https://raytracing-docs.nvidia.com/optix/api/html/group__rt_tex.html

I explicitly need the texCubemapGrad function since I don´t really want to calculate the LOD level myself (which I currently have to do).

So both functions don´t work for me.

The texCubemapGrad() function is present inside the CUDA toolkit’s include\texture_fetch_functions.h header (at least in CUDA 10.2 and 11.0 where I looked.)

texCubemapGrad() and texCubemapLayeredGrad() are unfortunately still missing in the CUDA Programming Guide.
The bug report to add them already existed.