this question is mainly for Ville and Kjell but I think that everybody can profit from answer(s).
Could you please make a summary of all shader variables (types, names and short semantics) currently supported by ZGE?
uniform mat4 modelViewProjectionMatrix;
uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;
uniform mat3 normalMatrix;
uniform mat4 textureMatrix; //Holds the current texture matrix (updated via RenderText or Material.TextureX/Y/Scale properties
uniform vec4 globalColor; //The current color that is set using RenderSetColor or Material.Color
attribute vec4 position; //vertex position
attribute vec4 color; //vertex color (does it work?)
attribute vec2 texCoord; //vertex texture coordinate
attribute vec3 normal; //vertex normal
// textures in fragment shader
uniform sampler2D tex1;
uniform sampler2D tex2;
uniform sampler2D tex3;
...
Is this list correct and complete?
How, for instance, to obtain color of particle (including alpha)?
Perhaps you could clarify that this thread is only relevant when you're targeting OpenGL 3.3 ( Core ) or ES 2.0. When you're targeting legacy OpenGL you can use everything ( from this cheat sheet ) of course. Just so that newbies who stumble upon this thread won't get confused
Anyway, the list you've posted is complete. There is however a problem / bug with the color attribute. When you set the particle colors in RenderParticles, you actually have to divide the vec4 by 255 in your shader to get the proper color values. I suspect Ville has used a incorrect type parameter somewhere.
+ And imo vec4 position should be called vertex ( since it's gl_Vertex in legacy OpenGL as well ).