예제 #1
0
    // Use this for initialization
    void Start()
    {
        cgm   = postProcessingBehaviour.profile.colorGrading;
        cgms  = cgm.settings;
        dofm  = postProcessingBehaviour.profile.depthOfField;
        dofms = dofm.settings;

        if (QualitySettings.GetQualityLevel() <= 2)
        {
            postProcessingBehaviour.enabled = false;
        }

        /*TerrainData tData = terrain.terrainData;
         * float[,,] alphaData = tData.GetAlphamaps(0, 0, tData.alphamapWidth, tData.alphamapHeight);
         *
         * float percentage = 0.2f;
         * for(int y=0; y<tData.alphamapHeight; y++){
         * for(int x = 0; x < tData.alphamapWidth; x++){
         *              float swap = alphaData[x, y, 1];
         * alphaData[x, y, 1] = alphaData[x, y, 2];
         * alphaData[x, y, 2] = swap;
         * }
         * }
         *
         * tData.SetAlphamaps(0, 0, alphaData);*/
    }
예제 #2
0
        public void Start()
        {
            try
            {
                _camera     = Camera.main;
                _zoomButton = GameObject.Find("ZoomButton").GetComponent <UIMultiStateButton>();
                _mainPanel  = GameObject.Find("RenderItMainPanel").GetComponent <MainPanel>();

                _postProcessingBehaviour = _camera.gameObject.GetComponent <PostProcessingBehaviour>();
                if (_postProcessingBehaviour == null)
                {
                    _postProcessingBehaviour         = _camera.gameObject.AddComponent <PostProcessingBehaviour>();
                    _postProcessingBehaviour.profile = ScriptableObject.CreateInstance <PostProcessingProfile>();
                }
                _postProcessingBehaviour.enabled = true;

                _antialiasingModel     = new AntialiasingModel();
                _ambientOcclusionModel = new AmbientOcclusionModel();
                _bloomModel            = new BloomModel();
                _colorGradingModel     = new ColorGradingModel();

                _renderItAtlas = LoadResources();
                CreateUI();
            }
            catch (Exception e)
            {
                Debug.Log("[Render It!] ModManager:Start -> Exception: " + e.Message);
            }
        }
예제 #3
0
 private void Start()
 {
     cg        = ppp.colorGrading;
     cAbberate = ppp.chromaticAberration;
     ChangeSettingsChromaticAberration(0);
     randomTime = Random.Range(0, 20);
 }
예제 #4
0
 private void Start()
 {
     chromAModel       = mainCam.GetComponent <PostProcessingBehaviour>().profile.chromaticAberration;
     colorGModel       = mainCam.GetComponent <PostProcessingBehaviour>().profile.colorGrading;
     defaultChromAI    = chromAModel.settings.intensity;
     defaultColorGTemp = colorGModel.settings.basic.temperature;
 }
    public static void ConvertColourGradingViaLUT(PostProcessProfile ppp,
                                                  ColorGradingModel oldColorGradingSettings, PostProcessingProfile oldPPP)
    {
        var materialFactory = new MaterialFactory();

        var uberShader = materialFactory.Get("Hidden/Post FX/Uber Shader");

        uberShader.shaderKeywords = new string[0];

        var cgc = new ColorGradingComponent();

        cgc.Init(new PostProcessingContext
        {
            materialFactory = materialFactory
        }, oldColorGradingSettings);

        cgc.context.profile = oldPPP;

        cgc.Prepare(uberShader);

        var cg = ppp.AddSettings <ColorGrading>();

        cg.gradingMode.value         = GradingMode.LowDefinitionRange;
        cg.gradingMode.overrideState = true;

        var lut = cgc.model.bakedLut;

        /*
         * var textureFormat = TextureFormat.RGBAHalf;
         * if (!SystemInfo.SupportsTextureFormat(textureFormat))
         *  textureFormat = TextureFormat.ARGB32;
         *
         * var lutAsT2D = lut.GrabTexture(dontUseCopyTexture: true, format: textureFormat).GetPixels();
         *
         * for (int i = 0; i < lutAsT2D.Length; i++)
         * {
         *  lutAsT2D[i] = lutAsT2D[i].gamma;
         * }
         *
         * var newLut = new Texture2D(lut.width, lut.height, textureFormat, false, true);
         * newLut.SetPixels(lutAsT2D);
         * newLut.Apply(true, false);
         */

        cg.ldrLut.value = lut;//newLut;//TextureCompositor.GPUDegamma(newLut, null, true);

        cg.ldrLut.overrideState = true;

        cg.ldrLutContribution.value         = 1.0f;
        cg.ldrLutContribution.overrideState = true;

        var exposure = ppp.AddSettings <AutoExposure>();

        exposure.eyeAdaptation.value         = EyeAdaptation.Fixed;
        exposure.eyeAdaptation.overrideState = true;
        exposure.keyValue.value         = 1.0f;
        exposure.keyValue.overrideState = true;
    }
    // Use this for initialization
    void Start()
    {
        enemies = new List <FollowPlayer>();

        temperature = fadedOutTemperature;

        colorGrading = profile.colorGrading;

        var linear = new AnimationCurve();

        linear.AddKey(0, 0);
        linear.AddKey(1, 1);
        masterCurve = new ColorGradingCurve(linear, 0, false, new Vector2(0, 1));
        redCurve    = new ColorGradingCurve(linear, 0, false, new Vector2(0, 1));
    }