Skip to content

Allow to keep Texture2D as read-write enabled #17

Description

@der-hugo

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions