O'Reilly logo

OpenGL ES 3.0 Cookbook by Parminder Singh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating the circular pattern and making them revolve

This procedural texture recipe will make use of fragment coordinates to demonstrate a circular pattern using gl_FragCoord. The gl_FragCoord is a keyword available in the fragment shader that is responsible to store the window position of the current fragment in x and y coordinates; the z coordinate stores the depth of the fragment in the range [0, 1].

These coordinates are always relative to the OpenGL ES surface window; the gl_FragCoords is a result of a fixed functionality in which primitive are interpolated after the vertex processing stage to generate fragments. By default, the gl_FragCoord assumes the lower-left corner of the OpenGL ES rendering surface window as the origin. The following ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required