From 15ab4204c8200dab98058da2296f8746ec75f293 Mon Sep 17 00:00:00 2001 From: Dale Eidd Date: Sun, 8 May 2022 15:27:07 -0700 Subject: [PATCH] Fix baked texture size limit Texture import settings could restrict size. --- crest/Assets/Crest/Crest/Scripts/LodData/OceanDepthCache.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crest/Assets/Crest/Crest/Scripts/LodData/OceanDepthCache.cs b/crest/Assets/Crest/Crest/Scripts/LodData/OceanDepthCache.cs index 13285132a..dc8622a4f 100644 --- a/crest/Assets/Crest/Crest/Scripts/LodData/OceanDepthCache.cs +++ b/crest/Assets/Crest/Crest/Scripts/LodData/OceanDepthCache.cs @@ -433,6 +433,8 @@ public override void OnInspectorGUI() ti.wrapMode = TextureWrapMode.Clamp; // Values are slightly different with NPOT Scale applied. ti.npotScale = TextureImporterNPOTScale.None; + // Round up so it encompasses desired resolution. + ti.maxTextureSize = Mathf.RoundToInt(Mathf.Pow(2f, Mathf.Ceil(Mathf.Log(dc._resolution, 2f)))); ti.SaveAndReimport(); Debug.Log("Crest: Cache saved to " + path, AssetDatabase.LoadAssetAtPath(path));