// public void OnPreRender() public void OnPreCull() { // var munCelestialTransform =(Transform) ScaledSpace.Instance.transform.FindChild ("Mun"); // if (munCelestialTransform) // { // m_manager.GetCore().copiedScaledSunLight.transform.position=munCelestialTransform.position; // } // else // { // Debug.Log("muncelestial not found"); // } // // m_manager.GetCore().copiedScaledSunLight.light.type=LightType.Point; // m_manager.GetCore().copiedScaledSunLight.light.range=1E9f; skyMat.SetMatrix("_Sun_WorldToLocal", m_manager.GetSunWorldToLocalRotation()); //don't touch this // if (!(HighLogic.LoadedScene == GameScenes.TRACKSTATION)) { m_skynode.UpdateStuff(); // m_skynode.InitUniforms (skyMat); //desn't need to be done every frame, take a look at it and clean it up later m_skynode.SetUniforms(skyMat); } }
// 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); }
public void OnPreCull() { m_skynode.UpdateStuff(); m_skynode.SetUniforms(skyMat); if (m_manager.hasOcean && Core.Instance.useOceanShaders) { if (!MapView.MapIsEnabled && m_manager.m_skyNode.farCamera && !m_manager.m_skyNode.inScaledSpace) { m_manager.GetOceanNode().updateStuff(m_manager.GetOceanNode().m_oceanMaterial, m_manager.m_skyNode.farCamera); } } }