- Home /
How do I feed normal information to my shader, when using GL.lines?
I realize lines don’t actually have a FACE, which makes this question a little odd. However the lines I’m drawing (with http://docs.unity3d.com/ScriptReference/GL.LINES.html) will “represent” faces of 3D object, and I would like to be able to pass that normal to my custom shader.
The only way I have found to do this is to use a secondary UV coordinate (http://docs.unity3d.com/ScriptReference/GL.MultiTexCoord.html), to pass the normal information to the shader. While this works fine as a "workaround", it IS a bit confusing, and not perfectly logical/consistent. (Particularly if I want to make the shader available to programmers other than myself.)
Is there some other, more logical/consistent, way to pass the normal information to my shader when using the GL drawing functions? I have gone through all the GL functions in the manual (http://docs.unity3d.com/ScriptReference/GL.html) , but don’t see anything about normals.
I suspect the answer is "no other way", but figured I'd ask the community to confirm. Thanks in advance.