I need to get worldPosition inside my shader, to compare with other custom inputs. The world position seems good, but in fact it’s weird !! I explain :
This is a quad, size 1x1, I apply a simple shader on it :
o.Albedo = IN.worldPos.x;
My problem : I expected to have a more linear gradient. Like that (done in photoshop)
I precise that I have no light, just an ambiant to (1.0, 1.0, 1.0)
Am I crazy?
Sorry for the potential thread hijack, but does this mean that the value of worldPos.x is truly handled differently in linear space in comparison to gamma? does anyone happen to have encountered this issue before?
Just wanted to try and understand the cause of this, it could perhaps have it’s practical uses, but the behaviour just seems odd to me
From the shader’s perspective, no it isn’t. It will looks like it’s affected, but that’s because you’re viewing the results which are altered after computation by the gamma correction or lack thereof.
For example, if you used worldposition x and y for UV coordinates, you wouldn’t get texture stretching and relaxing when switching between linear and gamma, despite the perceived differences in value when viewing the raw worldposition values in Unity.