示例#1
0
    public void ChangeHDRState()
    {
        Camera main = Camera.main;

        if (main != null)
        {
            CYBloom bloom = main.GetComponent <CYBloom>();
            if (bloom != null)
            {
                bloom.enabled = !bloom.enabled;
            }

            CYTonemapping hdr = main.GetComponent <CYTonemapping>();
            if (hdr != null)
            {
                hdr.enabled = !hdr.enabled;
            }
        }
    }
示例#2
0
    // Use this for initialization
    void Start()
    {
        standardShader     = Shader.Find("CY/Standard(Custom)");
        standardSpecShader = Shader.Find("CY/Standard (Specular setup)(Custom)");
        // 默认运行高配shader
        standardShader.maximumLOD     = SHADER_LOD_LOW;
        standardSpecShader.maximumLOD = SHADER_LOD_LOW;

        m_screenWidth  = Screen.currentResolution.width;
        m_screenHeight = Screen.currentResolution.height;
        m_renderPath   = RenderingPath.Forward;
        m_IsHDREnabled = true;
        m_bloom        = Camera.main.GetComponent <CYBloom>();
        m_tonemapping  = Camera.main.GetComponent <CYTonemapping>();

        QualitySettings.SetQualityLevel((int)QualityLevel.Low);
        m_qualityLevel = QualityLevel.Low;

        SetHDREnabled(false);
        int nw = (int)(m_screenWidth * 0.75f);
        int nh = (int)(m_screenHeight * 0.75f);

        Screen.SetResolution(nw, nh, false);
    }