-
-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Ocean Depth Cache baked texture size limit #1016
base: master
Are you sure you want to change the base?
Conversation
Texture import settings could restrict size.
e586ae7
to
84783b5
Compare
@@ -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)))); |
There was a problem hiding this comment.
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
will approve anyway so you can pull the trigger, thanks |
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. |
That's fair |
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.