Ejemplo n.º 1
0
        // Initialization
        public void Awake()
        {
            managerState = "waking up";
            m_radius     = (float)parentCelestialBody.Radius;
            //			print (m_radius);

            m_sunNode = new SunNode();
            m_sunNode.Start();

            m_skyNode = new SkyNode();
            m_skyNode.setManager(this);
            m_skyNode.SetParentCelestialBody(parentCelestialBody);
            m_skyNode.setParentPlanetTransform(ParentPlanetTransform);
            //			print ("skynode parent CB and PP set");
            //m_skyNode.loadSettings ();
            m_skyNode.loadFromConfigNode(false);
            m_skyNode.Start();
            //m_skyNode.loadFromConfigNode(false);
            //m_skyNode.loadFromConfigNode ();
            //			print ("skynode started");

            if (hasOcean)
            {
                m_oceanNode = new OceanWhiteCaps();
                m_oceanNode.setManager(this);
                m_oceanNode.setCore(m_core);

                m_oceanNode.loadFromConfigNode(false);
                m_oceanNode.Start();
            }

            managerState = "awake";
        }
Ejemplo n.º 2
0
        // Initialization
        public void Awake()
        {
            m_radius = parentCelestialBody.Radius;
            //			print (m_radius);

            m_sunNode = new SunNode();
            m_sunNode.Start();

            m_skyNode = new SkyNode();
            m_skyNode.setManager(this);
            m_skyNode.SetParentCelestialBody(parentCelestialBody);
            m_skyNode.setParentPlanetTransform(ParentPlanetTransform);
            //			print ("skynode parent CB and PP set");
            //m_skyNode.loadSettings ();
            m_skyNode.loadFromConfigNode(false);

            m_skyNode.Start();

            //m_skyNode.loadFromConfigNode(false);
            //m_skyNode.loadFromConfigNode ();
            //			print ("skynode started");

            if (hasOcean && Core.Instance.useOceanShaders)
            {
                m_oceanNode = new OceanWhiteCaps();
                m_oceanNode.setManager(this);
                m_oceanNode.setCore(Core.Instance);

                m_oceanNode.loadFromConfigNode(false);
                m_oceanNode.Start();
            }
        }
 public void settings(Material inSkyMat, Manager inManager, SkyNode inSkyNode, Transform inparentTransform)
 {
     skyMat          = inSkyMat;
     m_manager       = inManager;
     m_skynode       = inSkyNode;
     parentTransform = inparentTransform;
 }
Ejemplo n.º 4
0
 public void settings(Mesh inmesh,Material inSkyMat, Material inSkyExtinct, Manager inManager, SkyNode inSkyNode, GameObject inSkyObject,GameObject inSkyExtinctObject, bool indebug6, Transform inparentTransform, Transform inCelestialTransform)
 {
     skyMat = inSkyMat;
     skyExtinct = inSkyExtinct;
     m_manager = inManager;
     m_skynode = inSkyNode;
     skyObject = inSkyObject;
     skyExtinctObject = inSkyExtinctObject;
     debug6 = indebug6;
     parentTransform = inparentTransform;
     celestialTransform = inCelestialTransform;
     m_mesh = inmesh;
 }
Ejemplo n.º 5
0
        public void getSettingsFromSkynode()
        {
            SkyNode     skyNode  = Scatterer.Instance.planetsConfigsReader.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode;
            ConfigPoint selected = skyNode.configPoints [selectedConfigPoint];

            postProcessingalpha = selected.postProcessAlpha;
            postProcessDepth    = selected.postProcessDepth;

            extinctionTint = selected.extinctionTint;

            postProcessExposure = selected.scatteringExposure;
            exposure            = selected.skyExposure;
            alphaGlobal         = selected.skyAlpha;

            openglThreshold = selected.openglThreshold;

            configPointsCnt = skyNode.configPoints.Count;

            specR     = skyNode.specR;
            specG     = skyNode.specG;
            specB     = skyNode.specB;
            shininess = skyNode.shininess;
            flattenScaledSpaceMesh = skyNode.flattenScaledSpaceMesh;

            rimBlend = skyNode.rimBlend;
            rimpower = skyNode.rimpower;

            skyExtinctionTint = selected.skyExtinctionTint;

            extinctionThickness = selected.extinctionThickness;

            mieG = skyNode.m_mieG;

            experimentalAtmoScale = skyNode.experimentalAtmoScale;
            atmosphereGlobalScale = skyNode.atmosphereGlobalScale;
            viewdirOffset         = selected.viewdirOffset;

            cloudColorMultiplier         = skyNode.cloudColorMultiplier;
            cloudScatteringMultiplier    = skyNode.cloudScatteringMultiplier;
            cloudSkyIrradianceMultiplier = skyNode.cloudSkyIrradianceMultiplier;

            volumetricsColorMultiplier = skyNode.volumetricsColorMultiplier;
            //			volumetricsScatteringMultiplier = skyNode.volumetricsScatteringMultiplier;
            //			volumetricsSkyIrradianceMultiplier = skyNode.volumetricsSkyIrradianceMultiplier;
        }
