#ECS Objects have their colors "washed out"

1 messages · Page 1 of 1 (latest)

jagged ridge
#

Objects created with ECS that have their material's color properties modified appear washed out or severely brightened compared to their GameObject equivalents, despite using the same material.

#

PLEASE NOTE: the water in the after image has not had its color assigned yet, only the land portions, which have the same color values in r g b and a.

glossy zenith
#

can't say i've seen this, what srp, type of shader
what about lighting in scene (baked?)
post processing?

#

ok that image you just added is very different

jagged ridge
#

I'm using the Universal RP, the shader is the regular (Universal Render Pipeline / Lit) default shader, and the lighting in the scene is not baked. I've toggled post processing on and off and the effect is the same

glossy zenith
#

the colors are completely different

#

linear colour space right?

jagged ridge
#

Yup! As for the colors, I was porting the logic over one piece at a time, so once I had realized that the "Land" colors were not the same, I stopped before implementing the "Water"

#

Here, if you'll allow me a moment i will apply the water too so that the grayscale is less distracting

glossy zenith
#

can you render them literally side by side in the same scene?

#

just 1 in a susbcene, 1 outside it

jagged ridge
#

you got it chief one sec pls

glossy zenith
#

pretty clear cut

#

any chance you're able to upload just this?

jagged ridge
#

Currently, I am setting the value of the "URPMaterialBaseColor" component to a float4(from the r g b a values of a color- the same color as the gameObject variant), But I also tried using my own MaterialProperty Component to the same effect

glossy zenith
#

i'd be curious to have a look

#

oh ok so wait, you're using URPMaterialBaseColor to colour this?

#

it's just not on the material

jagged ridge
#

Yes, I am using the component, though when I tried creating my own shader with an exposed property and assigning the value through there, the result was exactly the same.

glossy zenith
#

how are you getting the rgb values to apply to the URPMaterialBaseColor component?

jagged ridge
glossy zenith
#

can you just try math.pow(returnValue, 2.2f)

jagged ridge
#

oh man i sure can

glossy zenith
#

might be opposite actually might need
math.pow(returnValue, 1/2.2f)

#

i can never remember

jagged ridge
#

OH MY GOD THE FIRST ONE WORKED!!

#

Thank you so much!!!!

glossy zenith
#

yeah you have a gamma vs linear colour space issue

#

this is the conversion between the spaces

jagged ridge
#

Oh man, I thought I had checked that the color space was set to linear in the player settings

glossy zenith
#

whatever your 'basecolor', is in gamma space

Gamma To Linear
255 * POWER(gammavalue / 255,2.2)

glossy zenith
#

but your basecolor is in gamma space

#

by doing power 2.2 you are converting it to linear

jagged ridge
#

well dang aren't I just a big fat dummy notlikethis

#

Thank you so much for your help!

glossy zenith
#

oh trust me, anyone who has dealt with color has run into this

#

ideally your raw data would be in linear not gamma but yeah anyway at least you know the problem so can figure it out from here

jagged ridge
#

Absolutely! I'll get right on that 🫡