Script interface for.

Inheritance: UnityEngine.Object
 static public int constructor(IntPtr l)
 {
     UnityEngine.QualitySettings o;
     o = new UnityEngine.QualitySettings();
     pushObject(l, o);
     return(1);
 }
Exemple #2
0
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.QualitySettings o;
			o=new UnityEngine.QualitySettings();
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
 public static int constructor(IntPtr l)
 {
     try {
         UnityEngine.QualitySettings o;
         o=new UnityEngine.QualitySettings();
         pushValue(l,o);
         return 1;
     }
     catch(Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return 0;
     }
 }
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.QualitySettings o;
         o = new UnityEngine.QualitySettings();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
 static public int constructor(IntPtr l)
 {
     LuaDLL.lua_remove(l, 1);
     UnityEngine.QualitySettings o;
     if (matchType(l, 1))
     {
         o = new UnityEngine.QualitySettings();
         pushObject(l, o);
         return(1);
     }
     LuaDLL.luaL_error(l, "New object failed.");
     return(0);
 }
	static int _CreateQualitySettings(IntPtr L)
	{
		int count = LuaDLL.lua_gettop(L);

		if (count == 0)
		{
			QualitySettings obj = new QualitySettings();
			LuaScriptMgr.Push(L, obj);
			return 1;
		}
		else
		{
			LuaDLL.luaL_error(L, "invalid arguments to method: QualitySettings.New");
		}

		return 0;
	}
    static int _CreateUnityEngine_QualitySettings(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 0)
        {
            UnityEngine.QualitySettings obj = new UnityEngine.QualitySettings();
            ToLua.Push(L, obj);
            return(1);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: UnityEngine.QualitySettings.New");
        }

        return(0);
    }
