I post this here not because I’m an OpenGL expert, but because it is a question that doesn’t appear to be answered elsewhere so I assume it is advanced.

I would like to create a user-defined cross-sectional view of a 3D mesh. Clipping is easy, but I’m not sure of the best way to handle textures. I could keep it simple and use basic colors, but it would be good to change the textures in 3D if possible.

It seems this particular problem might be easier if i do a volumetric render, but the device in question (iPad 2) lacks compute shaders so i’m anticipating that it would be slower and require a non-standard workflow. i would be happy to be proved wrong, however.


Nevermind… from numerous sources this is handled via capping with the stencil buffer. My understanding is that this allows for basic, unchanging textures. True 3D textures seem more difficult since the OES_texture_3D extension does not seem to be widely supported on OpenGL ES 2 devices yet. This is all ad hoc so please let me know if i missed something.

The best description i’ve found so far is in “Advanced OpenGL Programming” : Volume Visualization with Texture. They use stacked 2D textures if 3D textures are not supported.