I began to experiment with shaders and found some code online which lets you set texture wrapping modes in opengl glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); But it seems that I cannot use any of this gl* functions inside shaders.
You can create your own texture wrapping using the fract function (returns the fractionl part of a float, eg the same as %1, except it can be “overloaded”, like all openGL functions, with a vector). eg:
No, those are Open GLES commands, rather than Open GLES Shader Language commands, so they are taken care of by the Codea mesh/ shader API. Often there’ll be an equivalent command in the Codea API for the more commonly used Open GL commands, eg the mesh buffer commands, blendmode, or the frustrum settings in the perspective command (or the new support for instanced drawing added to Codea 2.3.2).
You’re very welcome. @Ignatz 's ebooks / blog series on shaders and 3D are an excellent resource, if you haven’t already read them.
Generally, it’s not too hard to port most Open GL code you find online to Codea. The shader language is the same, and a lot of the time the Codea mesh API does everything you need. This ebook, tho aimed at Unity, is quite a good resource
@se24vad - shaders are not as scary as they look, trust me. I am hopeless with C, but I managed ok.
Making a texture tile (i.e. repeat) itself over and over requires one line of shader code. I have it in my shader ebook, and it is my favorite line of code in all of
Codea, because it is so useful.