Hi,
why does this shader code: "varying vec2 Texcoord;" work with version 5 of VS and PS, like here:
gpu->addHighLevelShaderMaterial(vertBumpShader, "main", irr::video::EVST_VS_5_0, fragBumpShader, "main", irr::video::EPST_PS_5_0,
callback);
Because "varying" keyword is deprecated in OpenGL 3.0 and newer and instead it should be replaced with "in" or "out" syntax?
How are flags EVST_VS_5_0 and EPST_PS_5_0 related to OpenGL? Is number 5 related to OpenGL version?
If not, which version of OpenGL is used by Irrlicht?
OpenGL 3.0 GLSL specifics
Re: OpenGL 3.0 GLSL specifics
That parameter is not used in OpenGL at all. Irrlicht trunk api documents that by now (I've also run into this at some point).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
gregorgragor3
- Posts: 6
- Joined: Sun Apr 20, 2025 9:09 am
Re: OpenGL 3.0 GLSL specifics
I found solution for specifying GLSL version at top of shader:
#version 150
I am searching now replacement for ftransform() and gl_MultiTexCoord0 in GLSL 1.50 , since they were deprecated and don't work in newer version.
Do you know what to use instead of those two?
#version 150
I am searching now replacement for ftransform() and gl_MultiTexCoord0 in GLSL 1.50 , since they were deprecated and don't work in newer version.
Do you know what to use instead of those two?
Re: OpenGL 3.0 GLSL specifics
Ah sorry, forgot writing about the #version thing, so yeah as you found out the glsl versions are decided per shader with the #version thing.
In Irrlicht you have to use gl_MultiTexCoord0 as that's the way it's passed right now.
Unless you are using Irrlicht/ogl-es where we pass "inTexCoord0" instead (COGLES2MaterialRenderer::init uses glBindAttribLocation which is probably the new way to do it when you got rid of fixed function pipeline completely, but in normal Irrlicht we still support that as well). All attributes used in OGL-ES can be found in EVertexAttributes.h
Had to look up ftransform, that's pretty old. Basically you have to pass our own matrices from c++ to shader (or from cpu to gpu) these days and then you can use them in any way you want. But if you look at the Irrlicht shader example (10.Shader) it should pass those matrices which are basically doing the old ftransform calculation I think. So worldViewProj in c++ and in opengl.vert you have: gl_Position = mWorldViewProj * gl_Vertex;
In Irrlicht you have to use gl_MultiTexCoord0 as that's the way it's passed right now.
Unless you are using Irrlicht/ogl-es where we pass "inTexCoord0" instead (COGLES2MaterialRenderer::init uses glBindAttribLocation which is probably the new way to do it when you got rid of fixed function pipeline completely, but in normal Irrlicht we still support that as well). All attributes used in OGL-ES can be found in EVertexAttributes.h
Had to look up ftransform, that's pretty old. Basically you have to pass our own matrices from c++ to shader (or from cpu to gpu) these days and then you can use them in any way you want. But if you look at the Irrlicht shader example (10.Shader) it should pass those matrices which are basically doing the old ftransform calculation I think. So worldViewProj in c++ and in opengl.vert you have: gl_Position = mWorldViewProj * gl_Vertex;
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm