PDA

View Full Version : Texture gap filtering in Z



umugl
04-17-2008, 06:20 AM
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?

V-man
04-17-2008, 08:34 AM
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.

umugl
04-17-2008, 01:42 PM
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!

Zengar
04-17-2008, 02:36 PM
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.

umugl
04-17-2008, 08:46 PM
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!

datsua
04-17-2008, 11:55 PM
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.

umugl
04-18-2008, 06:17 AM
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!

Zengar
04-18-2008, 06:59 AM
Create gap filling textures and use it for your cube sides. Or use shaders.

umugl
04-18-2008, 08:38 AM
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!

ZbuffeR
04-18-2008, 03:08 PM
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/

umugl
04-21-2008, 07:16 AM
Problem is that all of that material uses shaders which I do not want to use.

Thanks!

ZbuffeR
04-21-2008, 01:04 PM
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.

umugl
04-24-2008, 04:12 PM
Ok, will do, but please accept that I do have that limitation.

Thanks!

ZbuffeR
04-24-2008, 04:20 PM
:)
No problem, I accept everything, but you still did not say *why* you have this limitation ?