// public void OnRender() public void OnPreRender() { skyMat.SetMatrix ("_Sun_WorldToLocal", m_manager.GetSunWorldToLocalRotation ()); //don't touch this // if (debug6){ skyObject.transform.parent = parentTransform; skyExtinctObject.transform.parent = parentTransform; // } // // else{ // Transform celestialTransform = ScaledSpace.Instance.scaledSpaceTransforms.Single(t => t.name == parentCelestialBody.name); // tester.transform.parent = celestialTransform; // } m_skynode.InitUniforms(skyMat); m_skynode.SetUniforms (skyMat); m_skynode.InitUniforms(skyExtinct); m_skynode.SetUniforms (skyExtinct); m_skynode.UpdateStuff (); // skyMat.SetPass(0); // // Graphics.DrawMeshNow(m_mesh, position, Quaternion.identity); // // Graphics.DrawMesh(m_mesh, position, Quaternion.identity,m_skyMaterial,layer,cam); m_mesh.bounds = new Bounds(celestialTransform.position, new Vector3(1e32f,1e32f, 1e32f)); // skyMat.SetPass(0); // Graphics.DrawMesh (m_mesh, celestialTransform.position, Quaternion.identity, skyMat, 10, m_skynode.scaledSpaceCamera);//, 0, null, false, false); // // skyMat.SetPass(0); // Graphics.DrawMeshNow(m_mesh, celestialTransform.position, Quaternion.identity); }