Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

AssetImporter.userData (??) and Custom Texture Metadata

Discussion in 'General Graphics' started by ferretnt, Mar 25, 2021.

  1. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    412
    We have some textures containing signed floating point data that we need to range quantize on WebGL (because signed float textures don't work there.) This should be easy to do if we can just save out the min/max pixel values in the texture that we remap (probably to 0..65536 across 2 channels.)

    However, is there a way in a custom TextureImporter to write that extra metadata saying "here's the range we quantized the texture from?" AssetImporter.userData looks maybe useful but there doesn't seem to be a single example of using it on the entire internet.

    Picking a global range for all textures won't work.

    Any thoughts appreciated.
     
    DaveA_VR likes this.