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

1bit per channel splat texture ?

Discussion in 'Shaders' started by grobonom, Sep 25, 2019.

  1. grobonom

    grobonom

    Joined:
    Jun 23, 2018
    Posts:
    335
    Hi all :)

    does anyone know wether or not it would be possible to ha a 4 bits ( 1 bit for each RGBA channel ) ) splat texture, for modulating 4 textures blending ?

    I know the base answer would be 'yes' ;) but am not sure wether it still is on GPUs....

    And if yes, how could this be achievable in unity ?

    hoping for shader writers answers :D

    best regards and happy unitying !!!
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    Sure. Totally possible... by using a single channel of a RGBA4444 texture using point sampling and bit packing! ... or you know, just use the 4 channels the texture already has.

    If you want to use less than 16 bits, you can get down to 8 bits by using an R8 or A8 using point sampling and bit packing.

    Otherwise, no. GPUs do not support any kind of 1 bit per channel* or single channel 4 bit formats.

    * DXT1A is a now esoteric version of DXT1 with a 1 bit alpha that GPUs still support, but which Unity has never supported. Render textures can also use a RGBA5551 packed format, but that means uploading the data in another format. They both also have 4 channels of data which have 5 bits of color precision each (DXT1 normally stores colors in 565 palettes, but uses a 5551 palette in DXT1A mode) making the whole thing moot. Just use an RGBA4444.
     
    pitibonom likes this.