Ejemplo n.º 6
0
 void InitSkyAndOceanNodes()
 {
     m_skyNode = (SkyNode)Scatterer.Instance.scaledSpaceCamera.gameObject.AddComponent(typeof(SkyNode));
     m_skyNode.setManager(this);
     m_skyNode.setCelestialBodyName(parentCelestialBody.name);
     m_skyNode.setParentScaledTransform(parentScaledTransform);
     m_skyNode.setParentLocalTransform(parentLocalTransform);
     m_skyNode.usesCloudIntegration = usesCloudIntegration;
     if (m_skyNode.loadFromConfigNode())
     {
         m_skyNode.Init();
         if (hasOcean && Scatterer.Instance.mainSettings.useOceanShaders && (HighLogic.LoadedScene != GameScenes.MAINMENU))
         {
             m_oceanNode = (OceanWhiteCaps)Scatterer.Instance.ReturnProperCamera(true, false).gameObject.AddComponent(typeof(OceanWhiteCaps));
             m_oceanNode.Init(this);
         }
     }
 }
Ejemplo n.º 7
0
        public void Awake()
        {
            if (HighLogic.LoadedScene == GameScenes.MAINMENU)
            {
                GameObject _go = Core.GetMainMenuObject(parentCelestialBody.name);
                if (_go)
                {
                    MeshRenderer _mr = _go.GetComponent <MeshRenderer> ();
                    if (_mr)
                    {
                        var sctBodyTransform = ScaledSpace.Instance.transform.FindChild(parentCelestialBody.name);
                        m_radius = (_go.transform.localScale.x / sctBodyTransform.localScale.x) * parentCelestialBody.Radius;
                    }
                }
            }
            else
            {
                m_radius = parentCelestialBody.Radius;
            }

            m_skyNode = (SkyNode)Core.Instance.scaledSpaceCamera.gameObject.AddComponent(typeof(SkyNode));
            m_skyNode.setManager(this);
            m_skyNode.setCelestialBodyName(parentCelestialBody.name);
            m_skyNode.setParentScaledTransform(parentScaledTransform);
            m_skyNode.setParentLocalTransform(parentLocalTransform);

            m_skyNode.usesCloudIntegration = usesCloudIntegration;

            if (m_skyNode.loadFromConfigNode())
            {
                m_skyNode.Init();

                if (hasOcean && Core.Instance.useOceanShaders && (HighLogic.LoadedScene != GameScenes.MAINMENU))
                {
                    m_oceanNode = (OceanWhiteCaps)Core.Instance.farCamera.gameObject.AddComponent(typeof(OceanWhiteCaps));
                    m_oceanNode.setManager(this);

                    m_oceanNode.loadFromConfigNode();
                    m_oceanNode.Init();
                }
            }
        }
Ejemplo n.º 8
0
        // Initialization
        public void Awake()
        {
            m_radius = parentCelestialBody.Radius;
            //			print (m_radius);

            m_skyNode = new SkyNode();
            m_skyNode.setManager(this);
            m_skyNode.SetParentCelestialBody(parentCelestialBody);
            m_skyNode.setParentPlanetTransform(ParentPlanetTransform);

            if (m_skyNode.loadFromConfigNode())
            {
                m_skyNode.Start();

                if (hasOcean && Core.Instance.useOceanShaders)
                {
                    m_oceanNode = new OceanWhiteCaps();
                    m_oceanNode.setManager(this);

                    m_oceanNode.loadFromConfigNode();
                    m_oceanNode.Start();
                }
            }
        }
