Shader documentation clarification

Deprecated or not deprecated

I have been reading the JME3 and Shaders documentation and I just want to clear up an ambiguity in the section “JME3 and OpenGL 3 & 4 compatibility”

There is a list of GLSL 1.2 attributes and their JME3 equivalents. In this section it says that the GLSL 1.2 attributes are deprecated. I can see two interpretations of this section

These GLSL 1.2 attributes are deprecated and therefore their JME3 equivalents are also deprecated, do not use either

or (the one I think may be correct given the rest of the document)

These GLSL 1.2 attributes are deprecated but we want to keep using them so these JME3 equivalents are provided instead, never use the GLSL 1.2 attributes, always use the JME3 equivalents

Would I be correct in saying that the second interpretation is the correct one?

Defined meanings

I’ve also slowly been getting to grips with the meanings and usages of these attributes, some being obvious, some less so. My understanding of them is as follows

gl_Vertex(aka inPosition) - the vertex position in model space
gl_Normal (aka inNormal) - the vertex normal in model space
gl_Color (aka inColor) - the vertex color
gl_MultiTexCoord0 (aka inTexCoord) - the texture coordinate of the vertex
gl_ModelViewMatrix (aka g_WorldViewMatrix) - converts a vector not a normal to eye space
gl_ProjectionMatrix (aka g_ProjectionMatrix)
gl_ModelViewMatrix (aka g_WorldViewProjectionMatrix) - matrix to convert from model space to view space (aka the 2d screen)
gl_NormalMatrix (aka g_NormalMatrix) - converts a normal to eye space

Assuming that my understanding of them is correct can I add these meanings to the table in the documentation? Or does such a table already exist elsewhere?

I think it looks correct, but I rarely know the older pipelines parameters.

gl_ModelViewMatrix - It can convert a normal from model to eye space as well if the scaling is uniform, so you might want to re-word that.
gl_ProjectionMatrix - converts a vector from view space to clip space.
gl_ModelViewMatrix (second one) - you are missing a Projection postfix. And then it should say from model to clip space. Technically it’s not a 2D screen yet. After clip space, it goes through a perspective division to get it to NDC (-1 to 1) along each axis (even Z), then goes to viewport space.
gl_NormalMatrix - should probably say a normal from model to eye space.

1 Like

For the most part, these are documented here: