Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-09-18 23:18:49 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-09-18 23:18:49 +0300
commit93780411e9149b7acdd89e97457832f887a7c34f (patch)
treec99e1c8e5873996642f8f62349d60da40e5d7ecb /source/blender/draw/engines/eevee/eevee_lookdev.c
parent629c6a87693a8aebb87e74c5c782bddce6b613ef (diff)
LookDev: Use theme background instead of world color
This is much less confusing than relying on an hidden parameter (the world color) that you can only see if you disable the world node tree.
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_lookdev.c')
-rw-r--r--source/blender/draw/engines/eevee/eevee_lookdev.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lookdev.c b/source/blender/draw/engines/eevee/eevee_lookdev.c
index 5c12eac4ac1..49cf468711e 100644
--- a/source/blender/draw/engines/eevee/eevee_lookdev.c
+++ b/source/blender/draw/engines/eevee/eevee_lookdev.c
@@ -34,9 +34,13 @@
#include "ED_screen.h"
+#include "UI_resources.h"
+
#include "eevee_private.h"
#include "eevee_lightcache.h"
+#include "draw_common.h"
+
static void eevee_lookdev_lightcache_delete(EEVEE_Data *vedata)
{
EEVEE_StorageList *stl = vedata->stl;
@@ -51,7 +55,7 @@ static void eevee_lookdev_lightcache_delete(EEVEE_Data *vedata)
void EEVEE_lookdev_cache_init(
EEVEE_Data *vedata, DRWShadingGroup **grp, GPUShader *shader, DRWPass *pass,
- World *world, EEVEE_LightProbesInfo *pinfo)
+ World *UNUSED(world), EEVEE_LightProbesInfo *pinfo)
{
EEVEE_StorageList *stl = vedata->stl;
EEVEE_TextureList *txl = vedata->txl;
@@ -103,17 +107,17 @@ void EEVEE_lookdev_cache_init(
stl->g_data->light_cache = stl->lookdev_lightcache;
+ static float background_color[4];
+ UI_GetThemeColor4fv(TH_HIGH_GRAD, background_color);
+ /* XXX: Really quick conversion to avoid washed out background.
+ * Needs to be addressed properly (color managed using ocio). */
+ srgb_to_linearrgb_v4(background_color, background_color);
+
*grp = DRW_shgroup_create(shader, pass);
axis_angle_to_mat3_single(stl->g_data->studiolight_matrix, 'Z', v3d->shading.studiolight_rot_z);
DRW_shgroup_uniform_mat3(*grp, "StudioLightMatrix", stl->g_data->studiolight_matrix);
-
- if (world) {
- DRW_shgroup_uniform_vec3(*grp, "color", &world->horr, 1);
- } else {
- static float col[4] = {0.0f};
- DRW_shgroup_uniform_vec3(*grp, "color", col, 1);
- }
DRW_shgroup_uniform_float(*grp, "backgroundAlpha", &stl->g_data->background_alpha, 1);
+ DRW_shgroup_uniform_vec3(*grp, "color", background_color, 1);
DRW_shgroup_call_add(*grp, geom, NULL);
if (!pinfo) {
/* Do not fadeout when doing probe rendering, only when drawing the background */