Where is shader function "texture()" defined? (GLMakie.jl/volume())

Hi, I am looking into implementing adaptive sampling for the GLMakie volume() visualizations. However, being new to OpenGL, I cannot find where the texture() function is defined. I believe the implementation of that function should give all the information needed to implement adaptive sampling.

Specifically, I will need to know the positions of two opposing vertices of the grid cell containing a given position in the volumedata. Thanks!

it’s an glsl internal function implemented in the OpenGL driver.
If I’m not misunderstanding you, the current volume shaders already calculate the opposing vertices, or rather intersections of the ray with the cube of the volume.

Thanks, I had not expected that! What I need is the shape of a single grid cell. However, given that the whole volume data is in a 1x1x1 cuboid, I think textureSize() should give what is needed to calculate the shapes of individual grid cells.

The key to adaptive sampling is to calculate the intersections for each grid cell.