Esempio n. 1
0
    private Color GenericGradientColorTimeOfDate(GradientFilterType typeGradient)
    {
        Color            prevousFilterColor = new Color();
        Color            currentFilterColor = new Color();
        FiltersTimeOfDay prevousTOD         = PreviousTimeOfDay();

        switch (typeGradient)
        {
        case GradientFilterType.Sky:
            prevousFilterColor = CollectionColorSky[prevousTOD];
            currentFilterColor = CollectionColorSky[FilterTimeOfDay];
            break;

        case GradientFilterType.Equator:
            prevousFilterColor = CollectionColorEquator[prevousTOD];
            currentFilterColor = CollectionColorEquator[FilterTimeOfDay];
            break;

        case GradientFilterType.Ground:
            prevousFilterColor = CollectionColorGround[prevousTOD];
            currentFilterColor = CollectionColorGround[FilterTimeOfDay];
            break;
        }

        float redNew   = CalculateNextColor(prevousFilterColor.r, currentFilterColor.r);
        float greenNew = CalculateNextColor(prevousFilterColor.g, currentFilterColor.g);
        float blueNew  = CalculateNextColor(prevousFilterColor.b, currentFilterColor.b);

        return(new Color(redNew, greenNew, blueNew));
    }
Esempio n. 2
0
    public void NextTimeOfDay()
    {
        //bool isLastTOD = (int)FilterTimeOfDay == Enum.GetNames(typeof(FiltersTimeOfDay)).Length - 1;
        //int n = isLastTOD ? 0 : (int)FilterTimeOfDay + 1;
        //string nameTOD = Enum.GetNames(typeof(FiltersTimeOfDay))[n];
        //FilterTimeOfDay = (FiltersTimeOfDay)Enum.Parse(typeof(FiltersTimeOfDay), nameTOD);

        bool isLastTOD = m_CalendarIndex == m_CalendarTimeOfDay.Length - 1;

        m_CalendarIndex = isLastTOD ? 0 : m_CalendarIndex + 1;
        FilterTimeOfDay = m_CalendarTimeOfDay[m_CalendarIndex];
    }
Esempio n. 3
0
    private void SetSceneGradientColor(FiltersTimeOfDay tod)
    {
        //TEST COLOR
        bool isTest = false;//  true;

        if (!IsSceneGradientColorOn)
        {
            return;
        }

        if (isTest)
        {
            RenderSettings.ambientSkyColor     = Storage.Palette.SceneSkyColor;
            RenderSettings.ambientEquatorColor = Storage.Palette.SceneEquatorColor;
            RenderSettings.ambientGroundColor  = Storage.Palette.SceneGroundColor;
        }
        else
        {
            RenderSettings.ambientSkyColor     = SelectedColorSky = GenericGradientColorTimeOfDate(GradientFilterType.Sky);
            RenderSettings.ambientEquatorColor = SelectedColorEquator = GenericGradientColorTimeOfDate(GradientFilterType.Equator);
            RenderSettings.ambientGroundColor  = SelectedColorGround = GenericGradientColorTimeOfDate(GradientFilterType.Ground);
        }
    }
Esempio n. 4
0
    private void SetFiltersLighting()
    {
        //GRADIENT BASE
        SetSceneGradientColor(FilterTimeOfDay);

        m_FilterTimeOfDay = FilterTimeOfDay;
        switch (FilterTimeOfDay)
        {
        case FiltersTimeOfDay.Day:
            SetFilterLightLUT(DayLUT);     //LUT

            //start
            if (PreviousTimeOfDay() != FilterTimeOfDay)
            {
                HeroPointLight.enabled = true;
                HeroSpotLight.enabled  = false;
            }
            break;

        case FiltersTimeOfDay.Evening:
            SetFilterLightLUT(EveningLUT);     //LUT

            //start
            if (PreviousTimeOfDay() != FilterTimeOfDay)
            {
                HeroSpotLight.enabled  = false;
                HeroPointLight.enabled = false;
            }
            break;

        case FiltersTimeOfDay.Night:
            SetFilterLightLUT(Night_2_LUT);     //LUT

            //start
            if (PreviousTimeOfDay() != FilterTimeOfDay)
            {
                HeroPointLight.enabled = true;
                HeroSpotLight.enabled  = false;
            }
            break;

        case FiltersTimeOfDay.Morning:
            SetFilterLightLUT(MorningLUT);     //LUT

            //start
            if (PreviousTimeOfDay() != FilterTimeOfDay)
            {
                HeroSpotLight.enabled  = true;
                HeroPointLight.enabled = true;
            }
            break;
        }
        if (!IsSceneGradientColorOn) //GRADIENT BASE
        {
            return;                  //TEST

            m_PostProcessProfile.userLut.enabled = true;
            m_PostProcessProfile.userLut         = m_lutModel;
            m_postProcess.profile = m_PostProcessProfile;
        }
    }