[Bf-blender-cvs] [c02e7647229] blender2.8-workbench: Workbench: update light direction uniform
Jeroen Bakker
noreply at git.blender.org
Tue May 1 11:06:48 CEST 2018
Commit: c02e7647229ff14c661d2479cbb86687b0736a5a
Author: Jeroen Bakker
Date: Tue May 1 11:06:09 2018 +0200
Branches: blender2.8-workbench
https://developer.blender.org/rBc02e7647229ff14c661d2479cbb86687b0736a5a
Workbench: update light direction uniform
- still need to check a usable UI for the light direction
===================================================================
M source/blender/draw/engines/workbench/workbench_materials.c
===================================================================
diff --git a/source/blender/draw/engines/workbench/workbench_materials.c b/source/blender/draw/engines/workbench/workbench_materials.c
index c3e97207515..4a26e33e480 100644
--- a/source/blender/draw/engines/workbench/workbench_materials.c
+++ b/source/blender/draw/engines/workbench/workbench_materials.c
@@ -309,6 +309,7 @@ void workbench_materials_cache_init(WORKBENCH_Data *vedata)
DRW_uniformbuffer_update(wpd->world_ubo, &wpd->world_data);
copy_v3_v3(e_data.light_direction, BKE_collection_engine_property_value_get_float_array(props, "light_direction"));
+ invert_v3(e_data.light_direction);
psl->composite_pass = DRW_pass_create("Composite", DRW_STATE_WRITE_COLOR | DRW_STATE_STENCIL_EQUAL);
grp = DRW_shgroup_create(wpd->composite_sh, psl->composite_pass);
@@ -320,7 +321,7 @@ void workbench_materials_cache_init(WORKBENCH_Data *vedata)
if (SHADOW_ENABLED(wpd)) {
psl->shadow_pass = DRW_pass_create("Shadow", DRW_STATE_DEPTH_LESS | DRW_STATE_WRITE_STENCIL | DRW_STATE_STENCIL_INCR_DECR_WRAP);
grp = DRW_shgroup_create(e_data.shadow_sh, psl->shadow_pass);
- DRW_shgroup_uniform_float(grp, "lightDirection", e_data.light_direction, 3);
+ DRW_shgroup_uniform_vec3(grp, "lightDirection", e_data.light_direction, 1);
DRW_shgroup_stencil_mask(grp, 0xFF);
wpd->shadow_shgrp = grp;
More information about the Bf-blender-cvs
mailing list