GL_TEXTURE_3D

Started by
6 comments, last by mrr 14 years, 4 months ago
When I enable GL_TEXTURE_3D my 2D textures disappear why? How can I make 2D and 3D textures co exist? I have had trouble with disabling enabling textures before so does it exist any other solution.
Advertisement
If you mean enabling both 2D and 3D texturing on the same texture unit, the 3D texturing take precendence which effectively disables 2D texturing. On the other hand, having two textures bound on the same texture unit, whether of the same target or not, just doesn't make any sense.

If you mean enabling them on different texture units, then there's nothing preventing the 2D texture from working at the same time. Any error here is in how you setup the combiners, or the shaders, to combine the textures.
Ok, thanks.
I got another problem now..
Im mapping a 3D texture to a cube 4 quads..but it is hollow inside.
I skip mapping top and bottom do i need that?
Those texture coordinates are mapped to vertex coordinates already, or ?
Do i need to fill the box with particles or something to make it solid?
You are misunderstanding GL_TEXTURE_3D. It will not render automagically texture in three dimensions. What it will do - it will contain 3D array of pixels and will be used for mapping those pixels to surface of geometry you render (triangles/quads/etc..) So you will see only what geometry you render with color from that texture.
I believe you are referring to volumetric rendering, and there are many ways to do it. I guess particles could work, or multiple planes intersecting the 3D volume, or raycasting through it in a shader, for example. http://en.wikipedia.org/wiki/Volume_rendering.
Thanks... I begin to understand.. particles look kinda crappy.
Planes I guess is fine as long as they are parallel to viewer.

This topic is closed to new replies.

Advertisement