JOGL - use 3D textures in GLSL-Shader
843799Jan 12 2007 — edited May 7 2007Hi,
i can't see any more google-hitlists. I tried really hard to find an answer to my question, but i have to ask you.
What i try to do is to implement in JOGL, R2.3.1, an application that uses GLSL-Shader to generate rust.
I am using the ImprovedNoise-Class, by Ken Perlin for java. This class is making an byte-Array of 128*128*128 RGBA-values,
(128*128*128*4 Byte = really big : )
This ByteArray shall be the input for the shader (the noise).
I know that in GLSL i can use the sampler3D-Datatype for 3D textures.
But, my questions are:
1. Can i use the ByteArray to generate a 3D texture (gl.glTexImage3D(....)) and bind this to an object? If so, i could use the (gl_TexCoord[0]) to acces the coordinates of the texture from within the shader.
or
2. Is it a must to register the ByteArray as a uniform-variable, that the shader can access the texture? And if so, how can i do this.
and
3. Is there something else i have to care about?
(I will post the code if someone can help me and just need more detail. It's too much text.)
I hope, someone can help me answer these questions.
HELP!!!!
Thanx
CU
(And sorry for my bad english.)