PDA

View Full Version : texture_lod?



CaseMillennium
06-18-2007, 01:34 AM
Hi,

I want to use the texture2DLod functions in my shader which requires me to turn on the extension. However, when I only get an extension not supported error when I try this:

#extension GL_EXT_texture_lod : enableQuerying the driver ( 97.95 nvidia driver on Geforce 7800GS) for the extension however confirms that the extension does exist.

The texture2DLod functions do, however, work correctly (meaning, the assembly produced contains the TXL instead of the TEX calls), but it somehow gives a bad taste.

Does anybody have an idea what might go wrong?

Relic
06-18-2007, 01:59 AM
1.) There is no GL_EXT_texture_lod on http://www.opengl.org/registry/ or http://developer.nvidia.com/object/nvidia_opengl_specs.html (?)

There are GL_SGIS_texture_lod, GL_SGIX_texture_lod_bias and there is GL_EXT_texture_lod_bias.
None of these mention GLSL.
Texture LOD and bias are in the OpenGL core since version 1.4.

2.) texture2DLod() is in the GLSL spec 1.20.
There shouldn't be a need for an extension enable. For paranoia you could add a #version 120 if you like.

arekkusu
06-18-2007, 05:24 PM
Lod functions are part of ARB_shader_texture_lod, promoted from ATI_shader_texture_lod. They are also present in NV_gpu_shader4 and EXT_gpu_shader4.

CaseMillennium
06-19-2007, 03:54 AM
Mmhh, thanks. I still wonder, why my card doesn´t have ARB_shader_texture_lod but does export GL_EXT_texture_lod

Overmind
06-19-2007, 07:16 AM
For paranoia you could add a #version 120 if you like.I think that's mandatory. If you don't use a #version directive, you'll get version 1.10 and the lod functions should not work. The nVidia compilers ignore this, but technically the GLSL code is wrong, so you have no guarantee that it will work on other vendors or even with future driver versions, if nVidia decides to make them more spec conformant...

Relic
06-19-2007, 08:49 AM
The texture2DLod function was already in the 1.10 spec, but is only allowed in the vertex shader.
Means the extension is to allow it officially in the fragment shader then.
Anyone has a pointer to official specs for that ARB_shader_texture_lod or ATI_shader_texture_lod?
All I found were presentations about proposals.

Humus
06-27-2007, 04:50 PM
Originally posted by CaseMillennium:
The texture2DLod functions do, however, work correctly (meaning, the assembly produced contains the TXL instead of the TEX calls), but it somehow gives a bad taste.

Does anybody have an idea what might go wrong? Define "gives a bad taste".

PkK
07-04-2007, 02:28 AM
Any information about these extensions except for
http://ati.amd.com/developer/kri06/KRI%202006-OpenGL%20optimizations.pdf
http://ati.amd.com/developer/kri06/KRI%202006-OpenGL%20future.pdf
http://www.opengl.org/pipeline/article/vol001_5/
?

Brolingstanz
07-06-2007, 04:38 AM
I think that's mandatory. If you don't use a #version directive, you'll get version 1.10 and the lod functions should not work. The nVidia compilers ignore this, but technically the GLSL code is wrong, so you have no guarantee that it will work on other vendors or even with future driver versions, if nVidia decides to make them more spec conformant...Glad you mentioned it. I just realised I've never used #version. Can't say that I've missed it though.