EEVEE: LookDev reversed the background fadeout
This commit is contained in:
@@ -3549,7 +3549,7 @@ class VIEW3D_PT_shading(Panel):
|
||||
col.row().template_icon_view(shading, "studio_light")
|
||||
if shading.studio_light_orientation == 'WORLD':
|
||||
col.row().prop(shading, "studiolight_rot_z")
|
||||
col.row().prop(shading, "studiolight_fadeout")
|
||||
col.row().prop(shading, "studiolight_background")
|
||||
col.row().prop(shading, "use_scene_light")
|
||||
|
||||
|
||||
|
||||
@@ -54,6 +54,10 @@ void EEVEE_lookdev_cache_init(EEVEE_Data *vedata, DRWShadingGroup **grp, GPUShad
|
||||
DRW_shgroup_uniform_vec3(*grp, "color", &world->horr, 1);
|
||||
DRW_shgroup_uniform_float(*grp, "backgroundAlpha", &stl->g_data->background_alpha, 1);
|
||||
DRW_shgroup_call_add(*grp, geom, NULL);
|
||||
if (!pinfo) {
|
||||
/* Do not fadeout when doing probe rendering, only when drawing the background */
|
||||
DRW_shgroup_uniform_float(*grp, "studioLightBackground", &v3d->shading.studiolight_background, 1);
|
||||
}
|
||||
|
||||
/* Do we need to recalc the lightprobes? */
|
||||
if (pinfo && (pinfo->studiolight_index != sl->index || pinfo->studiolight_rot_z != v3d->shading.studiolight_rot_z)) {
|
||||
@@ -63,10 +67,6 @@ void EEVEE_lookdev_cache_init(EEVEE_Data *vedata, DRWShadingGroup **grp, GPUShad
|
||||
pinfo->prev_wo_sh_compiled = false;
|
||||
pinfo->prev_world = NULL;
|
||||
}
|
||||
else {
|
||||
/* Do not fadeout when doing probe rendering, only when drawing the background */
|
||||
DRW_shgroup_uniform_float(*grp, "studioLightFadeout", &v3d->shading.studiolight_fadeout, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ uniform mat4 ViewMatrixInverse;
|
||||
#ifdef LOOKDEV
|
||||
uniform mat3 StudioLightMatrix;
|
||||
uniform sampler2D image;
|
||||
uniform float studioLightFadeout = 0.0;
|
||||
uniform float studioLightBackground = 1.0;
|
||||
in vec3 viewPosition;
|
||||
#endif
|
||||
uniform vec3 color;
|
||||
@@ -51,7 +51,7 @@ void main() {
|
||||
vec4 background_color;
|
||||
background_transform_to_world(viewPosition, worldvec);
|
||||
node_tex_environment_equirectangular(StudioLightMatrix * worldvec, image, background_color);
|
||||
background_color.rgb = mix(background_color.rgb, color, studioLightFadeout);
|
||||
background_color.rgb = mix(color, background_color.rgb, studioLightBackground);
|
||||
#else
|
||||
vec3 background_color = color;
|
||||
#endif
|
||||
|
||||
@@ -145,7 +145,7 @@ typedef struct View3DShading {
|
||||
float single_color[3];
|
||||
|
||||
float studiolight_rot_z;
|
||||
float studiolight_fadeout;
|
||||
float studiolight_background;
|
||||
|
||||
float object_outline_color[3];
|
||||
float pad3;
|
||||
|
||||
@@ -2358,10 +2358,10 @@ static void rna_def_space_view3d_shading(BlenderRNA *brna)
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
|
||||
|
||||
prop = RNA_def_property(srna, "studiolight_fadeout", PROP_FLOAT, PROP_FACTOR);
|
||||
RNA_def_property_float_sdna(prop, NULL, "shading.studiolight_fadeout");
|
||||
prop = RNA_def_property(srna, "studiolight_background", PROP_FLOAT, PROP_FACTOR);
|
||||
RNA_def_property_float_sdna(prop, NULL, "shading.studiolight_background");
|
||||
RNA_def_property_float_default(prop, 0.0);
|
||||
RNA_def_property_ui_text(prop, "Fadeout Background", "Fadeout the background rendering of the studiolight");
|
||||
RNA_def_property_ui_text(prop, "Show Background", "Show the studiolight in the background");
|
||||
RNA_def_property_range(prop, 0.0f, 1.0f);
|
||||
RNA_def_property_ui_range(prop, 0.00f, 1.0f, 1, 3);
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||
|
||||
Reference in New Issue
Block a user