Search Unity

HDR Textures in Unity only as RGBM?

Discussion in 'General Graphics' started by OlliQueck, Sep 26, 2016.

  1. OlliQueck

    OlliQueck

    Joined:
    Apr 11, 2013
    Posts:
    49
    Is it possible to use full float 32 bit textures in unity as they are? As far as i'm aware unity can only handle HDR Textures encoded as RGBM. But isn't a RGBM encoded texture just some kind of 8 bit Texture with it's alpha channel used in a special way? There is no real extra information in the texture is there?
    I'm working on a Tesselation Shader which needs a very detailed Heightmap and i'm not sure if RGBM is the right approach for that. In my mind it's just a little more information per pixel then a standard 8 bit texture has... so why not use only the red channel and use blue, green and alpha like the Multiplier channel from RGBM textures? To get some kind of RMMM - Texture? i would have to encode them on my own but they would be more precise right?

    best regards
     
  2. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    You can use the channels how ever you like, you can save what ever data you need into a texture and decode it in the shader. Its just that unity does hot have a automated build in way to generate it for you. But you can do the conversion yourself.
    ( im not a export in shader coding and do not know if there are any other limitations that could hinder this approach)
     
  3. OlliQueck

    OlliQueck

    Joined:
    Apr 11, 2013
    Posts:
    49
    i just did that. Built my own encoder that combines 4 heightmaps in one map with each channel(rgba) used for a specific range. Shader decodes it and it works nicely. But i'm still not sure if this is the best approach or if i could just use a texture with a higher bitrate somehow. like a real 32 bit full float texture.