Re: Problem running ogles2 program on Nokia N900
On Thu, 2010-02-25 at 13:14 +0100, ext Jonny Karlsson wrote: > Now I finally managed to get my OGLES2 program working on N900. The > variable type and the precision definition was still in the wrong order at > one place in my code... ... > So, at least on N900, the variable type must be defined before the > precision value. In the OGLES2-SDK emulator the order of these doesn't > matter, it > works anyway. N900 has the same order as the GLES shader specification, so the emulator is at fault :) -Kimmo ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Problem running ogles2 program on Nokia N900
Now I finally managed to get my OGLES2 program working on N900. The variable type and the precision definition was still in the wrong order at one place in my code... Here are my working shaders: const char* pszVertShader = "attribute vec4myVertex;\n" "attribute vec4fargKod;\n" "attribute vec2myUV;\n" "uniform highp mat4yRotMatris;\n" "uniform highp mat4xRotMatris;\n" "uniform highp mat4frustMatris;\n" "varying lowp vec4 outColor;\n" "varying mediump vec2 myTextCoord;\n" "void main()\n" "{\n" "outColor = fargKod;\n" "myTextCoord = myUV;\n" "gl_Position = myVertex * yRotMatris * xRotMatris;\n" "}\n"; const char* pszFragShader = "uniform mediump sampler2D sampler2d;\n" "varying mediump vec2 myTextCoord;\n" "void main ()\n" "{\n" "gl_FragColor = texture2D(sampler2d,myTextCoord);\n" "}\n"; So, at least on N900, the variable type must be defined before the precision value. In the OGLES2-SDK emulator the order of these doesn't matter, it works anyway. Thank you very much for your help Kimmo! Jonny On Thu, 25 Feb 2010, Kimmo Hämäläinen wrote: On Thu, 2010-02-25 at 10:38 +0100, ext Jonny Karlsson wrote: Thank you for your prompt answer! I noticed I had precision and variable type the wrong way and changed that (it still worked in the emulator though). I also removed the precision values from all attributes. But I still get the same error. This is very weird, it seams like the shader code is not recognized on the Nokie device at all.. We use shaders in hildon-desktop. Maybe looking at those helps with the syntax: http://maemo.gitorious.org/fremantle-hildon-desktop/hildon-desktop/blobs/master/src/tidy/tidy-blur-group.c Notice that the GLES shader specification allows the implementation to slack at times when it comes to precisions. http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf -Kimmo /Jonny On Thu, 25 Feb 2010, Kimmo Hämäläinen wrote: On Wed, 2010-02-24 at 22:37 +0100, ext Jonny Karlsson wrote: I have successfully compiled an OpenGL ES 2.0 program on scratchbox for the FREMANTILE_ARMEL plattform. However, when running the program on Nokia N900 the compilation of the vertex and fragment shaders fails. This is the error code: Failed to compile fragment shader: Compile failed. ERROR: 0:1: 'varying' : syntax error; parse error ERROR: 1 compilation errors. No code generated. "mediump varying" -> "varying mediump" Failed to compile fragment shader: Compile failed. ERROR: 0:1: 'attribute' : syntax error; parse error ERROR: 1 compilation errors. No code generated. Try removing highp/lowp/mediump from attributes, since those are given as input, so maybe you cannot define their precision. -Kimmo Failed to link program: Link Error: Vertex shader is missing. Link Error: Fragment shader is missing. -- This is my vertex shader: const char* pszVertShader = "\ highp attribute vec4 myVertex;\ lowp attribute vec4 fargKod;\ mediump attribute vec2 myUV;\ highp uniform mat4 yRotMatris;\ highp uniform mat4 xRotMatris;\ highp uniform mat4 frustMatris;\ lowp varying vec4 outColor;\ mediump varying vec2 myTextCoord;\ void main(void)\ {\ outColor = fargKod;\ myTextCoord = myUV;\ gl_Position = myVertex * yRotMatris * xRotMatris;\ }"; and this is my fragment shader: const char* pszFragShader = "\ uniform sampler2D sampler2d;\ mediump varying vec2 myTextCoord;\ void main (void)\ {\ gl_FragColor = texture2D(sampler2d,myTextCoord);\ }"; These shader compile successfully and works fine when I run the same OGLES2 program in the simulation environment. Does anyone have a clue what could be wrong? Is there perhaps something that need to be installed on the Nokia N900 to add shader compilation support to it??? /Jonny ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Problem running ogles2 program on Nokia N900
On Thu, 2010-02-25 at 10:38 +0100, ext Jonny Karlsson wrote: > Thank you for your prompt answer! > > I noticed I had precision and variable type the wrong way and changed that > (it still worked in the emulator though). I also removed the precision > values from all attributes. But I still get the same error. This is very > weird, it > seams like the shader code is not recognized on the Nokie device at all.. We use shaders in hildon-desktop. Maybe looking at those helps with the syntax: http://maemo.gitorious.org/fremantle-hildon-desktop/hildon-desktop/blobs/master/src/tidy/tidy-blur-group.c Notice that the GLES shader specification allows the implementation to slack at times when it comes to precisions. http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf -Kimmo > > /Jonny > > > On Thu, 25 Feb 2010, Kimmo Hämäläinen wrote: > > > On Wed, 2010-02-24 at 22:37 +0100, ext Jonny Karlsson wrote: > >> I have successfully compiled an OpenGL ES 2.0 program on scratchbox for > >> the FREMANTILE_ARMEL plattform. However, when running the program on Nokia > >> N900 the compilation of the vertex and fragment shaders fails. This is the > >> error code: > >> > >> > >> Failed to compile fragment shader: Compile failed. > >> ERROR: 0:1: 'varying' : syntax error; parse error > >> ERROR: 1 compilation errors. No code generated. > > > > "mediump varying" -> "varying mediump" > > > >> > >> Failed to compile fragment shader: Compile failed. > >> ERROR: 0:1: 'attribute' : syntax error; parse error > >> ERROR: 1 compilation errors. No code generated. > > > > Try removing highp/lowp/mediump from attributes, since those are given > > as input, so maybe you cannot define their precision. > > > > -Kimmo > > > >> > >> > >> Failed to link program: Link Error: Vertex shader is missing. > >> Link Error: Fragment shader is missing. > >> -- > >> > >> This is my vertex shader: > >> > >>const char* pszVertShader = "\ > >> > >>highp attribute vec4 myVertex;\ > >>lowp attribute vec4 fargKod;\ > >>mediump attribute vec2 myUV;\ > >>highp uniform mat4 yRotMatris;\ > >>highp uniform mat4 xRotMatris;\ > >>highp uniform mat4 frustMatris;\ > >>lowp varying vec4 outColor;\ > >>mediump varying vec2 myTextCoord;\ > >>void main(void)\ > >>{\ > >>outColor = fargKod;\ > >>myTextCoord = myUV;\ > >>gl_Position = myVertex * yRotMatris * xRotMatris;\ > >> > >>}"; > >> > >> and this is my fragment shader: > >> > >>const char* pszFragShader = "\ > >>uniform sampler2D sampler2d;\ > >>mediump varying vec2 myTextCoord;\ > >>void main (void)\ > >>{\ > >>gl_FragColor = texture2D(sampler2d,myTextCoord);\ > >>}"; > >> > >> > >> These shader compile successfully and works fine when I run the same > >> OGLES2 program in the simulation environment. > >> > >> Does anyone have a clue what could be wrong? Is there perhaps something > >> that need to be installed on the Nokia N900 to add shader compilation > >> support to it??? > >> > >> > >> /Jonny > >> ___ > >> maemo-developers mailing list > >> maemo-developers@maemo.org > >> https://lists.maemo.org/mailman/listinfo/maemo-developers > > ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Problem running ogles2 program on Nokia N900
Thank you for your prompt answer! I noticed I had precision and variable type the wrong way and changed that (it still worked in the emulator though). I also removed the precision values from all attributes. But I still get the same error. This is very weird, it seams like the shader code is not recognized on the Nokie device at all.. /Jonny On Thu, 25 Feb 2010, Kimmo Hämäläinen wrote: On Wed, 2010-02-24 at 22:37 +0100, ext Jonny Karlsson wrote: I have successfully compiled an OpenGL ES 2.0 program on scratchbox for the FREMANTILE_ARMEL plattform. However, when running the program on Nokia N900 the compilation of the vertex and fragment shaders fails. This is the error code: Failed to compile fragment shader: Compile failed. ERROR: 0:1: 'varying' : syntax error; parse error ERROR: 1 compilation errors. No code generated. "mediump varying" -> "varying mediump" Failed to compile fragment shader: Compile failed. ERROR: 0:1: 'attribute' : syntax error; parse error ERROR: 1 compilation errors. No code generated. Try removing highp/lowp/mediump from attributes, since those are given as input, so maybe you cannot define their precision. -Kimmo Failed to link program: Link Error: Vertex shader is missing. Link Error: Fragment shader is missing. -- This is my vertex shader: const char* pszVertShader = "\ highp attribute vec4 myVertex;\ lowp attribute vec4 fargKod;\ mediump attribute vec2 myUV;\ highp uniform mat4 yRotMatris;\ highp uniform mat4 xRotMatris;\ highp uniform mat4 frustMatris;\ lowp varying vec4 outColor;\ mediump varying vec2 myTextCoord;\ void main(void)\ {\ outColor = fargKod;\ myTextCoord = myUV;\ gl_Position = myVertex * yRotMatris * xRotMatris;\ }"; and this is my fragment shader: const char* pszFragShader = "\ uniform sampler2D sampler2d;\ mediump varying vec2 myTextCoord;\ void main (void)\ {\ gl_FragColor = texture2D(sampler2d,myTextCoord);\ }"; These shader compile successfully and works fine when I run the same OGLES2 program in the simulation environment. Does anyone have a clue what could be wrong? Is there perhaps something that need to be installed on the Nokia N900 to add shader compilation support to it??? /Jonny ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Problem running ogles2 program on Nokia N900
On Wed, 2010-02-24 at 22:37 +0100, ext Jonny Karlsson wrote: > I have successfully compiled an OpenGL ES 2.0 program on scratchbox for > the FREMANTILE_ARMEL plattform. However, when running the program on Nokia > N900 the compilation of the vertex and fragment shaders fails. This is the > error code: > > > Failed to compile fragment shader: Compile failed. > ERROR: 0:1: 'varying' : syntax error; parse error > ERROR: 1 compilation errors. No code generated. "mediump varying" -> "varying mediump" > > Failed to compile fragment shader: Compile failed. > ERROR: 0:1: 'attribute' : syntax error; parse error > ERROR: 1 compilation errors. No code generated. Try removing highp/lowp/mediump from attributes, since those are given as input, so maybe you cannot define their precision. -Kimmo > > > Failed to link program: Link Error: Vertex shader is missing. > Link Error: Fragment shader is missing. > -- > > This is my vertex shader: > > const char* pszVertShader = "\ > > highp attribute vec4 myVertex;\ > lowp attribute vec4 fargKod;\ > mediump attribute vec2 myUV;\ > highp uniform mat4 yRotMatris;\ > highp uniform mat4 xRotMatris;\ > highp uniform mat4 frustMatris;\ > lowp varying vec4 outColor;\ > mediump varying vec2 myTextCoord;\ > void main(void)\ > {\ > outColor = fargKod;\ > myTextCoord = myUV;\ > gl_Position = myVertex * yRotMatris * xRotMatris;\ > > }"; > > and this is my fragment shader: > > const char* pszFragShader = "\ > uniform sampler2D sampler2d;\ > mediump varying vec2 myTextCoord;\ > void main (void)\ > {\ > gl_FragColor = texture2D(sampler2d,myTextCoord);\ > }"; > > > These shader compile successfully and works fine when I run the same > OGLES2 program in the simulation environment. > > Does anyone have a clue what could be wrong? Is there perhaps something > that need to be installed on the Nokia N900 to add shader compilation > support to it??? > > > /Jonny > ___ > maemo-developers mailing list > maemo-developers@maemo.org > https://lists.maemo.org/mailman/listinfo/maemo-developers ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers