public void AddOrUpdateLayer(BakedDataIdentifier identifier, string name, int size)
 {
     if (FindLayer(identifier) == null)
     {
         AddLayer(identifier, name, size);
     }
     else
     {
         UpdateLayerSize(identifier, size);
     }
 }
Beispiel #2
0
        public void AddLayer(GameObject gameObject, BakedDataIdentifier identifier, int dataSize)
        {
            var layerInfo = new BakedDataLayerInfo {
            };

            layerInfo.gameObject = gameObject;
            layerInfo.identifier = identifier;
            layerInfo.dataSize   = dataSize;

            mBakedDataLayerInfo.Add(layerInfo);
        }
Beispiel #3
0
        public void RemoveLayer(BakedDataIdentifier identifier)
        {
            var layerInfo = new BakedDataLayerInfo {
            };

            if (FindLayer(identifier, ref layerInfo))
            {
                mBakedDataLayerInfo.Remove(layerInfo);
                UpdateGameObjectStatistics(layerInfo);
            }
        }
        public BakedDataIdentifier GetBakedDataIdentifier()
        {
            var identifier = new BakedDataIdentifier {
            };

            identifier.type      = BakedDataType.Reflections;
            identifier.variation = BakedDataVariation.StaticSource;
            identifier.endpointInfluence.center = Common.ConvertVector(transform.position);
            identifier.endpointInfluence.radius = influenceRadius;
            return(identifier);
        }
 ProbeDataLayerInfo FindLayer(BakedDataIdentifier identifier)
 {
     foreach (var layerInfo in dataLayerInfo)
     {
         if (layerInfo.identifier.identifier == identifier.identifier &&
             layerInfo.identifier.type == identifier.type)
         {
             return(layerInfo);
         }
     }
     return(null);
 }
Beispiel #6
0
        bool FindLayer(BakedDataIdentifier identifier, ref BakedDataLayerInfo result)
        {
            foreach (var layerInfo in mBakedDataLayerInfo)
            {
                if (layerInfo.identifier.Equals(identifier))
                {
                    result = layerInfo;
                    return(true);
                }
            }

            return(false);
        }
Beispiel #7
0
        public void AddOrUpdateLayer(GameObject gameObject, BakedDataIdentifier identifier, int dataSize)
        {
            var layerInfo = new BakedDataLayerInfo {
            };

            if (FindLayer(identifier, ref layerInfo))
            {
                UpdateLayer(identifier, dataSize);
            }
            else
            {
                AddLayer(gameObject, identifier, dataSize);
            }
        }
Beispiel #8
0
        public int GetSizeForLayer(BakedDataIdentifier identifier)
        {
            var layerInfo = new BakedDataLayerInfo {
            };

            if (FindLayer(identifier, ref layerInfo))
            {
                return(layerInfo.dataSize);
            }
            else
            {
                return(0);
            }
        }
Beispiel #9
0
        public void DeleteBakedDataForIdentifier(BakedDataIdentifier identifier)
        {
            if (asset == null)
            {
                return;
            }

            SteamAudioManager.Initialize(ManagerInitReason.EditingProbes);

            var probeBatch = new ProbeBatch(SteamAudioManager.Context, asset);

            probeBatch.RemoveData(identifier);
            probeDataSize = probeBatch.Save(asset);

            SteamAudioManager.ShutDown();
            DestroyImmediate(SteamAudioManager.Singleton.gameObject);

            RemoveLayer(identifier);
        }
Beispiel #10
0
        public void UpdateProbeDataMapping(BakedDataIdentifier identifier, string dataName, int size)
        {
            int index = probeDataIdentifiers.IndexOf(identifier.identifier);

            if (size == -1 && index >= 0)
            {
                probeDataIdentifiers.RemoveAt(index);
                probeDataNames.RemoveAt(index);
                probeDataTypes.RemoveAt(index);
                probeDataNameSizes.RemoveAt(index);
            }
            else if (index == -1)
            {
                probeDataIdentifiers.Add(identifier.identifier);
                probeDataNames.Add(dataName);
                probeDataTypes.Add(identifier.type);
                probeDataNameSizes.Add(size);
            }
            else
            {
                probeDataNameSizes[index] = size;
            }
        }
Beispiel #11
0
 public static extern void iplSetConvolutionEffectIdentifier(IntPtr effect, BakedDataIdentifier identifier);
Beispiel #12
0
 public static extern UIntPtr iplProbeBatchGetDataSize(IntPtr probeBatch, ref BakedDataIdentifier identifier);
Beispiel #13
0
 public static extern void iplDeleteBakedDataByIdentifier(IntPtr probeBox, BakedDataIdentifier identifier);
