Skip to content

Conversation

@magenta404
Copy link
Collaborator

Texture import settings can limit the baked texture size. If users specify a resolution in ODC UI, then they would expect the bake to be the same I think. Reported on Discord that baked texture was limited to 2K.

@magenta404 magenta404 added the Bug label May 8, 2022
@magenta404 magenta404 added this to the 4.15.2 milestone May 8, 2022
@magenta404 magenta404 requested a review from huwb May 8, 2022 22:34
magenta404 added 2 commits May 8, 2022 15:35
Texture import settings could restrict size.
@magenta404 magenta404 force-pushed the fix/max-baked-tex-res branch from e586ae7 to 84783b5 Compare May 8, 2022 22:35
// 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))));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be worth using max(dc._resolution, 1) . i'm not sure if it could ever be 0 in any situation but log() will go haywire if it is

@huwb
Copy link
Contributor

huwb commented May 8, 2022

will approve anyway so you can pull the trigger, thanks

@magenta404
Copy link
Collaborator Author

Going to defer this one for now. This will fight against the Unity preset system and developers can always do it themselves. Validation could work, but will have to think more about it.

@huwb
Copy link
Contributor

huwb commented May 10, 2022

That's fair

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants