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:
-rw-r--r--release/scripts/startup/bl_ui/properties_data_lightprobe.py28
-rw-r--r--source/blender/blenkernel/intern/lightprobe.c1
-rw-r--r--source/blender/blenloader/intern/versioning_280.c8
-rw-r--r--source/blender/draw/engines/eevee/eevee_lightprobes.c62
-rw-r--r--source/blender/draw/engines/eevee/eevee_private.h1
-rw-r--r--source/blender/draw/engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl3
-rw-r--r--source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl3
-rw-r--r--source/blender/makesdna/DNA_lightprobe_types.h4
-rw-r--r--source/blender/makesrna/intern/rna_lightprobe.c7
9 files changed, 74 insertions, 43 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_lightprobe.py b/release/scripts/startup/bl_ui/properties_data_lightprobe.py
index f839c804857..e01ca88b587 100644
--- a/release/scripts/startup/bl_ui/properties_data_lightprobe.py
+++ b/release/scripts/startup/bl_ui/properties_data_lightprobe.py
@@ -64,30 +64,22 @@ class DATA_PT_lightprobe(DataButtonsPanel, Panel):
if probe.type == 'GRID':
col = split.column(align=True)
- col.label("Resolution:")
- col.prop(probe, "grid_resolution_x", text="X")
- col.prop(probe, "grid_resolution_y", text="Y")
- col.prop(probe, "grid_resolution_z", text="Z")
-
- col.separator()
-
col.label("Influence:")
col.prop(probe, "influence_distance", "Distance")
col.prop(probe, "falloff")
+ col.prop(probe, "intensity")
col.separator()
- col.label("Visibily:")
- col.prop(probe, "visibility_buffer_bias", "Bias")
- col.prop(probe, "visibility_bleed_bias", "Bleed Bias")
- col.prop(probe, "visibility_blur", "Blur")
-
+ col.label("Resolution:")
+ col.prop(probe, "grid_resolution_x", text="X")
+ col.prop(probe, "grid_resolution_y", text="Y")
+ col.prop(probe, "grid_resolution_z", text="Z")
elif probe.type == 'PLANAR':
col = split.column(align=True)
col.label("Influence:")
col.prop(probe, "influence_distance", "Distance")
col.prop(probe, "falloff")
-
else:
col = split.column(align=True)
col.label("Influence:")
@@ -99,14 +91,24 @@ class DATA_PT_lightprobe(DataButtonsPanel, Panel):
col.prop(probe, "influence_distance", "Size")
col.prop(probe, "falloff")
+ col.prop(probe, "intensity")
col = split.column(align=True)
+
col.label("Clipping:")
col.prop(probe, "clip_start", text="Start")
if probe.type != "PLANAR":
col.prop(probe, "clip_end", text="End")
+ if probe.type == 'GRID':
+ col.separator()
+
+ col.label("Visibily:")
+ col.prop(probe, "visibility_buffer_bias", "Bias")
+ col.prop(probe, "visibility_bleed_bias", "Bleed Bias")
+ col.prop(probe, "visibility_blur", "Blur")
+
class DATA_PT_lightprobe_parallax(DataButtonsPanel, Panel):
bl_label = "Parallax"
diff --git a/source/blender/blenkernel/intern/lightprobe.c b/source/blender/blenkernel/intern/lightprobe.c
index d5dbbe873a2..057b6aaaf65 100644
--- a/source/blender/blenkernel/intern/lightprobe.c
+++ b/source/blender/blenkernel/intern/lightprobe.c
@@ -52,6 +52,7 @@ void BKE_lightprobe_init(LightProbe *probe)
probe->clipend = 40.0f;
probe->vis_bias = 1.0f;
probe->vis_blur = 0.2f;
+ probe->intensity = 1.0f;
probe->data_draw_size = 1.0f;
probe->flag = LIGHTPROBE_FLAG_SHOW_INFLUENCE | LIGHTPROBE_FLAG_SHOW_DATA;
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index b5530d90330..2f07ca43ff0 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -915,4 +915,12 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
}
+
+ {
+ if (!DNA_struct_elem_find(fd->filesdna, "LightProbe", "float", "intensity")) {
+ for (LightProbe *probe = main->lightprobe.first; probe; probe = probe->id.next) {
+ probe->intensity = 1.0f;
+ }
+ }
+ }
}
diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c
index d9ee749d4d6..7403da737dd 100644
--- a/source/blender/draw/engines/eevee/eevee_lightprobes.c
+++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c
@@ -436,14 +436,15 @@ void EEVEE_lightprobes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedat
struct Gwn_Batch *geom = DRW_cache_fullscreen_quad_get();
DRWShadingGroup *grp = DRW_shgroup_instance_create(e_data.probe_filter_glossy_sh, psl->probe_glossy_compute, geom);
- DRW_shgroup_uniform_float(grp, "sampleCount", &sldata->probes->samples_ct, 1);
- DRW_shgroup_uniform_float(grp, "invSampleCount", &sldata->probes->invsamples_ct, 1);
- DRW_shgroup_uniform_float(grp, "roughnessSquared", &sldata->probes->roughness, 1);
- DRW_shgroup_uniform_float(grp, "lodFactor", &sldata->probes->lodfactor, 1);
- DRW_shgroup_uniform_float(grp, "lodMax", &sldata->probes->lod_rt_max, 1);
- DRW_shgroup_uniform_float(grp, "texelSize", &sldata->probes->texel_size, 1);
- DRW_shgroup_uniform_float(grp, "paddingSize", &sldata->probes->padding_size, 1);
- DRW_shgroup_uniform_int(grp, "Layer", &sldata->probes->layer, 1);
+ DRW_shgroup_uniform_float(grp, "intensityFac", &pinfo->intensity_fac, 1);
+ DRW_shgroup_uniform_float(grp, "sampleCount", &pinfo->samples_ct, 1);
+ DRW_shgroup_uniform_float(grp, "invSampleCount", &pinfo->invsamples_ct, 1);
+ DRW_shgroup_uniform_float(grp, "roughnessSquared", &pinfo->roughness, 1);
+ DRW_shgroup_uniform_float(grp, "lodFactor", &pinfo->lodfactor, 1);
+ DRW_shgroup_uniform_float(grp, "lodMax", &pinfo->lod_rt_max, 1);
+ DRW_shgroup_uniform_float(grp, "texelSize", &pinfo->texel_size, 1);
+ DRW_shgroup_uniform_float(grp, "paddingSize", &pinfo->padding_size, 1);
+ DRW_shgroup_uniform_int(grp, "Layer", &pinfo->layer, 1);
DRW_shgroup_uniform_texture(grp, "texHammersley", e_data.hammersley);
// DRW_shgroup_uniform_texture(grp, "texJitter", e_data.jitter);
DRW_shgroup_uniform_texture(grp, "probeHdr", sldata->probe_rt);
@@ -456,14 +457,15 @@ void EEVEE_lightprobes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedat
DRWShadingGroup *grp = DRW_shgroup_create(e_data.probe_filter_diffuse_sh, psl->probe_diffuse_compute);
#ifdef IRRADIANCE_SH_L2
- DRW_shgroup_uniform_int(grp, "probeSize", &sldata->probes->shres, 1);
+ DRW_shgroup_uniform_int(grp, "probeSize", &pinfo->shres, 1);
#else
- DRW_shgroup_uniform_float(grp, "sampleCount", &sldata->probes->samples_ct, 1);
- DRW_shgroup_uniform_float(grp, "invSampleCount", &sldata->probes->invsamples_ct, 1);
- DRW_shgroup_uniform_float(grp, "lodFactor", &sldata->probes->lodfactor, 1);
- DRW_shgroup_uniform_float(grp, "lodMax", &sldata->probes->lod_rt_max, 1);
+ DRW_shgroup_uniform_float(grp, "sampleCount", &pinfo->samples_ct, 1);
+ DRW_shgroup_uniform_float(grp, "invSampleCount", &pinfo->invsamples_ct, 1);
+ DRW_shgroup_uniform_float(grp, "lodFactor", &pinfo->lodfactor, 1);
+ DRW_shgroup_uniform_float(grp, "lodMax", &pinfo->lod_rt_max, 1);
DRW_shgroup_uniform_texture(grp, "texHammersley", e_data.hammersley);
#endif
+ DRW_shgroup_uniform_float(grp, "intensityFac", &pinfo->intensity_fac, 1);
DRW_shgroup_uniform_texture(grp, "probeHdr", sldata->probe_rt);
struct Gwn_Batch *geom = DRW_cache_fullscreen_quad_get();
@@ -474,14 +476,14 @@ void EEVEE_lightprobes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedat
psl->probe_visibility_compute = DRW_pass_create("LightProbe Visibility Compute", DRW_STATE_WRITE_COLOR);
DRWShadingGroup *grp = DRW_shgroup_create(e_data.probe_filter_visibility_sh, psl->probe_visibility_compute);
- DRW_shgroup_uniform_int(grp, "outputSize", &sldata->probes->shres, 1);
- DRW_shgroup_uniform_float(grp, "visibilityRange", &sldata->probes->visibility_range, 1);
- DRW_shgroup_uniform_float(grp, "visibilityBlur", &sldata->probes->visibility_blur, 1);
- DRW_shgroup_uniform_float(grp, "sampleCount", &sldata->probes->samples_ct, 1);
- DRW_shgroup_uniform_float(grp, "invSampleCount", &sldata->probes->invsamples_ct, 1);
- DRW_shgroup_uniform_float(grp, "storedTexelSize", &sldata->probes->texel_size, 1);
- DRW_shgroup_uniform_float(grp, "nearClip", &sldata->probes->near_clip, 1);
- DRW_shgroup_uniform_float(grp, "farClip", &sldata->probes->far_clip, 1);
+ DRW_shgroup_uniform_int(grp, "outputSize", &pinfo->shres, 1);
+ DRW_shgroup_uniform_float(grp, "visibilityRange", &pinfo->visibility_range, 1);
+ DRW_shgroup_uniform_float(grp, "visibilityBlur", &pinfo->visibility_blur, 1);
+ DRW_shgroup_uniform_float(grp, "sampleCount", &pinfo->samples_ct, 1);
+ DRW_shgroup_uniform_float(grp, "invSampleCount", &pinfo->invsamples_ct, 1);
+ DRW_shgroup_uniform_float(grp, "storedTexelSize", &pinfo->texel_size, 1);
+ DRW_shgroup_uniform_float(grp, "nearClip", &pinfo->near_clip, 1);
+ DRW_shgroup_uniform_float(grp, "farClip", &pinfo->far_clip, 1);
DRW_shgroup_uniform_texture(grp, "texHammersley", e_data.hammersley);
DRW_shgroup_uniform_texture(grp, "probeDepth", sldata->probe_depth_rt);
@@ -961,10 +963,13 @@ static void downsample_planar(void *vedata, int level)
}
/* Glossy filter probe_rt to probe_pool at index probe_idx */
-static void glossy_filter_probe(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, EEVEE_PassList *psl, int probe_idx)
+static void glossy_filter_probe(
+ EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, EEVEE_PassList *psl, int probe_idx, float intensity)
{
EEVEE_LightProbesInfo *pinfo = sldata->probes;
+ pinfo->intensity_fac = intensity;
+
/* Max lod used from the render target probe */
pinfo->lod_rt_max = floorf(log2f(pinfo->target_size)) - 2.0f;
@@ -1036,11 +1041,13 @@ static void glossy_filter_probe(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata,
/* Diffuse filter probe_rt to irradiance_pool at index probe_idx */
static void diffuse_filter_probe(
EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, EEVEE_PassList *psl, int offset,
- float clipsta, float clipend, float vis_range, float vis_blur)
+ float clipsta, float clipend, float vis_range, float vis_blur, float intensity)
{
EEVEE_CommonUniformBuffer *common_data = &sldata->common_data;
EEVEE_LightProbesInfo *pinfo = sldata->probes;
+ pinfo->intensity_fac = intensity;
+
int pool_size[3];
irradiance_pool_size_get(common_data->prb_irradiance_vis_size, pinfo->total_irradiance_samples, pool_size);
@@ -1370,11 +1377,11 @@ static void lightprobes_refresh_world(EEVEE_ViewLayerData *sldata, EEVEE_Data *v
render_world_to_probe(sldata, psl);
if (e_data.update_world & PROBE_UPDATE_CUBE) {
- glossy_filter_probe(sldata, vedata, psl, 0);
+ glossy_filter_probe(sldata, vedata, psl, 0, 1.0);
common_data->prb_num_render_cube = 1;
}
if (e_data.update_world & PROBE_UPDATE_GRID) {
- diffuse_filter_probe(sldata, vedata, psl, 0, 0.0, 0.0, 0.0, 0.0);
+ diffuse_filter_probe(sldata, vedata, psl, 0, 0.0, 0.0, 0.0, 0.0, 1.0);
SWAP(GPUTexture *, sldata->irradiance_pool, sldata->irradiance_rt);
DRW_framebuffer_texture_detach(sldata->probe_pool);
DRW_framebuffer_texture_attach(sldata->probe_filter_fb, sldata->irradiance_rt, 0, 0);
@@ -1473,7 +1480,7 @@ static void lightprobes_refresh_cube(EEVEE_ViewLayerData *sldata, EEVEE_Data *ve
}
LightProbe *prb = (LightProbe *)ob->data;
render_scene_to_probe(sldata, vedata, ob->obmat[3], prb->clipsta, prb->clipend);
- glossy_filter_probe(sldata, vedata, psl, i);
+ glossy_filter_probe(sldata, vedata, psl, i, prb->intensity);
ped->need_update = false;
ped->probe_id = i;
if (!ped->ready_to_shade) {
@@ -1576,7 +1583,8 @@ static void lightprobes_refresh_all_no_world(EEVEE_ViewLayerData *sldata, EEVEE_
}
render_scene_to_probe(sldata, vedata, pos, prb->clipsta, prb->clipend);
diffuse_filter_probe(sldata, vedata, psl, egrid->offset + cell_id,
- prb->clipsta, prb->clipend, egrid->visibility_range, prb->vis_blur);
+ prb->clipsta, prb->clipend, egrid->visibility_range, prb->vis_blur,
+ prb->intensity);
/* To see what is going on. */
SWAP(GPUTexture *, sldata->irradiance_pool, sldata->irradiance_rt);
/* Restore */
diff --git a/source/blender/draw/engines/eevee/eevee_private.h b/source/blender/draw/engines/eevee/eevee_private.h
index 902db075965..c91bfb1405f 100644
--- a/source/blender/draw/engines/eevee/eevee_private.h
+++ b/source/blender/draw/engines/eevee/eevee_private.h
@@ -445,6 +445,7 @@ typedef struct EEVEE_LightProbesInfo {
float lod_rt_max, lod_cube_max, lod_planar_max;
float visibility_range;
float visibility_blur;
+ float intensity_fac;
int shres;
/* List of probes in the scene. */
/* XXX This is fragile, can get out of sync quickly. */
diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl
index eb4315c93a3..b19ee7a9ea3 100644
--- a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl
@@ -3,6 +3,7 @@ uniform samplerCube probeHdr;
uniform int probeSize;
uniform float lodFactor;
uniform float lodMax;
+uniform float intensityFac;
in vec3 worldPosition;
@@ -192,6 +193,6 @@ void main()
}
}
- FragColor = irradiance_encode(out_radiance / weight);
+ FragColor = irradiance_encode(intensityFac * out_radiance / weight);
#endif
} \ No newline at end of file
diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl
index 33714c5293c..3aec3ce4642 100644
--- a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_glossy_frag.glsl
@@ -5,6 +5,7 @@ uniform float texelSize;
uniform float lodFactor;
uniform float lodMax;
uniform float paddingSize;
+uniform float intensityFac;
in vec3 worldPosition;
@@ -82,5 +83,5 @@ void main() {
}
}
- FragColor = vec4(out_radiance / weight, 1.0);
+ FragColor = vec4(intensityFac * out_radiance / weight, 1.0);
} \ No newline at end of file
diff --git a/source/blender/makesdna/DNA_lightprobe_types.h b/source/blender/makesdna/DNA_lightprobe_types.h
index 75705f7dd37..649df714457 100644
--- a/source/blender/makesdna/DNA_lightprobe_types.h
+++ b/source/blender/makesdna/DNA_lightprobe_types.h
@@ -55,7 +55,9 @@ typedef struct LightProbe {
float clipsta, clipend;
float vis_bias, vis_bleedbias; /* VSM visibility biases */
- float vis_blur, pad2;
+ float vis_blur;
+
+ float intensity; /* Intensity multiplier */
int grid_resolution_x; /* Irradiance grid resolution */
int grid_resolution_y;
diff --git a/source/blender/makesrna/intern/rna_lightprobe.c b/source/blender/makesrna/intern/rna_lightprobe.c
index 61dc835022b..6586b456960 100644
--- a/source/blender/makesrna/intern/rna_lightprobe.c
+++ b/source/blender/makesrna/intern/rna_lightprobe.c
@@ -179,6 +179,13 @@ static void rna_def_lightprobe(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Visibility Blur", "Filter size of the visibilty blur");
RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING, "rna_LightProbe_recalc");
+ prop = RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "intensity");
+ RNA_def_property_range(prop, 0.0f, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.0f, 3.0f, 1.0, 3);
+ RNA_def_property_ui_text(prop, "Intensity", "Modify the intensity of the lighting captured by this probe");
+ RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING, "rna_LightProbe_recalc");
+
/* Data preview */
prop = RNA_def_property(srna, "show_data", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIGHTPROBE_FLAG_SHOW_DATA);