PDA

View Full Version : GL_ARB_shader_texture_lod



ruysch
03-27-2008, 05:51 AM
Could some one point me to documentation of the following level-of-detail texture fetch instruction.

Also which GPU's support lod fetch using 3D textures?

Jedimaster
03-27-2008, 08:12 PM
Hi, I have asked for this similar question, look at here

http://www.opengl.org/discussion_boards/...5688#Post235688 (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Main=46660&Number=235688#Post235688)

I have tried to use hardware accelerated mipmap texturing.

1) BindTexuture
2) gluBuildMipmap{1|2}D
3D texture, maybe you should filter all by your self, then use glTexImage3DEXT to upload different level.
3) set MAG and MIn to GL_LINEAR_MIPMAP_LINEAR, the hardware will do linear mix on different mip level.
4) use texture2D() in your GLSL shader, HW will calculate proper level, or you manually set with texture2DLod()

Query you GPU to find whether it supports tex3d, if it supports tex3d, it will support 3d texture mipmap, I thought.

arekkusu
03-28-2008, 03:04 AM
Fragment Texture*Lod fetches, including Texture3DLod, are hardware accelerated on:
R500+
NV40+
(NV34 can accelerate Texture*Grad, but not Texture*Lod.)

Vertex and geometry fetches are accelerated on a smaller set of hardware.

FWIW, the ARB_texture_shader_lod spec is still sitting in limbo in Khronos bug #2120, sitting with blichtenbelt@nvidia.com.

ZbuffeR
03-28-2008, 03:58 AM
FWIW, the ARB_texture_shader_lod spec is still sitting in limbo in Khronos bug #2120, sitting with blichtenbelt@nvidia.com.
How come you are aware of that ? Are you a Khronos "insider", or is this on a public link ?

ruysch
03-28-2008, 12:43 PM
Query you GPU to find whether it supports tex3d, if it supports tex3d, it will support 3d texture mipmap, I thought.

I am pretty sure this isnt true. The texture 3D extension isnt coupled with GLSL. Also why should one use glTexImage3DEXT for 3D textures, isnt that deprecacted?

3D textures have been in the OpenGL spec for ages, the scary part is that I havent been able to find solid documentation on
GL_ARB_shader_texture_lod. But perhaps someone can point my towards official documentation on GL_ARB_shader_texture_lod ?

arekkusu
03-28-2008, 02:11 PM
perhaps someone can point my towards official documentation

Until Khronos gets around to posting the official spec, there isn't any.

Right now the closest you can get is EXT_gpu_shader4 (http://www.opengl.org/registry/specs/EXT/gpu_shader4.txt), check the section starting with "vec4 texture1DGrad".

The ARB_shader_texture_lod behavior is identical, except that the *Grad functions have "ARB" suffices, and you need to use
#extension GL_ARB_shader_texture_lod : <behavior>
instead of
#extension GL_EXT_gpu_shader4 : <behavior>

Oh, and it works on a lot of hardware that can't support EXT_gpu_shader4.

Zengar
03-28-2008, 04:41 PM
[quote=ruysch Also why should one use glTexImage3DEXT for 3D textures, isnt that deprecacted?
[/QUOTE]

How that?

Ingrater
03-29-2008, 03:15 AM
For what would one need GL_ARB_shader_texture_lod?
texture2DLod is part of GLSL 1.2?
(even supported by ati, at least I'm think so because rendermonkey colors the texture2DLod call)

arekkusu
03-29-2008, 12:47 PM
The built-in Texture*Lod functions are only available in the vertex shader.

ARB_shader_texture_lod adds the same functions to the fragment shader, and also Texture*Grad functions.

See this old newsletter (http://www.opengl.org/pipeline/article/vol001_5/) for an example of why you'd want to use it.