Skip to content
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

QualitySettings.masterTextureLimit preventing Importer from working correctly #4

Open
ghost opened this issue Dec 5, 2021 · 4 comments

Comments

@ghost
Copy link

ghost commented Dec 5, 2021

https://docs.unity3d.com/ScriptReference/QualitySettings-masterTextureLimit.html

The above setting changes which mipmap Unity uses for a texture. While it affects Texture2D, it does not affect Texture2DArray. I am posting the error and my quick-fix solution. This fix is trivial and I do not know if there is a better way to approach this. Posting screenshots of the error and the fix.
Screenshot_1
Screenshot_2

@pschraut
Copy link
Owner

pschraut commented Dec 6, 2021

Thank you!

@ghost
Copy link
Author

ghost commented Dec 6, 2021

No problem. Currently this solution makes it so the resulting Texture2DArray always uses mip 0. Unity does say QualitySettings.masterTextureLimit does not affect Texture Arrays, so I'm certain this solution is incorrect, since it does not copy all the mips. As per the manual, here's what it says on Copy Texture:
Screenshot_5

Then again, changing the masterTextureLimit should yield no effect even if all the mips are loaded correctly, unless the importer somehow uses it. I believe this is the last step in order to complete the importer.

@pschraut
Copy link
Owner

Thank you again for the report and additional information. I submitted a bug-report to Unity Technologies (logged as Case 1393786). I'll update this thread here if I hear back from Unity.

@pschraut
Copy link
Owner

pschraut commented Feb 6, 2022

Unity Technologies replied to bug-report 1393786 with:

After reaching out to the developers about this issue, here is what I've gathered: using masterTextureLimit to copy from Texture2D to Texture2DArray was never supported, but error reporting on this has changed. In the past, CopyTexture was quiet about this and just didn't do the copy. What might help here is to use the region copy overload of CopyTexture. That overload does take into account masterTextureLimit in a specific way. The Documentation describes this here: https://docs.unity3d.com/2022.1/Documentation/ScriptReference/Graphics.CopyTexture.html

As far as I understand the documentation, it doesn't sound to me that it would fix the problem that's described here.

When masterTextureLimit is used, the "copy region" command would copy the lower-mipmaps into the Texture2DArray, but what's actually expected is that it should copy the texture as no masterTextureLimit is used.

It seems there is currently no solution to resolve this issue. The only solution seems to use no masterTextureLimit at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant