docs.unity3d.com
    Show / Hide Table of Contents

    Creating Textures

    You can use the command line tools toktx (comes with KTX-Software) to create KTX v2.0 files and basisu (part of Basis Universal) to create .basis files.

    The default texture orientation of both of those tools (right-down) does not match Unity's orientation (right-up). To counter-act, you can provide a parameter to flip textures in the vertical axis (Y). This is recommended, if you use the textures in Unity only. The parameters are:

    • --lower_left_maps_to_s0t0 for toktx
    • --y_flip for basisu

    Example usage:

    # For KTX files:
    # Create regular KTX file from an input image
    toktx --bcmp regular.ktx2 input.png
    # Create a y-flipped KTX file, fit for Unity out of the box
    toktx --lower_left_maps_to_s0t0 --bcmp unity_flipped.ktx2 input.png
    
    
    # For Basis files:
    # Create regular basis file from an input image
    basisu -output_file regular.basis input.png
    # Create a y-flipped basis file, fit for Unity out of the box
    basisu -y_flip -output_file unity_flipped.basis input.png
    

    If changing the orientation of your texture files is not an option, you can correct it by applying it flipped at run-time (see How To).

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023