Skip to content

Commit

Permalink
Set 256 as texture size for LODs that are not 0
Browse files Browse the repository at this point in the history
  • Loading branch information
dalkia committed Jan 14, 2025
1 parent 2764b3b commit a928f4e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@ private void EnsureTextureFormat()
{
string assetPath = PathUtils.GetRelativePathTo(Application.dataPath, texturePath);
var importer = AssetImporter.GetAtPath(assetPath) as TextureImporter;
var texture = AssetDatabase.LoadAssetAtPath<Texture2D>(assetPath);
if (importer != null)
{
importer.textureType = TextureImporterType.Default;
importer.isReadable = true;
importer.SetPlatformTextureSettings(new TextureImporterPlatformSettings
{
overridden = true, maxTextureSize = texture.width, name = "Standalone", format = TextureImporterFormat.BC7,
//All LODs texture that are not 0 should have 256 as max size
overridden = true, maxTextureSize = 256, name = "Standalone", format = TextureImporterFormat.BC7,
textureCompression = TextureImporterCompression.Compressed
});
AssetDatabase.ImportAsset(assetPath, ImportAssetOptions.ForceUpdate);
Expand Down

0 comments on commit a928f4e

Please sign in to comment.