Re: How to set up a 3D texture with following settings



Hi Wolfgang,

Thank you very much for your reply!

Here is my settings for glTexImage3D:
target = GL_TEXTURE_3D
level = 0
internalformat = GL_LUMINANCE_ALPHA??????
width = dim[0]
height = dim[1]
depth = dim[2]
border = 0
type = FLOAT ?????
format = GL_LUMINANCE_ALPHA

pixels = ???? how to apply data stream to this pointer? Is the stream
like this: R0 A0, R2 A2,......Rn An?

Are these settings right for my case? Because the value in the texture
is very large, I plan to test small data sets at first. Besides the
GL_MODULATE texture mode and glColor3f(1.0,0.0,0.0), what other
texture parameters do I need to pay attentation to? Could you please
show me a complete example for setting up this kind of texture?
Thanks!
My graphics card is GeForce 8300 with 512MB graphics memory.

James


void glTexImage3D
( GLenum target
, GLint level
, GLenum internalformat
, GLsizei width
, GLsizei height
, GLsizei depth
, GLint border
, GLenum format
, GLenum type
, const GLvoid *pixels
);




On Oct 23, 12:15 am, Wolfgang Draxinger <wdraxin...@xxxxxxxxxxxxxxxx>
wrote:
henryj...@xxxxxxxxx wrote:
Dimensions: dim[0], dim[1], dim[2]
Texture values: we need to store values in channel R and
channel A,

Use GL_LUMINANCE_ALPHA as format (there is no RED_ALPHA texture
format), with GL_MODULATE texture mode and
glColor3f(1.0,0.0,0.0);

the value range for each channel is (0,
dim[0]*dim[1]*dim[2]) (it is the multiplication of size of data
in three directions).

Texel values are either 8, 12 or 16 bits (integer) per channel,
or 32 bits per channel for a float texture.

512 = 2^9
512^3 = (2^9)^3 = 2^9*3 = 2^27, so you need a 32 bits per channel
texture, which leaves you with float textures.

But there's also another problem: 512^3 * 8 bytes = 1GiB. Only
professional grade cards have that much memory. Unless you got
one of the latest and biggest Quadro cards I doubt that this
will work. And even if so the fill rate will abyssmal, the whole
memory must be sparsely accessed, a chache trash nightmare. If
you are upon high resolution volume date rendering better choose
one of the implicit tesselation approaches, or get some
dedicated volume raycaster hardware (used in medical and
geodesic applications).

Usually 3D textures are 64x64x64 max, oftenly a lot smaller.

Wolfgang Draxinger
--
E-Mail address works, Jabber: hexar...@xxxxxxxxxx, ICQ: 134682867





.



Relevant Pages

  • Re: Textures all switched around on NOLF 1
    ... I know it's an old game, but I thought my Athlon XP 2100+ WinMe ... texture free. ... I tried changing the system BIOS settings to change AGP to ... and cameras real PITA. ...
    (comp.sys.ibm.pc.games.action)
  • Re: Kaboom!
    ... Now it's at least 20 on maximum settings. ... It's as if it can't decide which texture maps to use. ... a problem with the game, not the video card. ...
    (sci.geo.earthquakes)
  • Re: Textures all switched around on NOLF 1
    ... I know it's an old game, but I thought my Athlon XP 2100+ WinMe ... Humans) are bleached white, texture free. ... I tried changing the system BIOS settings to change AGP to ...
    (comp.sys.ibm.pc.games.action)
  • Re: Texture combine
    ... The first texture is an opaque texture, while the second one has some transparent areas. ... texture unit has its own settings for glTexEnv ... It doesn't happen as often as it should, because scientists ...
    (comp.graphics.api.opengl)
  • Re: D3DXLoadSurfaceFromMemory problem
    ... The image info always returns the closest format that resembles the file's ... The output texture format can be obtained from ... I use the format for the source texture in scratch ...
    (microsoft.public.win32.programmer.directx.graphics)