Page MenuHome

Fix T37670: Paint mode + procedural map colours error
ClosedPublic

Authored by Sergey Sharybin (sergey) on Dec 2 2013, 10:46 AM.

Details

Summary

Seems to be known TODO in the code, but no idea why it
was never solved, especially since tweak is so much easy.

It might be arguable that we need to support painting
color space, but it's still much better to convert to
sRGB space. It's gonna to cover 90% of cases anyway.

Diff Detail

Branch
proj_paint_colorspace

Event Timeline

Sergey Sharybin (sergey) updated this revision to Unknown Object (????).Dec 2 2013, 12:37 PM

And for sure previous patch wasn't correct

multitex() doesn't ensure TexRes is in linear space,
so need to do extra checks in paint code.

Brecht Van Lommel (brecht) requested changes to this revision.Dec 2 2013, 3:10 PM

2D painting still has the same problem, so perhaps this isn't the right level to fix this problem? If this checking of imbuf rect_float is needed, that could at least be moved to some kind of utility function, that returns if sampling the texture will return linear or srgb colors.

Sergey Sharybin (sergey) updated this revision to Unknown Object (????).Dec 3 2013, 10:33 AM

Both 2d and projeciton painting works fine now.

This looks good to me, except for float painting in 2D. Accepting revision assuming you agree with the fix there.

source/blender/editors/sculpt_paint/paint_image_2d.c
278 ↗(On Diff #195)

This should check with if(!use_float) so this conversion does not happen when painting on linear float images.

367 ↗(On Diff #195)

Same here.

Added missing checks and landed the change. Thanks for the review!