summaryrefslogtreecommitdiffstats
path: root/Scripts
diff options
context:
space:
mode:
Diffstat (limited to 'Scripts')
-rw-r--r--Scripts/Impostors.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Scripts/Impostors.cs b/Scripts/Impostors.cs
index 46e6cd1..a2c205c 100644
--- a/Scripts/Impostors.cs
+++ b/Scripts/Impostors.cs
@@ -1,3 +1,4 @@
+#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
using System.IO;
@@ -355,6 +356,8 @@ public class Impostors : MonoBehaviour
for (int iter = 0; iter < iterations; iter++)
{
+ // Preserve all previously-filled pixels; only write new pixels outside the alpha mask.
+ System.Array.Copy(depth, buffer, depth.Length);
System.Array.Copy(filled, filledNext, filled.Length);
for (int y = 0; y < h; y++)
@@ -547,3 +550,5 @@ public class ImpostorsEditor : Editor
s.ToggleRenderers();
}
}
+#endif // UNITY_EDITOR
+