Page MenuHome

Fix T87348: Convert vertex colors to linear color space.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Apr 12 2021, 8:54 AM.

Details

Summary

This is not really my area of expertise, but it seems like vertex colors are stored in srgb color space, while other colors are in linear color space. This patch changes it so that when a vertex color attribute is accessed, the color space conversion happens automatically.

Cycles seems to be doing the same conversion in triangle_attribute_float4.

Diff Detail

Repository
rB Blender

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Apr 12 2021, 8:54 AM
Jacques Lucke (JacquesLucke) created this revision.

Seems fine.

Would it be an idea to add a role to the Color4f/Color3f classes so the color space becomes more obvious.
If we keep mentioning that colors are just 3 floats, or 4 floats we will always make mistakes.

Color4f<Space::SceneRef, Alpha::Associated> and never allow Color4f or Color3f :-)

This revision is now accepted and ready to land.Apr 12 2021, 9:14 AM

Thanks for the review.
That's an interesting idea. Feel free to give it a try. :)