Hi Guys. So I created a triangle using Unity’s GL support. I created the triangle in world space like so,
var mat : Material = null;
function Start()
{
mat = new Material(Shader.Find("VertexLit"));
mat.color = Color.red;
}
function OnPostRender()
{
if(!mat)
{
return;
}
var vecPos : Vector3 = GameObject.Find("TriRef").transform.position;
GL.PushMatrix();
mat.SetPass(0);
//GL.LoadOrtho();
GL.Begin(GL.TRIANGLES);
GL.Vertex3(vecPos.x, vecPos.y, vecPos.z);
GL.Vertex3(vecPos.x + 10, vecPos.y + 10, vecPos.z);
GL.Vertex3(vecPos.x, vecPos.y + 10, vecPos.z);
GL.End();
GL.PopMatrix();
}
My Triangle is created just fine with a red color because of the material I created. However the lighting on the triangle doesn’t seem to be affected by my level’s light. All the other game objects in my level however, seem to respect my lights intensity. Is there a way to get GL primitives to respect lights? Thanks in advance!