Making fog with shaders?

Thanks for making the tutorials about shader @Ignatz. The flip shader you made, I have one question about it. Won’t you get the same result if you change z by -z isn’t the image flipped??

If you flip z then you are putting the image behind you

Ah, but I see what you mean, yes. But I’m just playing around.

Oh understood this one can be useful if you don’t want to the texts to become mirror images after rotation. You could switch this on every time the mesh rotates by 180 degrees. I don’t think you’ll be able to use z=-z if you have more than two images or can you even pushmatrix an popmatrix the camera position??

You could make the shader more automated as well… gl_FrontFacing tells you whether the triangle is facing towards or away from the camera (this assumes you declare your vertexes in a consistent winding, I think it’s anti clockwise, but could be wrong). So you could use that and have the shader auto switch between reversed or normal texture lookups.

What is the best way to find out what commands we can actually use in our shaders?

I’ve been reading stuff on OpenGL but a lot of it is about commands and processes we don’t have access to, and it’s hard to figure out what our particular command set looks like.

From the wiki https://bitbucket.org/TwoLivesLeft/core/wiki/GLSLES hit the reference card link, pages 3-4 have all the gumf we can use in OpenGL ES.

Cool, thanks

Ok, I’ve written what I know in here

https://www.dropbox.com/s/z05aql3qp3dsly5/Codea%20shaders.pdf
(you may need to download it, Dropbox does a lousy job of rendering it online)

I will edit it as I learn more.