<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: 'Calibri'; COLOR: #000000">
<DIV>Hello,</DIV>
<DIV> </DIV>
<DIV>I have quite strange problem with openg gl and shaders on Sailfish. My
shaders code looks like this: </DIV>
<DIV> </DIV>
<DIV><FONT size=2>const char *fragmentShaderSnake = "precision mediump
float;\</FONT></DIV>
<DIV><FONT size=2> varying vec4
z_Color;\</FONT></DIV>
<DIV><FONT size=2>void main()\</FONT></DIV>
<DIV><FONT size=2>{\</FONT></DIV>
<DIV><FONT size=2> gl_FragColor = z_Color;\</FONT></DIV>
<DIV><FONT size=2>}";</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>const char *vertexShaderSnake = "uniform mat4
x_Matrix;\</FONT></DIV>
<DIV><FONT size=2> attribute vec4
x_Position;\</FONT></DIV>
<DIV><FONT size=2> attribute float
ccColor;\</FONT></DIV>
<DIV><FONT size=2> varying vec4
z_Color;\</FONT></DIV>
<DIV><FONT size=2> void
main()\</FONT></DIV>
<DIV><FONT size=2> {\</FONT></DIV>
<DIV><FONT
size=2> if
(ccColor == 0.7f)\</FONT></DIV>
<DIV><FONT
size=2>
{\</FONT></DIV>
<DIV><FONT
size=2>
z_Color = vec4(1.0 - ccColor, 1.0, ccColor, 1.0);\</FONT></DIV>
<DIV><FONT
size=2>
}\</FONT></DIV>
<DIV><FONT
size=2> else
if (ccColor == 0.2f)\</FONT></DIV>
<DIV><FONT
size=2>
{\</FONT></DIV>
<DIV><FONT
size=2>
z_Color = vec4(0.0, 0.0, 0.0, 1.0);\</FONT></DIV>
<DIV><FONT
size=2>
}\</FONT></DIV>
<DIV><FONT
size=2>
else\</FONT></DIV>
<DIV><FONT
size=2>
{\</FONT></DIV>
<DIV><FONT
size=2>
z_Color = vec4(1.0 - ccColor, 0.0, ccColor, 1.0);\</FONT></DIV>
<DIV><FONT
size=2>
}\</FONT></DIV>
<DIV><FONT
size=2>
gl_Position = x_Matrix * x_Position;\</FONT></DIV>
<DIV><FONT size=2> }";</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>attrib pointer:<BR></DIV>
<DIV><FONT size=2>void setVertexAttribPointer( int vrpDataOffset, int
vrpAttributeLocation, int vrpComponentCount, int vrpStride )</FONT></DIV>
<DIV><FONT size=2>{</FONT></DIV>
<DIV><FONT size=2>
glVertexAttribPointer(vrpAttributeLocation, vrpComponentCount, GL_FLOAT,
GL_FALSE, vrpStride, (const void *)vrpDataOffset);</FONT></DIV>
<DIV><FONT size=2>
glEnableVertexAttribArray(vrpAttributeLocation);</FONT></DIV>
<DIV><FONT size=2>}</FONT></DIV>
<DIV> </DIV>
<DIV>and draw function: </DIV>
<DIV> </DIV>
<DIV><FONT size=2>vrcVertexArray->bindBuffer();</FONT></DIV>
<DIV><FONT size=2>vrcVertexArray->setVertexAttribPointer(0,
vrpPositionLocation, 3, 4 * sizeof(float);</FONT></DIV>
<DIV><FONT size=2>vrcVertexArray->setVertexAttribPointer(3, vrpColorLocation,
1, 4 * sizeof(float); </FONT></DIV>
<DIV><FONT size=2>glDrawArrays( GL_TRIANGLE_STRIP, 0, 26 );</FONT></DIV>
<DIV><FONT size=2>[...]</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>I have created 26 points (3 floats for position and 1 float for color) to
make cuboid with triangle strip. I know all of them are correct, because
changing start index and count values of glDrawArrays draws correct part of
cuboid. However setting code as it is stated, makes some faces disappear, some
of them change color to red or black, also attribute ccColor is not working at
all (as if the value is not passed). I have tried almost everything but nothing
helps. Same code on Android works fine. Any help or clue would be greatly
appreciated.</DIV>
<DIV> </DIV>
<DIV>Thanks in advance,</DIV>
<DIV>Bartek</DIV>
<DIV><BR><BR> </DIV></DIV></DIV></BODY></HTML>