Commit: 19d04ce349680c14f830a89950852271d1c09fc3 Author: Clément Foucault Date: Tue Feb 11 18:57:41 2020 +0100 Branches: greasepencil-refactor https://developer.blender.org/rB19d04ce349680c14f830a89950852271d1c09fc3
GPencil: Refactor: Remove the hardcoded sRGB final transform for viewport Now viewport and render has the same look and colormanagement applied to it =================================================================== M source/blender/draw/engines/gpencil/gpencil_engine.c M source/blender/draw/engines/gpencil/shaders/gpencil_composite_frag.glsl =================================================================== diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c index 5c69a956d75..b646ee5829f 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.c +++ b/source/blender/draw/engines/gpencil/gpencil_engine.c @@ -275,7 +275,6 @@ void GPENCIL_cache_init(void *ved) grp = DRW_shgroup_create(sh, psl->composite_ps); DRW_shgroup_uniform_texture_ref(grp, "colorBuf", &pd->color_tx); DRW_shgroup_uniform_texture_ref(grp, "revealBuf", &pd->reveal_tx); - DRW_shgroup_uniform_bool_copy(grp, "doSrgb", txl->render_depth_tx == NULL); DRW_shgroup_call_procedural_triangles(grp, NULL, 1); } { diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_composite_frag.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_composite_frag.glsl index bc283952322..7ac992e046d 100644 --- a/source/blender/draw/engines/gpencil/shaders/gpencil_composite_frag.glsl +++ b/source/blender/draw/engines/gpencil/shaders/gpencil_composite_frag.glsl @@ -1,7 +1,6 @@ uniform sampler2D colorBuf; uniform sampler2D revealBuf; -uniform bool doSrgb; in vec4 uvcoordsvar; @@ -9,17 +8,6 @@ in vec4 uvcoordsvar; layout(location = 0, index = 0) out vec4 fragColor; layout(location = 0, index = 1) out vec4 fragRevealage; -/* TODO Remove. */ -float linearrgb_to_srgb(float c) -{ - if (c < 0.0031308) { - return (c < 0.0) ? 0.0 : c * 12.92; - } - else { - return 1.055 * pow(c, 1.0 / 2.4) - 0.055; - } -} - void main() { /* Revealage, how much light passes through. */ @@ -30,12 +18,4 @@ void main() fragColor.rgb = textureLod(colorBuf, uvcoordsvar.xy, 0.0).rgb; /* Add the alpha. */ fragColor.a = 1.0 - fragRevealage.a; - - if (doSrgb) { - /* Temporary srgb conversion. - * TODO do color management / tonemapping here. */ - fragColor.r = linearrgb_to_srgb(fragColor.r); - fragColor.g = linearrgb_to_srgb(fragColor.g); - fragColor.b = linearrgb_to_srgb(fragColor.b); - } } _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs