Emulate gl_Normal in shader

Is there a simple way inside of a shader to replace gl_normal with a codea-like representation? I am trying to avoid having to calculate normals, but if I have to, how do I. Pass them in? A a buffer()?

I’m a bit confused on normals…

Depends on the type of normals, you absolutely have to calculate them yourself unfortunately.

For vertex normals you want a buffer equal to your number of vertices and calculate the normals into that, ideally once when you create the mesh.

For bump mapping which is effectively normals at a higher resolution than the mesh triangles, you can calculate the normals and stick them in an image as the colours and pass it to your shader as a texture.

I’m working on a much simplified example of the above in another thread, which will hopefully be done this weekend.