Exemple #8
0
 static int QPYX__CreateUnityEngine_QualitySettings_YXQP(IntPtr L_YXQP)
 {
     try
     {
         int QPYX_count_YXQP = LuaDLL.lua_gettop(L_YXQP);
         if (QPYX_count_YXQP == 0)
         {
             UnityEngine.QualitySettings QPYX_obj_YXQP = new UnityEngine.QualitySettings();
             ToLua.PushSealed(L_YXQP, QPYX_obj_YXQP);
             return(1);
         }
         else
         {
             return(LuaDLL.luaL_throw(L_YXQP, "invalid arguments to ctor method: UnityEngine.QualitySettings.New"));
         }
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
Exemple #9
0
        void OnOptionsGUI()
        {
            GUILayout.Label("\nQUALITY\n");


            Quality.antiAliasing = UI.OptionsWindow.MultipleOptions(Quality.antiAliasing,
                                                                    "Anti aliasing", 0, 1, 2, 4);

            string newLevel = UI.OptionsWindow.MultipleOptions(this.qualitySettingsNames[Quality.GetQualityLevel()],
                                                               "Quality level", this.qualitySettingsNames);
            int newLevelIndex = System.Array.FindIndex(this.qualitySettingsNames, n => n == newLevel);

            if (Quality.GetQualityLevel() != newLevelIndex)
            {
                Quality.SetQualityLevel(newLevelIndex);
            }

            Quality.shadowDistance = UI.OptionsWindow.FloatSlider(Quality.shadowDistance,
                                                                  0, 500, "Shadow distance");
        }
    static int _CreateUnityEngine_QualitySettings(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                UnityEngine.QualitySettings obj = new UnityEngine.QualitySettings();
                ToLua.PushSealed(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: UnityEngine.QualitySettings.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Exemple #11
0
        private void DoDepthOfField(RenderTexture source, RenderTexture destination)
        {
            m_CurrentQualitySettings = quality;

            if (settings.quality != QualityPreset.Custom)
                m_CurrentQualitySettings = QualitySettings.presetQualitySettings[(int)settings.quality];

            float radiusAdjustement = source.height / 720.0f;

            float textureBokehScale = radiusAdjustement;
            float textureBokehMaxRadius = Mathf.Max(blur.nearRadius, blur.farRadius) * textureBokehScale * 0.75f;

            float nearBlurRadius = blur.nearRadius * radiusAdjustement;
            float farBlurRadius = blur.farRadius * radiusAdjustement;
            float maxBlurRadius = Mathf.Max(nearBlurRadius, farBlurRadius);
            switch (settings.apertureShape)
            {
                case ApertureShape.Hexagonal:
                    maxBlurRadius *= 1.2f;
                    break;
                case ApertureShape.Octogonal:
                    maxBlurRadius *= 1.15f;
                    break;
            }

            if (maxBlurRadius < 0.5f)
            {
                Graphics.Blit(source, destination);
                return;
            }

            // Quarter resolution
            int rtW = source.width / 2;
            int rtH = source.height / 2;
            Vector4 blurrinessCoe = new Vector4(nearBlurRadius * 0.5f, farBlurRadius * 0.5f, 0.0f, 0.0f);
            RenderTexture colorAndCoc = m_RTU.GetTemporaryRenderTexture(rtW, rtH);
            RenderTexture colorAndCoc2 = m_RTU.GetTemporaryRenderTexture(rtW, rtH);

            // Downsample to Color + COC buffer and apply boost
            Vector4 cocParam;
            Vector4 cocCoe;
            ComputeCocParameters(out cocParam, out cocCoe);
            filmicDepthOfFieldMaterial.SetVector("_BlurParams", cocParam);
            filmicDepthOfFieldMaterial.SetVector("_BlurCoe", cocCoe);
            filmicDepthOfFieldMaterial.SetVector("_BoostParams", new Vector4(nearBlurRadius * blur.nearBoostAmount * -0.5f, farBlurRadius * blur.farBoostAmount * 0.5f, blur.boostPoint, 0.0f));
            Graphics.Blit(source, colorAndCoc2, filmicDepthOfFieldMaterial, (settings.tweakMode == TweakMode.Explicit) ? (int)Passes.CaptureCocExplicit : (int)Passes.CaptureCoc);
            RenderTexture src = colorAndCoc2;
            RenderTexture dst = colorAndCoc;

            // Collect texture bokeh candidates and replace with a darker pixel
            if (shouldPerformBokeh)
            {
                // Blur a bit so we can do a frequency check
                RenderTexture blurred = m_RTU.GetTemporaryRenderTexture(rtW, rtH);
                Graphics.Blit(src, blurred, filmicDepthOfFieldMaterial, (int)Passes.BoxBlur);
                filmicDepthOfFieldMaterial.SetVector("_Offsets", new Vector4(0.0f, 1.5f, 0.0f, 1.5f));
                Graphics.Blit(blurred, dst, filmicDepthOfFieldMaterial, (int)Passes.BlurAlphaWeighted);
                filmicDepthOfFieldMaterial.SetVector("_Offsets", new Vector4(1.5f, 0.0f, 0.0f, 1.5f));
                Graphics.Blit(dst, blurred, filmicDepthOfFieldMaterial, (int)Passes.BlurAlphaWeighted);

                // Collect texture bokeh candidates and replace with a darker pixel
                textureBokehMaterial.SetTexture("_BlurredColor", blurred);
                textureBokehMaterial.SetFloat("_SpawnHeuristic", bokehTexture.spawnHeuristic);
                textureBokehMaterial.SetVector("_BokehParams", new Vector4(bokehTexture.scale * textureBokehScale, bokehTexture.intensity, bokehTexture.threshold, textureBokehMaxRadius));
                Graphics.SetRandomWriteTarget(1, computeBufferPoints);
                Graphics.Blit(src, dst, textureBokehMaterial, (int)BokehTexturesPasses.Collect);
                Graphics.ClearRandomWriteTargets();
                SwapRenderTexture(ref src, ref dst);
                m_RTU.ReleaseTemporaryRenderTexture(blurred);
            }

            filmicDepthOfFieldMaterial.SetVector("_BlurParams", cocParam);
            filmicDepthOfFieldMaterial.SetVector("_BlurCoe", blurrinessCoe);
            filmicDepthOfFieldMaterial.SetVector("_BoostParams", new Vector4(nearBlurRadius * blur.nearBoostAmount * -0.5f, farBlurRadius * blur.farBoostAmount * 0.5f, blur.boostPoint, 0.0f));

            // Dilate near blur factor
            RenderTexture blurredFgCoc = null;
            if (m_CurrentQualitySettings.dilateNearBlur)
            {
                RenderTexture blurredFgCoc2 = m_RTU.GetTemporaryRenderTexture(rtW, rtH, 0, RenderTextureFormat.RGHalf);
                blurredFgCoc = m_RTU.GetTemporaryRenderTexture(rtW, rtH, 0, RenderTextureFormat.RGHalf);
                filmicDepthOfFieldMaterial.SetVector("_Offsets", new Vector4(0.0f, nearBlurRadius * 0.75f, 0.0f, 0.0f));
                Graphics.Blit(src, blurredFgCoc2, filmicDepthOfFieldMaterial, (int)Passes.DilateFgCocFromColor);
                filmicDepthOfFieldMaterial.SetVector("_Offsets", new Vector4(nearBlurRadius * 0.75f, 0.0f, 0.0f, 0.0f));
                Graphics.Blit(blurredFgCoc2, blurredFgCoc, filmicDepthOfFieldMaterial, (int)Passes.DilateFgCoc);
                m_RTU.ReleaseTemporaryRenderTexture(blurredFgCoc2);
            }

            // Blur downsampled color to fill the gap between samples
            if (m_CurrentQualitySettings.prefilterBlur)
            {
                Graphics.Blit(src, dst, filmicDepthOfFieldMaterial, (int)Passes.CocPrefilter);
                SwapRenderTexture(ref src, ref dst);
            }

            // Apply blur : Circle / Hexagonal or Octagonal (blur will create bokeh if bright pixel where not removed by "m_UseBokehTexture")
            switch (settings.apertureShape)
            {
                case ApertureShape.Circular:
                    DoCircularBlur(blurredFgCoc, ref src, ref dst, maxBlurRadius);
                    break;
                case ApertureShape.Hexagonal:
                    DoHexagonalBlur(blurredFgCoc, ref src, ref dst, maxBlurRadius);
                    break;
                case ApertureShape.Octogonal:
                    DoOctogonalBlur(blurredFgCoc, ref src, ref dst, maxBlurRadius);
                    break;
            }

            // Smooth result
            switch (m_CurrentQualitySettings.medianFilter)
            {
                case FilterQuality.Normal:
                {
                    medianFilterMaterial.SetVector("_Offsets", new Vector4(1.0f, 0.0f, 0.0f, 0.0f));
                    Graphics.Blit(src, dst, medianFilterMaterial, (int)MedianPasses.Median3);
                    SwapRenderTexture(ref src, ref dst);
                    medianFilterMaterial.SetVector("_Offsets", new Vector4(0.0f, 1.0f, 0.0f, 0.0f));
                    Graphics.Blit(src, dst, medianFilterMaterial, (int)MedianPasses.Median3);
                    SwapRenderTexture(ref src, ref dst);
                    break;
                }
                case FilterQuality.High:
                {
                    Graphics.Blit(src, dst, medianFilterMaterial, (int)MedianPasses.Median3X3);
                    SwapRenderTexture(ref src, ref dst);
                    break;
                }
            }

            // Merge to full resolution (with boost) + upsampling (linear or bicubic)
            filmicDepthOfFieldMaterial.SetVector("_BlurCoe", blurrinessCoe);
            filmicDepthOfFieldMaterial.SetVector("_Convolved_TexelSize", new Vector4(src.width, src.height, 1.0f / src.width, 1.0f / src.height));
            filmicDepthOfFieldMaterial.SetTexture("_SecondTex", src);
            int mergePass = (settings.tweakMode == TweakMode.Explicit) ? (int)Passes.MergeExplicit : (int)Passes.Merge;
            if (m_CurrentQualitySettings.highQualityUpsampling)
                mergePass = (settings.tweakMode == TweakMode.Explicit) ? (int)Passes.MergeExplicitBicubic : (int)Passes.MergeBicubic;

            // Apply texture bokeh
            if (shouldPerformBokeh)
            {
                RenderTexture tmp = m_RTU.GetTemporaryRenderTexture(source.height, source.width, 0, source.format);
                Graphics.Blit(source, tmp, filmicDepthOfFieldMaterial, mergePass);

                Graphics.SetRenderTarget(tmp);
                ComputeBuffer.CopyCount(computeBufferPoints, computeBufferDrawArgs, 0);
                textureBokehMaterial.SetBuffer("pointBuffer", computeBufferPoints);
                textureBokehMaterial.SetTexture("_MainTex", bokehTexture.texture);
                textureBokehMaterial.SetVector("_Screen", new Vector3(1.0f / (1.0f * source.width), 1.0f / (1.0f * source.height), textureBokehMaxRadius));
                textureBokehMaterial.SetPass((int)BokehTexturesPasses.Apply);
                Graphics.DrawProceduralIndirect(MeshTopology.Points, computeBufferDrawArgs, 0);
                Graphics.Blit(tmp, destination); // hackaround for DX11 flipfun (OPTIMIZEME)
            }
            else
            {
                Graphics.Blit(source, destination, filmicDepthOfFieldMaterial, mergePass);
            }
        }
Exemple #12
0
        public static void DecreaseLevel()
        {
            bool applyExpensiveChanges = false;

            QualitySettings.DecreaseLevel(applyExpensiveChanges);
        }
Exemple #13
0
        public static void SetQualityLevel(int index)
        {
            bool applyExpensiveChanges = true;

            QualitySettings.SetQualityLevel(index, applyExpensiveChanges);
        }