I built a custom raymarching shader for a smoke effect which looks fine (with little artifacts) in the legacy RP:
But in URP it has extreme color bending artifacts:
I first thought it was connected to the color space as switching to Gamma space in URP reduces the problem a bit but switching to Linear in the lagacy pipeline didnt make it any worse.
Side question: Does anybody know in which color space 3D textures are being stored or if it can be manually set anywhere?
I am using R8_UNorm 3D textures btw.
Why does the same shader that works in lRP produce these artifacts URP?
About your side question: I think Texture3D is linear and if you set your pixels when project is in Linear mode, they would be linear. I’m not sure though. But as there’s no color space flag like Texture2D has, it’s hard to know. Documentation doesn’t say anything about that either. Anyway, if someone knows better I’d be interested to know too.
Btw, I imagine you would be using RenderTexture3D if you’re rendering some raymarched things to textures?
The 2D texture in linear space has the sRGB flag set. Otherwise it looks like the right (3D) one.
I guess unity automatically saves PNGs in sRGB?
If that is true it seems like the 3D textures are stored in sRGB too which would be a problem.
Yes but its the other way around. I am raymarching through a 3D texture which has been generated from a noise shader.
And I am aware that these artifacts might be caused by the marching steps but then again it doesnt make sense that there is a difference between lRP and URP with the same stap count (which is 128 btw)