Search Unity

Bug Inspector shows Linear RenderTexture in Gamma space?

Discussion in 'General Graphics' started by FissicsPeep, Nov 3, 2022.

  1. FissicsPeep

    FissicsPeep

    Joined:
    Jan 14, 2014
    Posts:
    80
    Hi,

    I have a RenderTexture (created as an asset, not in code). It is the following format:



    So Unity knows it's Linear. My project is linear space. I've not put anything in my shaders for gamma/linear conversions etc. All linear as far as I'm aware at least.

    I was looking into some visual artifacts with one of my shaders used to write to the RenderTexture, and in doing so, simply made it output the basic UV of the RenderTexture. In the frame debugger it looks like this. I highlight where the red (U) value is at the 0.25, 0.5 and 0.75 points in value. This is correct and as I would expected it to be.



    However, in the inspector I see this. This is not what I expect. The UV values are not evenly spaced.



    I was concerned about some post-processing was messing with it, so I disabled all that and also made the shader display a grid, so that if the values were "curved" then the grid would be biased towards the bottom left, but it's not....

    float4 color = float4(frac(uv.x * 16), frac(uv.y * 16), 0, 0);



    So it seems to me that the inspector only is simply displaying a RenderTexture it knows is Linear, in a Linear based project, in Gamma? Is that what's going on here? Is this a known issue?

    It's very frustrating that I can't use the inspector to look at a RenderTexture asset correctly.

    Unity 2021.2.7f1 URP

    Thanks!
     
  2. FissicsPeep

    FissicsPeep

    Joined:
    Jan 14, 2014
    Posts:
    80
    If I look at the object in the scene view, the values are non-linear again! What is going on? Help! :)