Beispiel #14
0
 public static extern int iplGetBakedDataSizeByIdentifier(IntPtr probeBox, BakedDataIdentifier identifier);
Beispiel #15
0
 public static extern void iplProbeBatchRemoveData(IntPtr probeBatch, ref BakedDataIdentifier identifier);
Beispiel #16
0
 public static extern void iplBakeStaticListener(IntPtr environment, IntPtr probeBox, Sphere listenerInfluence, BakedDataIdentifier listenerIdentifier, BakingSettings bakingSettings, BakeProgressCallback progressCallback);
 void CacheIdentifier()
 {
     mIdentifier = GetBakedDataIdentifier();
 }
Beispiel #18
0
 public static extern Error iplCreateConvolutionEffect(IntPtr renderer, BakedDataIdentifier identifier, SimulationType simulationType, AudioFormat inputFormat, AudioFormat outputFormat, [In, Out] ref IntPtr effect);
Beispiel #19
0
 public UIntPtr GetDataSize(BakedDataIdentifier identifier)
 {
     return(API.iplProbeBatchGetDataSize(mProbeBatch, ref identifier));
 }
Beispiel #20
0
 public void RemoveData(BakedDataIdentifier identifier)
 {
     API.iplProbeBatchRemoveData(mProbeBatch, ref identifier);
 }
 public void RemoveLayer(BakedDataIdentifier identifier)
 {
     dataLayerInfo.Remove(FindLayer(identifier));
 }
Beispiel #22
0
 public static extern void iplBakePropagation(IntPtr environment, IntPtr probeBox, Sphere sourceInfluence, BakedDataIdentifier sourceIdentifier, BakingSettings bakingSettings, BakeProgressCallback progressCallback);
Beispiel #23
0
        //
        // Draws the inspector GUI.
        //
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            string[] placementStrategyString   = { "Centroid", "Uniform Floor" };
            var      placementStrategyProperty = serializedObject.FindProperty("placementStrategy");
            int      enumValueIndex            = (placementStrategyProperty.enumValueIndex > 0) ? 1 : 0;

            enumValueIndex = EditorGUILayout.Popup("Placement Strategy", enumValueIndex, placementStrategyString);
            placementStrategyProperty.enumValueIndex = (enumValueIndex > 0) ? 2 : 0;

            if (serializedObject.FindProperty("placementStrategy").intValue == (int)ProbePlacementStrategy.Octree)
            {
                EditorGUILayout.PropertyField(serializedObject.FindProperty("maxNumTriangles"));
                EditorGUILayout.PropertyField(serializedObject.FindProperty("maxOctreeDepth"));
            }
            else if (serializedObject.FindProperty("placementStrategy").intValue == (int)ProbePlacementStrategy.UniformFloor)
            {
                EditorGUILayout.PropertyField(serializedObject.FindProperty("horizontalSpacing"));
                EditorGUILayout.PropertyField(serializedObject.FindProperty("heightAboveFloor"));
            }

            SteamAudioProbeBox probeBox = serializedObject.targetObject as SteamAudioProbeBox;

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel(" ");
            if (GUILayout.Button("Generate Probes"))
            {
                probeBox.GenerateProbes();
                EditorSceneManager.MarkSceneDirty(SceneManager.GetActiveScene());
            }
            EditorGUILayout.EndHorizontal();

            if (probeBox.probeSpherePoints != null && probeBox.probeSpherePoints.Length != 0)
            {
                EditorGUILayout.LabelField("Probe Box Statistics", EditorStyles.boldLabel);
                EditorGUILayout.LabelField("Probe Points", (probeBox.probeSpherePoints.Length / 3).ToString());
                EditorGUILayout.LabelField("Probe Data Size", (probeBox.probeBoxData.Length / 1000.0f).ToString("0.0") + " KB");
            }

            for (int i = 0; i < probeBox.probeDataIdentifiers.Count; ++i)
            {
                if (i == 0)
                {
                    EditorGUILayout.LabelField("Detailed Statistics", EditorStyles.boldLabel);
                }

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField(probeBox.probeDataNames[i], (probeBox.probeDataNameSizes[i] / 1000.0f).ToString("0.0") + " KB");
                if (GUILayout.Button("Clear"))
                {
                    var identifier = new BakedDataIdentifier
                    {
                        identifier = probeBox.probeDataIdentifiers[i],
                        type       = probeBox.probeDataTypes[i]
                    };

                    probeBox.DeleteBakedDataByIdentifier(identifier);
                    EditorSceneManager.MarkSceneDirty(SceneManager.GetActiveScene());
                }
                EditorGUILayout.EndHorizontal();
            }

            EditorGUILayout.Space();
            serializedObject.ApplyModifiedProperties();
        }