Re: How to set up a 3D texture with following settings
- From: "henryjoye@xxxxxxxxx" <henryjoye@xxxxxxxxx>
- Date: Mon, 22 Oct 2007 16:48:47 -0700
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
.
- References:
- How to set up a 3D texture with following settings
- From: henryjoye@xxxxxxxxx
- Re: How to set up a 3D texture with following settings
- From: Wolfgang Draxinger
- How to set up a 3D texture with following settings
- Prev by Date: Re: cad gui toolkit
- Next by Date: Fast vertex color update - graphics memory
- Previous by thread: Re: How to set up a 3D texture with following settings
- Next by thread: Best approach for text, maybe true type fonts?
- Index(es):
Relevant Pages
|