BABYLON.Color3.FromHexString() / DynamicTexture->getContext->fillStyle...Color values different


For what reason are the color values, which are assigned once with albedoColor by ‘FromHexString ()’ and once in a dynamic texture with fillStyle = …, displayed differently?

Here’s a playground that shows this:


adding @Evgeni_Popov

The color you set in albedoColor is taken “as is”, whereas the albedoTexture is assumed to be in gammaSpace, so have .gammaSpace = true, meaning a conversion to linear space will be applied after being sampled.

If you want the same display, you can either:

1 Like


Thanks for the quick answer and the solution to the problem.

Of course it was just a single line of source code again :roll_eyes:… I spent 2 days looking for the error …