PDA

View Full Version : GLSL: a few questions about sampler3d



Hemlos
10-13-2009, 03:20 PM
Hi,
Im new here to this forums.
I appologize, if my questions are too rudimentary for the advanced threads.

My hope is to contact anyone familliar with 3d side of the GLSL language, and whom has time to answer a few GLSL questions, as i come across "issues".
I am trying to make a 3d shader library of GLSL(.vert .frag) programs.
My current shader project is "flowing fur" in 3d, on a sphere.
The image i attached to this message shows the effect in action.
http://www.glbasic.com/forum/index.php?action=dlattach;topic=3148.0;attach=1048 ;image

My Project, Where:
Im a newbie with using uniform sampler3d in GLSL.
Hardware for GLSL is version 1.20
Defining a 3d texture file in a .frag using: uniform sampler3D FurDirection;
I need to make a new .dds file, or use a prexisting one named NoiseVolume.dds

The 3d texture must be 128x128x128
Mipmap levels = 8
Origin Top/Left

Please answer any/all Questions concerning sampler3d:
1. How can i write the shader to call the file directly without using "uniform", like this: sampler3d filename?
2. What is a .dds file?
3. How do i make 3d textures for uniform sampler3d FurDirection; ?
4. What formats aside from .dds does GLSL #Version 1.20 support for the 3d textures?
5. Are the .dds files convertable from any main stream 3d graphics editors?(if yes, which?)


General questions about GLSL:
6. Are there any other main forums threads where i can find more information about GLSL, or is this the right place?
7. In the event that my new thread is in the wrong place, Can a mod move my new thread to a more appropriate place?

-Thank you in advance,
-Hemlos http://www.glbasic.com/forum/index.php?action=dlattach;topic=3148.0;attach=1048 ;image

todayman
10-13-2009, 04:55 PM
GLSL doesn't actually know about files on the disk. All the data that shaders deal with is passed to it through OpenGL function calls. I wouldn't say that GLSL supports any file formats, as it is not conerned with what is on the disk. There are different formats of the data that can be passed into a shader that OpenGL knows how to handle. These are listed in the specification (I don't recall what they are right now).

There is an OpenGL wiki here (http://www.opengl.org/wiki/Main_Page). It has a GLSL page and some good links.

As for the .dds format, the wikipedia article (http://en.wikipedia.org/wiki/DirectDraw_Surface) appears to have some good links at the end. There are links to plugins for GIMP and Photoshop there.

I haven't used 3d textures before, so I don't really know how they are generated.

Hemlos
10-14-2009, 07:50 AM
Good answers, very helpful!
I was expecting it to be more complicated than this.
I really appreciate you sorting me out!

Hemlos
10-14-2009, 07:59 AM
Yup here it is..found this through the links you provided.
The compressonator from AMD, it handles all the .dds and .tga files which are associated with use with sampler3d

http://developer.amd.com/gpu/compressonator/Pages/default.aspx