#forced srgb ruining colors

1 messages · Page 1 of 1 (latest)

stone flare
#

is there a way to NOT force my textures as srgb?

#

: source_color seemed to fix it

#

cant wait to color pick it later and find out its still wrong

#

if the hint_normal displays it brighter that means that the scene is being rendered as srgb
is there a way to disable that?

#

if not then this should be a setting
because you cant round trip srgb to linear losslessly

#

you can always make linear look like any other colorspace
why does so much crap force srgb with no option to disable it

narrow meadow
#

Have you looked at the texture's import settings ?

#

Does your environment has gamma correction ?

#

even with an unshaded material, it might still apply gamma correction afterwards

stone flare
#

import settings doesnt have anything for texture color space
and i dont think im doing any gamma stuff since i can get blender to match gimp colors exactly

#

yeah no godot renders in srgb not linear
if you do
ALBEDO = vec3(0.5,0.5,0.5);

then you get
0.851, 0.851, 0.851

#

if i do albedo = 0.5 then i expect to get 0.5 back
not literally more then a quarter more

stone flare
#

oh it gets even fuckier
shader code = 0.5
viewport display = 0.851
game display = 0.737

#

i want to recreate 3ds materials
and i cant do that pixel perfectly if the colors are constantly being hijacked to be srgb

narrow meadow
#

This is the environment post-processing your scene

#

yor spatial shader outputs the right color

#

then the scene environment perform some configurable post processing

#

in the editor there is a togglable default environment to preview meshes with some lighting even if the scene doesn't have lighting

#

yo can toggle it and configure it here

#

with the environment i also have the "incorrect" color :

#

with the environment off i have the right color

#

It's the tonemapping algorithm that seem to be doing that

stone flare
#

🤔

narrow meadow
#

since you have a different value in your in-game scene, check the tonemapping settings of your environment

#

Linear seems good

stone flare
#

the most i can get is 188
in editor and in game

i have those first ones disabled and a worldenvironment node with the tonemap set to linear

#

wonder if this is a 4.5.1 thing

narrow meadow
#

weird

#

i'm in 4.5.1 too

stone flare
#

forward+?

narrow meadow
#

yes, my mesh material is a simple Spatial material with shading mode to Unshaded and albedo to 128,128,128

stone flare
narrow meadow
#

ah yes i reproduce the bug with your shader

stone flare
#

whats the difference?

narrow meadow
#

on the right it's a default spatial material

#

this is mind boggling

#

i understand your frustration

#

it looks like a bug to me because the documentation explicitely says :

#

🤦‍♂️ found it

#

this works

stone flare
#

conversion though
srgb to linear is in most cases ive seen lossy

narrow meadow
#

Maybe you can avoid having ANY post processing effects by setting a custom compositor in the environment

narrow meadow
#

well at least now we understand the issue, good luck finding a workaround.

#

(i wonder if does 2D rendering has the same issue ?)

#

2D rendering seems to be linear, and draws exactly the colors of the texture. Godot converts automatically everything to srgb for 3D

stone flare
#

compatibility mode doesnt do this bs

#

so guess im consigned to using this

surreal dirge
#

I don't know how much this helps, but I had a similar issue with coloring when it comes to GPU particles and its shader. I ended up having to create a gradient texture 1d with the whole thing a solid color of what I desired. I don't know why, but godot really struggles with sRGB conversions.

narrow meadow
#

It makes sense that the compatibility renderer doesn't do it since it uses OpenGL instead of Vulkan.

One of the main developers of Godot explained the behavior in the stackoverflow post i shared previously :

This is intended, since the Vulkan renderer uses bindless textures. sRGB conversion is now done directly when rendering the texture rather than when importing it. This allows using the same texture in both 2D and 3D contexts and having it look correct in both. Likewise, in Godot 4.0, you'll be able to use the same texture with and without filtering without having to make a copy of it.