texture_lod?

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 : enable

Querying 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?

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.

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.

Mmhh, thanks. I still wonder, why my card doesn´t have ARB_shader_texture_lod but does export GL_EXT_texture_lod

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…

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.

Originally posted by CaseMillennium:
[b]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? [/b]
Define “gives a bad taste”.

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/
?

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.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.