[Bf-blender-cvs] [c0981f4a15d] greasepencil-refactor: GPencil: Refactor: Add world ambient lighting

Clément Foucault noreply at git.blender.org
Thu Dec 19 22:39:25 CET 2019


Commit: c0981f4a15d30dd55a13f984c0c3905bf53d52f4
Author: Clément Foucault
Date:   Thu Dec 19 22:38:51 2019 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rBc0981f4a15d30dd55a13f984c0c3905bf53d52f4

GPencil: Refactor: Add world ambient lighting

===================================================================

M	source/blender/draw/engines/gpencil/gpencil_engine.c

===================================================================

diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index b9fc311e809..74591c3d3de 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -321,6 +321,12 @@ static void GPENCIL_engine_init_new(void *ved)
 
   gpencil_light_ambient_add(stl->pd->shadeless_light_pool, (float[3]){1.0f, 1.0f, 1.0f});
 
+  const DRWContextState *ctx = DRW_context_state_get();
+  World *world = ctx->scene->world;
+  if (world != NULL) {
+    gpencil_light_ambient_add(stl->pd->global_light_pool, &world->horr);
+  }
+
   float viewmatinv[4][4];
   DRW_view_viewmat_get(NULL, viewmatinv, true);
   copy_v3_v3(stl->pd->camera_z_axis, viewmatinv[2]);



More information about the Bf-blender-cvs mailing list