GLSL iOS values beyond 2048 modules operation fails

Started by
12 comments, last by deshan 8 years, 1 month ago
precision highp? gl_FragCoord?;
I can’t test right now. It may have to be:
precision highp? vec2 gl_FragCoord?;
Or:
precision highp float;


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Advertisement

Thank you L. Spiro

Kindly help me to fix below compile error,


Fragment shader compile log: ERROR: 0:1: 'gl_FragCoord' : syntax error: syntax error

// MODIFIED FRAGMENT SHADER CODE AS BELOW
precision highp gl_FragCoord;
//precision highp vec4 gl_FragCoord;

void main() 
{
 ....
}

And putting below didn't make any difference to the program


precision highp float;

Please help

It has to be precision highp float;.

If that doesn’t work then nothing will.

L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

It was an issue in the following line.

if(mod(xpos, 2.0) == 0.0)

Seems highp values beyond 2048 mod operation returns values where equals operation fails in the above condition.

I did the following and it seems fine in the iPad pro also


int val = int(mod(gl_FragCoord.x, 2.0));

if(val == 0)
  gl_FragColor = // red;
else
  gl_FragColor = // green;

Thanks you all

This topic is closed to new replies.

Advertisement