Ejemplo n.º 9
0
        // Initialization
        public void Awake()
        {
            m_radius = parentCelestialBody.Radius;

            m_skyNode = (SkyNode)Core.Instance.scaledSpaceCamera.gameObject.AddComponent(typeof(SkyNode));
            m_skyNode.setManager(this);
            m_skyNode.usesCloudIntegration = usesCloudIntegration;
            m_skyNode.SetParentCelestialBody(parentCelestialBody);
            m_skyNode.setParentPlanetTransform(ParentPlanetTransform);

            if (m_skyNode.loadFromConfigNode())
            {
                m_skyNode.Init();

                if (hasOcean && Core.Instance.useOceanShaders)
                {
                    m_oceanNode = (OceanWhiteCaps)Core.Instance.farCamera.gameObject.AddComponent(typeof(OceanWhiteCaps));
                    m_oceanNode.setManager(this);

                    m_oceanNode.loadFromConfigNode();
                    m_oceanNode.Init();
                }
            }
        }
Ejemplo n.º 10
0
        public void getSettingsFromSkynode()
        {
            SkyNode     skyNode  = Core.Instance.scattererCelestialBodies [selectedPlanet].m_manager.m_skyNode;
            ConfigPoint selected = skyNode.configPoints [selectedConfigPoint];

            postProcessingalpha = selected.postProcessAlpha;
            //			postProcessDepth = 10000 * selected.postProcessDepth;
            postProcessDepth = selected.postProcessDepth;

            _Post_Extinction_Tint    = selected._Post_Extinction_Tint;
            postExtinctionMultiplier = selected.postExtinctionMultiplier;

            postProcessExposure = selected.postProcessExposure;
            exposure            = selected.skyExposure;
            skyRimExposure      = selected.skyRimExposure;
            alphaGlobal         = selected.skyAlpha;

            openglThreshold = selected.openglThreshold;

            _GlobalOceanAlpha = selected._GlobalOceanAlpha;
            //			edgeThreshold = selected.edgeThreshold * 100;


            mapAlphaGlobal     = skyNode.mapAlphaGlobal;
            mapExposure        = skyNode.mapExposure;
            mapSkyRimeExposure = skyNode.mapSkyRimExposure;
            configPointsCnt    = skyNode.configPoints.Count;

            specR     = skyNode.specR;
            specG     = skyNode.specG;
            specB     = skyNode.specB;
            shininess = skyNode.shininess;


            rimBlend = skyNode.rimBlend;
            rimpower = skyNode.rimpower;

            //MapViewScale = skyNode.MapViewScale;
            extinctionMultiplier        = selected.skyExtinctionMultiplier;
            extinctionTint              = selected.skyExtinctionTint;
            skyExtinctionRimFade        = selected.skyextinctionRimFade;
            skyExtinctionGroundFade     = selected.skyextinctionGroundFade;
            _extinctionScatterIntensity = selected._extinctionScatterIntensity;

            mapExtinctionMultiplier        = skyNode.mapExtinctionMultiplier;
            mapExtinctionTint              = skyNode.mapExtinctionTint;
            mapSkyExtinctionRimFade        = skyNode.mapSkyExtinctionRimFade;
            _mapExtinctionScatterIntensity = skyNode._mapExtinctionScatterIntensity;

            showInterpolatedValues = skyNode.displayInterpolatedVariables;

            mieG = skyNode.m_mieG;

            experimentalAtmoScale = skyNode.experimentalAtmoScale;
            viewdirOffset         = selected.viewdirOffset;

            cloudColorMultiplier         = skyNode.cloudColorMultiplier;
            cloudScatteringMultiplier    = skyNode.cloudScatteringMultiplier;
            cloudSkyIrradianceMultiplier = skyNode.cloudSkyIrradianceMultiplier;

            volumetricsColorMultiplier = skyNode.volumetricsColorMultiplier;
            //			volumetricsScatteringMultiplier = skyNode.volumetricsScatteringMultiplier;
            //			volumetricsSkyIrradianceMultiplier = skyNode.volumetricsSkyIrradianceMultiplier;
        }
Ejemplo n.º 11
0
 public void settings(SkyNode inSkyNode)
 {
     m_skynode = inSkyNode;
     HDR       = m_skynode.farCameraHDR;
 }