Search Unity

Question How Can i use Compute shader to Read&Write a texture with the data format not 32 bits?

Discussion in 'Shaders' started by KiraSnow, Aug 13, 2022.

  1. KiraSnow

    KiraSnow

    Joined:
    Feb 22, 2021
    Posts:
    21
    i'm trying to reduce the memory cost of texture by change them into smaller format,
    however i found that RWTexture<uint> is for uint32, also it not work on r8.
    in this case i use the smallest scalar RWTexture<half> to process the r8 texture, but it can cause the problem of value truncation.
    how can i read and write the right uint value into r8?
     
    Last edited: Aug 16, 2022