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

Allow to keep Texture2D as read-write enabled #17

Open
der-hugo opened this issue Jan 9, 2023 · 0 comments
Open

Allow to keep Texture2D as read-write enabled #17

der-hugo opened this issue Jan 9, 2023 · 0 comments

Comments

@der-hugo
Copy link

der-hugo commented Jan 9, 2023

See https://stackoverflow.com/questions/75050788/how-to-create-webp-image-file-from-url-in-unity/75056837#75056837

In CreateTexture2DFromWebP you are using

lTexture2D.Apply(lMipmaps, true);

which prevents later read/write on that texture.

You could have a parameter

public static unsafe Texture2D CreateTexture2DFromWebP(byte[] lData, bool lMipmaps, bool lLinear, out Error lError, bool isReadWriteEnabled = false, ScalingFunction scalingFunction = null )

and then use

lTexture2D.Apply(lMipmaps, !isReadWriteEnabled);

so users can still keep it enabled if they want/need to.

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