# Texture gap filtering in Z

I would like to place the 2 2D textures parallel in 3D space, so they each go into their own z plane. When I look at this in 3D space, viewing parallel to the texture planes, I get a gap in between them, that is I only see 2 lines. How can I interpolate the space between those 2 textures using the lowest possible version of OpenGL and extensions?

If you want to blend between 2 textures, then you can use shaders and sample each texture and blend with mix().
If you want to stick with old GL, then use multitexturing.

Isn’t multitexturing creating one new texture, blended from the 2 input textures?

What I do need to do is to interpolate the gap space between the 2 (seemingly infintely “thin”) input textures.

Say one is placed at z position 0.3 the other at 0.4, how do I interpolate the space between 0.3 and 0.4?

Thanks!

Your mistake is that you think you are drawing textures. Actually, you draw polygons, where the textures are projected upon. So there is no “gap between the textures”, you just have two infinitely thin polygons. If you want to fill the space between, you have to draw some sort of a cube.

They are actual in a cube. So what you say, does that mean I have to have 3 2D texture stacks, one each for X, Y and Z direction of the cube? That would be a huge overhead. So how can I fill the voxels between the texture maps with interpolated data from the neighboring texels? Would 3D textures solve this?

Thanks!

Are you trying to do some sort of volumetric effect?

Or do you need to do a blend between the two “texture planes”?
In which case you need to draw additional geometry that does the texture blend.

What I would like to do is be able to look at the cube sideways and not see a gap between the textures. What Zengar said makes all sense to me, in that a sideways look onto the polygons, onto which the textures are projected shows nothing because the projection is infinitely thin.

Yes I am looking for a volumetric effect. I can use a CPU to calculate any cut-plane in the cube, but heck, then I wouldn’t need OpenGL

With that again, is there a way (in OpenGL, not using shaders) to fill in the voxels between two textures?

Thanks!

Create gap filling textures and use it for your cube sides. Or use shaders.

How densely will I have to create textures in the gap? The example above has one at z=0.3 and one at z=0.4.

10 in between them or 100 or 1000?

Thanks!

You need to read some documentation on hardware accelerated volume rendering :
http://www.vis.uni-stuttgart.de/vis03_tutorial/

And then you have drishti :
http://sf.anu.edu.au/Vizlab/drishti/

Problem is that all of that material uses shaders which I do not want to use.

Thanks!

Too bad bad for you. You are back to 2003. Is that a limitation of budget, limited by your intended market, or that you fear that “shaders are hard to do” (quite the opposite in fact) ?

Anyway you should at least read the “Introduction to GPU Volume Rendering” (1) and (2), as they give useful information for basic texture slices, exactly what you said you want to do.

Ok, will do, but please accept that I do have that limitation.

Thanks!

No problem, I accept everything, but you still did not say why you have this limitation ?