//in COGLES2Solid.vsh
//for (i = 0; i < int(uLightCount); i++) //will failed on some android system
{
if (uLightType == 0)
pointLight(i, Position, Normal, Ambient, Diffuse, Specular);
}
//please use this way~~~
for (i = 0; i < int(MAX_LIGHTS); i++)
{
if( i >= uLightCount )
break;
if (uLightType == 0)
pointLight(i, Position, Normal, Ambient, Diffuse, Specular);
}
[fixed]android ogles2 shader problem fixed
Re: android ogles2 shader problem fixed
Thanks for the report. Seems it's not just in COGLES2Solid.vsh, but same bug is also in COGLES2Refelction2Layer.vsh, , COGLES2Solid2.vsh and COGLES2SphereMap.vsh.
Some cards accept it, but it's not really valid in GLSL it seems. Will fix later on (when I'm back on a system where I can test Android).
Some cards accept it, but it's not really valid in GLSL it seems. Will fix later on (when I'm back on a system where I can test Android).
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
Re: android ogles2 shader problem fixed
Fixed in r5117.
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
Re: [fixed]android ogles2 shader problem fixed
Unrelated to this, but are you aware of the command-line shader checker?
git clone https://github.com/clbr/glsl-optimizer.git
cd glsl-optimizer/src/glsl
make
cd ../../contrib/glslopt
make
sudo cp glslopt /usr/bin
I regularly use it to check desktop GLSL shaders, but it also supports GLES 2 and 3.
git clone https://github.com/clbr/glsl-optimizer.git
cd glsl-optimizer/src/glsl
make
cd ../../contrib/glslopt
make
sudo cp glslopt /usr/bin
I regularly use it to check desktop GLSL shaders, but it also supports GLES 2 and 3.
Usage: glslopt <-f|-v> <input shader> [<output shader>]
-f : fragment shader (default)
-v : vertex shader
-1 : target OpenGL (default)
-2 : target OpenGL ES 2.0
-3 : target OpenGL ES 3.0
If no output specified, output is to [input].out.
Re: [fixed]android ogles2 shader problem fixed
Didn't know it - thanks. Also for the make instructions (as it didn't build otherwise - although https://github.com/aras-p/glsl-optimizer which seemed the original got a little further on building before it failed).
But won't use it on Irrlicht-shaders - because it does remove comments and makes the code harder to read. And Irrlicht shaders aren't really meant to be used like that in a time-critical game anyway. They do everything and have to reduce for a real game.
But won't use it on Irrlicht-shaders - because it does remove comments and makes the code harder to read. And Irrlicht shaders aren't really meant to be used like that in a time-critical game anyway. They do everything and have to reduce for a real game.
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
Re: [fixed]android ogles2 shader problem fixed
I meant use it as a checker, not as an optimizer - delete the .out optimized shaders. It will bail out if you have invalid GLSL.
Very handy when editing shaders, speedy test cycles.
Very handy when editing shaders, speedy test cycles.