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.
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.
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”.
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.