Example #1
0
    static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
    {
        string[] entries = System.Array.FindAll(importedAssets, name => name.Contains("SP_StartupWindow") && !name.EndsWith(".meta"));

        for (int i = 0; i < entries.Length; i++)
        {
            if (SP_StartupWindow.Init(false))
            {
                break;
            }
        }
    }
Example #2
0
    public override void OnInspectorGUI()
    {
        serializedObject.Update();

        p_aoMode.enumValueIndex = EditorGUILayout.Popup(new GUIContent("SSAO Mode", "SSAO Algorithm"), p_aoMode.enumValueIndex, c_aoModes);

        // Near/far view plane check if Mode == AOMode.V1
        if (p_aoMode.enumValueIndex == 0)
        {
            Camera camera = ((SSAOPro)target).GetComponent <Camera>();

            if (camera.nearClipPlane < 0.3 || (camera.farClipPlane - camera.nearClipPlane) > 5000)
            {
                EditorGUILayout.HelpBox("Check your view planes ! You may experience artifacts and heavy self-shadowing with your current camera settings. Make sure you read the \"Random Notes\" section in the doc.", MessageType.Warning);
            }
        }

        Texture2D noise = (Texture2D)p_noiseTexture.objectReferenceValue;

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.PrefixLabel("Noise Texture");
        EditorGUILayout.BeginHorizontal();
        noise = (Texture2D)EditorGUILayout.ObjectField(noise, typeof(Texture2D), false);
        if (GUILayout.Button("D", EditorStyles.miniButtonLeft))
        {
            noise = Resources.Load <Texture2D>("noise");
        }
        if (GUILayout.Button("N", EditorStyles.miniButtonRight))
        {
            noise = null;
        }
        EditorGUILayout.EndHorizontal();
        EditorGUILayout.EndHorizontal();

        p_noiseTexture.objectReferenceValue = noise;

        EditorGUILayout.PropertyField(p_samples, new GUIContent("Sample Count", "Number of ambient occlusion samples (higher is slower)"));
        EditorGUILayout.PropertyField(p_downsampling, new GUIContent("Downsampling", "The resolution at which calculations should be performed (for example, a downsampling value of 2 will work at half the screen resolution)"));
        EditorGUILayout.PropertyField(p_intensity, new GUIContent("Intensity", "Occlusion multiplier (degree of darkness added by ambient occlusion)"));
        EditorGUILayout.PropertyField(p_radius, new GUIContent("Radius", "Sampling radius (in world unit)"));
        EditorGUILayout.PropertyField(p_distance, new GUIContent("Distance", "Distance between an occluded sample and its occluder"));
        EditorGUILayout.PropertyField(p_bias, new GUIContent("Bias", "Adds to the width of the occlusion cone (push this up to reduce artifacts)"));
        EditorGUILayout.PropertyField(p_lumContribution, new GUIContent("Lighting Contribution", "Uses the pixel luminosity to reduce ambient occlusion in bright areas"));
        EditorGUILayout.PropertyField(p_occlusionColor, new GUIContent("Occlusion Color", "Color to use for the occluded areas (pure black leads to better performances)"));
        EditorGUILayout.PropertyField(p_blur, new GUIContent("Blur Type", "Type of blur to apply to the ambient occlusion pass"));

        if (p_blur.intValue != (int)SSAOPro.BlurMode.None)
        {
            EditorGUI.indentLevel++;
            EditorGUILayout.PropertyField(p_blurDownsampling, new GUIContent("Blur Downsampling", "The resolution at which the blur should be performed, see the Downsampling parameter"));
            EditorGUI.indentLevel--;
        }

        EditorGUILayout.LabelField("Distance Cutoff", EditorStyles.boldLabel);
        EditorGUI.indentLevel++;
        EditorGUILayout.PropertyField(p_cutoffDistance, new GUIContent("Max Distance", "Stops applying ambient occlusion for samples over this depth (in world unit)"));
        EditorGUILayout.PropertyField(p_cutoffFalloff, new GUIContent("Falloff", "Starts fading the ambient occlusion X units before the Max Distance has been reached (in world unit)"));
        EditorGUI.indentLevel--;

        p_debugAO.boolValue = GUILayout.Toggle(p_debugAO.boolValue, "Show AO", EditorStyles.miniButton);

        if (GUILayout.Button("About", EditorStyles.miniButton))
        {
            SP_StartupWindow.Init(true);
        }

        serializedObject.ApplyModifiedProperties();
    }
Example #3
0
 public static void MenuInit()
 {
     SP_StartupWindow.Init(true);
 }