summaryrefslogtreecommitdiffstats
path: root/Scripts
diff options
context:
space:
mode:
Diffstat (limited to 'Scripts')
-rw-r--r--Scripts/Editor/GenerateNoise.cs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Scripts/Editor/GenerateNoise.cs b/Scripts/Editor/GenerateNoise.cs
index 73a5e20..472d5ff 100644
--- a/Scripts/Editor/GenerateNoise.cs
+++ b/Scripts/Editor/GenerateNoise.cs
@@ -47,11 +47,12 @@ public class GenerateNoise : EditorWindow
int res = _type == NoiseType.WhiteNoise ? _resolution : _resolution * _texelsPerCell;
Texture3D tex;
+ bool makeMipMaps = true;
switch (_type)
{
case NoiseType.WorleyNoise:
{
- tex = new Texture3D(res, res, res, TextureFormat.R8, false);
+ tex = new Texture3D(res, res, res, TextureFormat.R8, makeMipMaps);
GenerateWorleyField(res, _texelsPerCell, _metric, out var f1, out _);
var pixels = new byte[res * res * res];
for (int i = 0; i < pixels.Length; i++)
@@ -61,7 +62,7 @@ public class GenerateNoise : EditorWindow
}
case NoiseType.WorleyEdgeSDF:
{
- tex = new Texture3D(res, res, res, TextureFormat.R8, false);
+ tex = new Texture3D(res, res, res, TextureFormat.R8, makeMipMaps);
GenerateWorleyField(res, _texelsPerCell, _metric, out var f1, out var f2);
var pixels = new byte[res * res * res];
GenerateEdgeSDF(pixels, f2, _sdfRadius);
@@ -70,7 +71,7 @@ public class GenerateNoise : EditorWindow
}
default:
{
- tex = new Texture3D(res, res, res, TextureFormat.RGBA32, false);
+ tex = new Texture3D(res, res, res, TextureFormat.RGB24, makeMipMaps);
var pixels = new Color32[res * res * res];
GenerateWhiteNoise(pixels);
tex.SetPixels32(pixels);
@@ -79,7 +80,7 @@ public class GenerateNoise : EditorWindow
}
tex.wrapMode = TextureWrapMode.Repeat;
- tex.filterMode = FilterMode.Bilinear;
+ tex.filterMode = FilterMode.Trilinear;
tex.Apply();
string name;