in my game I use a 3D texture and access the data using the texture3D() method in the fragment shader. My problem now is that although texture3D() is marked deprecated since 130 it works perfectly on my Radeon R7970; on another computer with an NVidia card it does not work and instead returns: “error C7533: global function texture3D is deprecated after version 120”.
So I guess what is happening is, that the Nvidia card is capable of a newer version of GLSL that removes the long time deprecated texture3D() method. I tried to fix the problem by replacing all texture3D() calls with texture() calls (like suggested in the GLSL documentation). But for some reason the compiler tells me that texture() would not have an overloaded version that is applicable to the types I provide - but in the GLSL documentation it clearly states that GLSL 150 supports this call: texture (gsampler3D sampler, vec3 P [, float bias]).
why can’t I use texture() instead of texture3D() when I define GLSL 150 in my j3md file?
is there a possibility to limit the version of the shader? Because should my guess be correct and texture3D() was not only marked deprecated but completely removed in Nvidia’s compiler, then I need to tell the compiler to use version 150 and accept the texture3D() call.
Hmm … I just recreated the case in a small sample app and there everything seems to work. Very odd … I guess it has something todo with my code or the engine version I use …
By the way: is there a way to get the shader code that is send to the compiler? Because I can’t really make much sense of the line numbers when JME is adding/changing things beforehand.
Do you see the problem? No? I didn’t see it either but the problem is simply that texture is defined as a variable and by that is overwriting the function definition (so it seems). That’s why I can’t use texture() as described in the standard. And it doesn’t have anything todo with the code fragment I posted before (that was from another source position - but I thought this was the problem).
I saw yesterday that Khronos has released a reference GLSL-compiler. It would be really great to have as a plugin in the IDE to test-compile the shaders code same way the IDE does for java code.