EEVEE-Next: Rename light probes

Update to the new naming convention for `Light Probes`:

`Reflection Cubemap` -> `Sphere`
`Reflection Plane` -> `Plane`
`Irradiance Grid` -> `Volume`

Note that this breaks the Python API (`bpy.types.LightProbe.type`).

Pull Request: https://projects.blender.org/blender/blender/pulls/113452
This commit is contained in:
Miguel Pozo 2023-10-11 19:38:42 +02:00
parent 58bd6ef165
commit 1ba16edaf0
19 changed files with 95 additions and 91 deletions

View File

@ -46,7 +46,7 @@ class DATA_PT_lightprobe(DataButtonsPanel, Panel):
# layout.prop(probe, "type") # layout.prop(probe, "type")
if probe.type == 'GRID': if probe.type == 'VOLUME':
col = layout.column() col = layout.column()
col.prop(probe, "influence_distance", text="Distance") col.prop(probe, "influence_distance", text="Distance")
col.prop(probe, "falloff") col.prop(probe, "falloff")
@ -57,7 +57,7 @@ class DATA_PT_lightprobe(DataButtonsPanel, Panel):
sub.prop(probe, "grid_resolution_y", text="Y") sub.prop(probe, "grid_resolution_y", text="Y")
sub.prop(probe, "grid_resolution_z", text="Z") sub.prop(probe, "grid_resolution_z", text="Z")
elif probe.type == 'PLANAR': elif probe.type == 'PLANE':
col = layout.column() col = layout.column()
col.prop(probe, "influence_distance", text="Distance") col.prop(probe, "influence_distance", text="Distance")
col.prop(probe, "falloff") col.prop(probe, "falloff")
@ -74,12 +74,12 @@ class DATA_PT_lightprobe(DataButtonsPanel, Panel):
col.prop(probe, "intensity") col.prop(probe, "intensity")
sub = col.column(align=True) sub = col.column(align=True)
if probe.type != 'PLANAR': if probe.type != 'PLANE':
sub.prop(probe, "clip_start", text="Clipping Start") sub.prop(probe, "clip_start", text="Clipping Start")
else: else:
sub.prop(probe, "clip_start", text="Clipping Offset") sub.prop(probe, "clip_start", text="Clipping Offset")
if probe.type != 'PLANAR': if probe.type != 'PLANE':
sub.prop(probe, "clip_end", text="End") sub.prop(probe, "clip_end", text="End")
@ -93,7 +93,7 @@ class DATA_PT_lightprobe_eevee_next(DataButtonsPanel, Panel):
probe = context.lightprobe probe = context.lightprobe
if probe.type == 'GRID': if probe.type == 'VOLUME':
col = layout.column() col = layout.column()
sub = col.column(align=True) sub = col.column(align=True)
@ -144,12 +144,12 @@ class DATA_PT_lightprobe_eevee_next(DataButtonsPanel, Panel):
col.prop(probe, "grid_capture_indirect") col.prop(probe, "grid_capture_indirect")
col.prop(probe, "grid_capture_emission") col.prop(probe, "grid_capture_emission")
elif probe.type == 'CUBEMAP': elif probe.type == 'SPHERE':
sub = layout.column(align=True) sub = layout.column(align=True)
sub.prop(probe, "clip_start", text="Clipping Start") sub.prop(probe, "clip_start", text="Clipping Start")
sub.prop(probe, "clip_end", text="End") sub.prop(probe, "clip_end", text="End")
elif probe.type == 'PLANAR': elif probe.type == 'PLANE':
col = layout.column() col = layout.column()
row = col.row() row = col.row()
col.prop(probe, "clip_start", text="Clipping Offset") col.prop(probe, "clip_start", text="Clipping Offset")
@ -173,7 +173,7 @@ class DATA_PT_lightprobe_visibility(DataButtonsPanel, Panel):
col = layout.column() col = layout.column()
if probe.type == 'GRID': if probe.type == 'VOLUME':
col.prop(probe, "visibility_buffer_bias", text="Bias") col.prop(probe, "visibility_buffer_bias", text="Bias")
col.prop(probe, "visibility_bleed_bias", text="Bleed Bias") col.prop(probe, "visibility_bleed_bias", text="Bleed Bias")
col.prop(probe, "visibility_blur", text="Blur") col.prop(probe, "visibility_blur", text="Blur")
@ -191,7 +191,7 @@ class DATA_PT_lightprobe_parallax(DataButtonsPanel, Panel):
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
engine = context.engine engine = context.engine
return context.lightprobe and context.lightprobe.type == 'CUBEMAP' and (engine in cls.COMPAT_ENGINES) return context.lightprobe and context.lightprobe.type == 'SPHERE' and (engine in cls.COMPAT_ENGINES)
def draw_header(self, context): def draw_header(self, context):
probe = context.lightprobe probe = context.lightprobe
@ -228,16 +228,16 @@ class DATA_PT_lightprobe_display(DataButtonsPanel, Panel):
col = layout.column() col = layout.column()
if probe.type == 'PLANAR': if probe.type == 'PLANE':
col.prop(ob, "empty_display_size", text="Arrow Size") col.prop(ob, "empty_display_size", text="Arrow Size")
col.prop(probe, "show_influence") col.prop(probe, "show_influence")
col.prop(probe, "show_data") col.prop(probe, "show_data")
if probe.type in {'GRID', 'CUBEMAP'}: if probe.type in {'VOLUME', 'SPHERE'}:
col.prop(probe, "show_influence") col.prop(probe, "show_influence")
col.prop(probe, "show_clip") col.prop(probe, "show_clip")
if probe.type == 'CUBEMAP': if probe.type == 'SPHERE':
sub = col.column() sub = col.column()
sub.active = probe.use_custom_parallax sub.active = probe.use_custom_parallax
sub.prop(probe, "show_parallax") sub.prop(probe, "show_parallax")

View File

@ -858,7 +858,7 @@ class RENDER_PT_eevee_indirect_lighting(RenderButtonsPanel, Panel):
col = layout.column() col = layout.column()
col.operator("scene.light_cache_bake", text="Bake Indirect Lighting", icon='RENDER_STILL') col.operator("scene.light_cache_bake", text="Bake Indirect Lighting", icon='RENDER_STILL')
col.operator("scene.light_cache_bake", text="Bake Cubemap Only", icon='LIGHTPROBE_CUBEMAP').subset = 'CUBEMAPS' col.operator("scene.light_cache_bake", text="Bake Cubemap Only", icon='LIGHTPROBE_SPHERE').subset = 'CUBEMAPS'
col.operator("scene.light_cache_free", text="Delete Lighting Cache") col.operator("scene.light_cache_free", text="Delete Lighting Cache")
cache_info = scene.eevee.gi_cache_info cache_info = scene.eevee.gi_cache_info

View File

@ -86,17 +86,17 @@ void BKE_lightprobe_type_set(LightProbe *probe, const short lightprobe_type)
probe->type = lightprobe_type; probe->type = lightprobe_type;
switch (probe->type) { switch (probe->type) {
case LIGHTPROBE_TYPE_GRID: case LIGHTPROBE_TYPE_VOLUME:
probe->distinf = 0.3f; probe->distinf = 0.3f;
probe->falloff = 1.0f; probe->falloff = 1.0f;
probe->clipsta = 0.01f; probe->clipsta = 0.01f;
break; break;
case LIGHTPROBE_TYPE_PLANAR: case LIGHTPROBE_TYPE_PLANE:
probe->distinf = 0.1f; probe->distinf = 0.1f;
probe->falloff = 0.5f; probe->falloff = 0.5f;
probe->clipsta = 0.001f; probe->clipsta = 0.001f;
break; break;
case LIGHTPROBE_TYPE_CUBE: case LIGHTPROBE_TYPE_SPHERE:
probe->attenuation_type = LIGHTPROBE_SHAPE_ELIPSOID; probe->attenuation_type = LIGHTPROBE_SHAPE_ELIPSOID;
break; break;
default: default:

View File

@ -671,12 +671,12 @@ static void eevee_lightbake_count_probes(EEVEE_LightBake *lbake)
if (ob->type == OB_LIGHTPROBE) { if (ob->type == OB_LIGHTPROBE) {
LightProbe *prb = (LightProbe *)ob->data; LightProbe *prb = (LightProbe *)ob->data;
if (prb->type == LIGHTPROBE_TYPE_GRID) { if (prb->type == LIGHTPROBE_TYPE_VOLUME) {
lbake->total_irr_samples += prb->grid_resolution_x * prb->grid_resolution_y * lbake->total_irr_samples += prb->grid_resolution_x * prb->grid_resolution_y *
prb->grid_resolution_z; prb->grid_resolution_z;
lbake->grid_len++; lbake->grid_len++;
} }
else if (prb->type == LIGHTPROBE_TYPE_CUBE && lbake->cube_len < EEVEE_PROBE_MAX) { else if (prb->type == LIGHTPROBE_TYPE_SPHERE && lbake->cube_len < EEVEE_PROBE_MAX) {
lbake->cube_len++; lbake->cube_len++;
} }
} }
@ -1334,12 +1334,12 @@ static void eevee_lightbake_gather_probes(EEVEE_LightBake *lbake)
if (ob->type == OB_LIGHTPROBE) { if (ob->type == OB_LIGHTPROBE) {
LightProbe *prb = (LightProbe *)ob->data; LightProbe *prb = (LightProbe *)ob->data;
if (prb->type == LIGHTPROBE_TYPE_GRID) { if (prb->type == LIGHTPROBE_TYPE_VOLUME) {
lbake->grid_prb[grid_len] = prb; lbake->grid_prb[grid_len] = prb;
EEVEE_LightGrid *egrid = &lcache->grid_data[grid_len++]; EEVEE_LightGrid *egrid = &lcache->grid_data[grid_len++];
EEVEE_lightprobes_grid_data_from_object(ob, egrid, &total_irr_samples); EEVEE_lightprobes_grid_data_from_object(ob, egrid, &total_irr_samples);
} }
else if (prb->type == LIGHTPROBE_TYPE_CUBE && cube_len < EEVEE_PROBE_MAX) { else if (prb->type == LIGHTPROBE_TYPE_SPHERE && cube_len < EEVEE_PROBE_MAX) {
lbake->cube_prb[cube_len] = prb; lbake->cube_prb[cube_len] = prb;
EEVEE_LightProbe *eprobe = &lcache->cube_data[cube_len++]; EEVEE_LightProbe *eprobe = &lcache->cube_data[cube_len++];
EEVEE_lightprobes_cube_data_from_object(ob, eprobe); EEVEE_lightprobes_cube_data_from_object(ob, eprobe);

View File

@ -417,7 +417,7 @@ static bool eevee_lightprobes_culling_test(Object *ob)
LightProbe *probe = (LightProbe *)ob->data; LightProbe *probe = (LightProbe *)ob->data;
switch (probe->type) { switch (probe->type) {
case LIGHTPROBE_TYPE_PLANAR: { case LIGHTPROBE_TYPE_PLANE: {
/* See if this planar probe is inside the view frustum. If not, no need to update it. */ /* See if this planar probe is inside the view frustum. If not, no need to update it. */
/* NOTE: this could be bypassed if we want feedback loop mirrors for rendering. */ /* NOTE: this could be bypassed if we want feedback loop mirrors for rendering. */
BoundBox bbox; BoundBox bbox;
@ -436,9 +436,9 @@ static bool eevee_lightprobes_culling_test(Object *ob)
const DRWView *default_view = DRW_view_default_get(); const DRWView *default_view = DRW_view_default_get();
return DRW_culling_box_test(default_view, &bbox); return DRW_culling_box_test(default_view, &bbox);
} }
case LIGHTPROBE_TYPE_CUBE: case LIGHTPROBE_TYPE_SPHERE:
return true; /* TODO */ return true; /* TODO */
case LIGHTPROBE_TYPE_GRID: case LIGHTPROBE_TYPE_VOLUME:
return true; /* TODO */ return true; /* TODO */
} }
BLI_assert(0); BLI_assert(0);
@ -450,15 +450,15 @@ void EEVEE_lightprobes_cache_add(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata
EEVEE_LightProbesInfo *pinfo = sldata->probes; EEVEE_LightProbesInfo *pinfo = sldata->probes;
LightProbe *probe = (LightProbe *)ob->data; LightProbe *probe = (LightProbe *)ob->data;
if ((probe->type == LIGHTPROBE_TYPE_CUBE && pinfo->num_cube >= EEVEE_PROBE_MAX) || if ((probe->type == LIGHTPROBE_TYPE_SPHERE && pinfo->num_cube >= EEVEE_PROBE_MAX) ||
(probe->type == LIGHTPROBE_TYPE_GRID && pinfo->num_grid >= EEVEE_PROBE_MAX) || (probe->type == LIGHTPROBE_TYPE_VOLUME && pinfo->num_grid >= EEVEE_PROBE_MAX) ||
(probe->type == LIGHTPROBE_TYPE_PLANAR && pinfo->num_planar >= MAX_PLANAR)) (probe->type == LIGHTPROBE_TYPE_PLANE && pinfo->num_planar >= MAX_PLANAR))
{ {
printf("Too many probes in the view !!!\n"); printf("Too many probes in the view !!!\n");
return; return;
} }
if (probe->type == LIGHTPROBE_TYPE_PLANAR) { if (probe->type == LIGHTPROBE_TYPE_PLANE) {
/* TODO(fclem): Culling should be done after cache generation. /* TODO(fclem): Culling should be done after cache generation.
* This is needed for future draw cache persistence. */ * This is needed for future draw cache persistence. */
if (!eevee_lightprobes_culling_test(ob)) { if (!eevee_lightprobes_culling_test(ob)) {
@ -477,7 +477,7 @@ void EEVEE_lightprobes_cache_add(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata
else { else {
EEVEE_LightProbeEngineData *ped = EEVEE_lightprobe_data_ensure(ob); EEVEE_LightProbeEngineData *ped = EEVEE_lightprobe_data_ensure(ob);
if (ped->need_update) { if (ped->need_update) {
if (probe->type == LIGHTPROBE_TYPE_GRID) { if (probe->type == LIGHTPROBE_TYPE_VOLUME) {
pinfo->do_grid_update = true; pinfo->do_grid_update = true;
} }
else { else {

View File

@ -67,13 +67,13 @@ void LightProbeModule::sync_probe(const Object *ob, ObjectHandle &handle)
{ {
const ::LightProbe *lightprobe = static_cast<const ::LightProbe *>(ob->data); const ::LightProbe *lightprobe = static_cast<const ::LightProbe *>(ob->data);
switch (lightprobe->type) { switch (lightprobe->type) {
case LIGHTPROBE_TYPE_CUBE: case LIGHTPROBE_TYPE_SPHERE:
sync_cube(handle); sync_cube(handle);
return; return;
case LIGHTPROBE_TYPE_PLANAR: case LIGHTPROBE_TYPE_PLANE:
/* TODO(fclem): Remove support? Add support? */ /* TODO(fclem): Remove support? Add support? */
return; return;
case LIGHTPROBE_TYPE_GRID: case LIGHTPROBE_TYPE_VOLUME:
sync_grid(ob, handle); sync_grid(ob, handle);
return; return;
} }

View File

@ -71,7 +71,7 @@ void PlanarProbeModule::begin_sync()
void PlanarProbeModule::sync_object(Object *ob, ObjectHandle &ob_handle) void PlanarProbeModule::sync_object(Object *ob, ObjectHandle &ob_handle)
{ {
const ::LightProbe *light_probe = (::LightProbe *)ob->data; const ::LightProbe *light_probe = (::LightProbe *)ob->data;
if (light_probe->type != LIGHTPROBE_TYPE_PLANAR) { if (light_probe->type != LIGHTPROBE_TYPE_PLANE) {
return; return;
} }

View File

@ -163,7 +163,7 @@ eLightProbeResolution ReflectionProbeModule::reflection_probe_resolution() const
void ReflectionProbeModule::sync_object(Object *ob, ObjectHandle &ob_handle) void ReflectionProbeModule::sync_object(Object *ob, ObjectHandle &ob_handle)
{ {
const ::LightProbe *light_probe = (::LightProbe *)ob->data; const ::LightProbe *light_probe = (::LightProbe *)ob->data;
if (light_probe->type != LIGHTPROBE_TYPE_CUBE) { if (light_probe->type != LIGHTPROBE_TYPE_SPHERE) {
return; return;
} }
const bool is_dirty = ob_handle.recalc != 0; const bool is_dirty = ob_handle.recalc != 0;

View File

@ -737,7 +737,7 @@ void OVERLAY_lightprobe_cache_populate(OVERLAY_Data *vedata, Object *ob)
copy_m4_m4(instdata.mat, ob->object_to_world); copy_m4_m4(instdata.mat, ob->object_to_world);
switch (prb->type) { switch (prb->type) {
case LIGHTPROBE_TYPE_CUBE: case LIGHTPROBE_TYPE_SPHERE:
instdata.clip_sta = show_clipping ? prb->clipsta : -1.0; instdata.clip_sta = show_clipping ? prb->clipsta : -1.0;
instdata.clip_end = show_clipping ? prb->clipend : -1.0; instdata.clip_end = show_clipping ? prb->clipend : -1.0;
DRW_buffer_add_entry(cb->probe_cube, color_p, &instdata); DRW_buffer_add_entry(cb->probe_cube, color_p, &instdata);
@ -757,7 +757,7 @@ void OVERLAY_lightprobe_cache_populate(OVERLAY_Data *vedata, Object *ob)
OVERLAY_empty_shape(cb, ob->object_to_world, dist, shape, color_p); OVERLAY_empty_shape(cb, ob->object_to_world, dist, shape, color_p);
} }
break; break;
case LIGHTPROBE_TYPE_GRID: case LIGHTPROBE_TYPE_VOLUME:
instdata.clip_sta = show_clipping ? prb->clipsta : -1.0; instdata.clip_sta = show_clipping ? prb->clipsta : -1.0;
instdata.clip_end = show_clipping ? prb->clipend : -1.0; instdata.clip_end = show_clipping ? prb->clipend : -1.0;
DRW_buffer_add_entry(cb->probe_grid, color_p, &instdata); DRW_buffer_add_entry(cb->probe_grid, color_p, &instdata);
@ -787,7 +787,7 @@ void OVERLAY_lightprobe_cache_populate(OVERLAY_Data *vedata, Object *ob)
DRW_shgroup_call_procedural_points(grp, nullptr, cell_count); DRW_shgroup_call_procedural_points(grp, nullptr, cell_count);
} }
break; break;
case LIGHTPROBE_TYPE_PLANAR: case LIGHTPROBE_TYPE_PLANE:
DRW_buffer_add_entry(cb->probe_planar, color_p, &instdata); DRW_buffer_add_entry(cb->probe_planar, color_p, &instdata);
if (DRW_state_is_select() && (prb->flag & LIGHTPROBE_FLAG_SHOW_DATA)) { if (DRW_state_is_select() && (prb->flag & LIGHTPROBE_FLAG_SHOW_DATA)) {

View File

@ -387,9 +387,9 @@ DEF_ICON(CURVE_BEZCIRCLE)
DEF_ICON(CURVE_NCURVE) DEF_ICON(CURVE_NCURVE)
DEF_ICON(CURVE_NCIRCLE) DEF_ICON(CURVE_NCIRCLE)
DEF_ICON(CURVE_PATH) DEF_ICON(CURVE_PATH)
DEF_ICON_OBJECT_DATA(LIGHTPROBE_CUBEMAP) DEF_ICON_OBJECT_DATA(LIGHTPROBE_SPHERE)
DEF_ICON_OBJECT_DATA(LIGHTPROBE_PLANAR) DEF_ICON_OBJECT_DATA(LIGHTPROBE_PLANE)
DEF_ICON_OBJECT_DATA(LIGHTPROBE_GRID) DEF_ICON_OBJECT_DATA(LIGHTPROBE_VOLUME)
DEF_ICON_BLANK(406) DEF_ICON_BLANK(406)
DEF_ICON_BLANK(407) DEF_ICON_BLANK(407)
DEF_ICON(COLOR_RED) DEF_ICON(COLOR_RED)

View File

@ -164,21 +164,21 @@ static const EnumPropertyItem field_type_items[] = {
}; };
static EnumPropertyItem lightprobe_type_items[] = { static EnumPropertyItem lightprobe_type_items[] = {
{LIGHTPROBE_TYPE_CUBE, {LIGHTPROBE_TYPE_SPHERE,
"CUBEMAP", "SPHERE",
ICON_LIGHTPROBE_CUBEMAP, ICON_LIGHTPROBE_SPHERE,
"Reflection Cubemap", "Sphere",
"Reflection probe with spherical or cubic attenuation"}, "Light probe that captures precise lighting from all directions at a single point in space"},
{LIGHTPROBE_TYPE_PLANAR, {LIGHTPROBE_TYPE_PLANE,
"PLANAR", "PLANE",
ICON_LIGHTPROBE_PLANAR, ICON_LIGHTPROBE_PLANE,
"Reflection Plane", "Plane",
"Planar reflection probe"}, "Light probe that captures incoming light from a single direction on a plane"},
{LIGHTPROBE_TYPE_GRID, {LIGHTPROBE_TYPE_VOLUME,
"GRID", "VOLUME",
ICON_LIGHTPROBE_GRID, ICON_LIGHTPROBE_VOLUME,
"Irradiance Volume", "Volume",
"Irradiance probe to capture diffuse indirect lighting"}, "Light probe that captures low frequency lighting inside a volume"},
{0, nullptr, 0, nullptr, nullptr}, {0, nullptr, 0, nullptr, nullptr},
}; };
@ -746,12 +746,12 @@ void OBJECT_OT_add(wmOperatorType *ot)
static const char *get_lightprobe_defname(int type) static const char *get_lightprobe_defname(int type)
{ {
switch (type) { switch (type) {
case LIGHTPROBE_TYPE_GRID: case LIGHTPROBE_TYPE_VOLUME:
return CTX_DATA_(BLT_I18NCONTEXT_ID_LIGHT, "IrradianceVolume"); return CTX_DATA_(BLT_I18NCONTEXT_ID_LIGHT, "Volume");
case LIGHTPROBE_TYPE_PLANAR: case LIGHTPROBE_TYPE_PLANE:
return CTX_DATA_(BLT_I18NCONTEXT_ID_LIGHT, "ReflectionPlane"); return CTX_DATA_(BLT_I18NCONTEXT_ID_LIGHT, "Plane");
case LIGHTPROBE_TYPE_CUBE: case LIGHTPROBE_TYPE_SPHERE:
return CTX_DATA_(BLT_I18NCONTEXT_ID_LIGHT, "ReflectionCubemap"); return CTX_DATA_(BLT_I18NCONTEXT_ID_LIGHT, "Sphere");
default: default:
return CTX_DATA_(BLT_I18NCONTEXT_ID_LIGHT, "LightProbe"); return CTX_DATA_(BLT_I18NCONTEXT_ID_LIGHT, "LightProbe");
} }

View File

@ -1525,7 +1525,7 @@ static blender::Vector<Object *> lightprobe_cache_irradiance_volume_subset_get(b
auto is_irradiance_volume = [](Object *ob) -> bool { auto is_irradiance_volume = [](Object *ob) -> bool {
return ob->type == OB_LIGHTPROBE && return ob->type == OB_LIGHTPROBE &&
static_cast<LightProbe *>(ob->data)->type == LIGHTPROBE_TYPE_GRID; static_cast<LightProbe *>(ob->data)->type == LIGHTPROBE_TYPE_VOLUME;
}; };
blender::Vector<Object *> probes; blender::Vector<Object *> probes;

View File

@ -2527,14 +2527,14 @@ static BIFIconID tree_element_get_icon_from_id(const ID *id)
case ID_LP: { case ID_LP: {
const LightProbe *lp = (LightProbe *)id; const LightProbe *lp = (LightProbe *)id;
switch (lp->type) { switch (lp->type) {
case LIGHTPROBE_TYPE_CUBE: case LIGHTPROBE_TYPE_SPHERE:
return ICON_LIGHTPROBE_CUBEMAP; return ICON_LIGHTPROBE_SPHERE;
case LIGHTPROBE_TYPE_PLANAR: case LIGHTPROBE_TYPE_PLANE:
return ICON_LIGHTPROBE_PLANAR; return ICON_LIGHTPROBE_PLANE;
case LIGHTPROBE_TYPE_GRID: case LIGHTPROBE_TYPE_VOLUME:
return ICON_LIGHTPROBE_GRID; return ICON_LIGHTPROBE_VOLUME;
default: default:
return ICON_LIGHTPROBE_CUBEMAP; return ICON_LIGHTPROBE_SPHERE;
} }
} }
case ID_BR: case ID_BR:

View File

@ -81,9 +81,9 @@ typedef struct LightProbe {
/* Probe->type */ /* Probe->type */
enum { enum {
LIGHTPROBE_TYPE_CUBE = 0, LIGHTPROBE_TYPE_SPHERE = 0,
LIGHTPROBE_TYPE_PLANAR = 1, LIGHTPROBE_TYPE_PLANE = 1,
LIGHTPROBE_TYPE_GRID = 2, LIGHTPROBE_TYPE_VOLUME = 2,
}; };
/* Probe->flag */ /* Probe->flag */

View File

@ -49,7 +49,7 @@ const EnumPropertyItem rna_enum_id_type_items[] = {
{ID_LT, "LATTICE", ICON_LATTICE_DATA, "Lattice", ""}, {ID_LT, "LATTICE", ICON_LATTICE_DATA, "Lattice", ""},
{ID_LI, "LIBRARY", ICON_LIBRARY_DATA_DIRECT, "Library", ""}, {ID_LI, "LIBRARY", ICON_LIBRARY_DATA_DIRECT, "Library", ""},
{ID_LA, "LIGHT", ICON_LIGHT_DATA, "Light", ""}, {ID_LA, "LIGHT", ICON_LIGHT_DATA, "Light", ""},
{ID_LP, "LIGHT_PROBE", ICON_LIGHTPROBE_CUBEMAP, "Light Probe", ""}, {ID_LP, "LIGHT_PROBE", ICON_LIGHTPROBE_SPHERE, "Light Probe", ""},
{ID_LS, "LINESTYLE", ICON_LINE_DATA, "Line Style", ""}, {ID_LS, "LINESTYLE", ICON_LINE_DATA, "Line Style", ""},
{ID_MSK, "MASK", ICON_MOD_MASK, "Mask", ""}, {ID_MSK, "MASK", ICON_MOD_MASK, "Mask", ""},
{ID_MA, "MATERIAL", ICON_MATERIAL_DATA, "Material", ""}, {ID_MA, "MATERIAL", ICON_MATERIAL_DATA, "Material", ""},

View File

@ -43,17 +43,21 @@ static EnumPropertyItem parallax_type_items[] = {
}; };
static EnumPropertyItem lightprobe_type_items[] = { static EnumPropertyItem lightprobe_type_items[] = {
{LIGHTPROBE_TYPE_CUBE, {LIGHTPROBE_TYPE_SPHERE,
"CUBEMAP", "SPHERE",
ICON_LIGHTPROBE_CUBEMAP, ICON_LIGHTPROBE_SPHERE,
"Reflection Cubemap", "Sphere",
"Capture reflections"}, "Light probe that captures precise lighting from all directions at a single point in space"},
{LIGHTPROBE_TYPE_PLANAR, "PLANAR", ICON_LIGHTPROBE_PLANAR, "Reflection Plane", ""}, {LIGHTPROBE_TYPE_PLANE,
{LIGHTPROBE_TYPE_GRID, "PLANE",
"GRID", ICON_LIGHTPROBE_PLANE,
ICON_LIGHTPROBE_GRID, "Plane",
"Irradiance Volume", "Light probe that captures incoming light from a single direction on a plane"},
"Volume used for precomputing indirect lighting"}, {LIGHTPROBE_TYPE_VOLUME,
"VOLUME",
ICON_LIGHTPROBE_VOLUME,
"Volume",
"Light probe that captures low frequency lighting inside a volume"},
{0, nullptr, 0, nullptr, nullptr}, {0, nullptr, 0, nullptr, nullptr},
}; };

View File

@ -233,9 +233,9 @@ const EnumPropertyItem rna_enum_metaelem_type_items[] = {
}; };
const EnumPropertyItem rna_enum_lightprobes_type_items[] = { const EnumPropertyItem rna_enum_lightprobes_type_items[] = {
{LIGHTPROBE_TYPE_CUBE, "CUBE", ICON_LIGHTPROBE_CUBEMAP, "Cube", ""}, {LIGHTPROBE_TYPE_SPHERE, "SPHERE", ICON_LIGHTPROBE_SPHERE, "Sphere", ""},
{LIGHTPROBE_TYPE_PLANAR, "PLANAR", ICON_LIGHTPROBE_PLANAR, "Planar", ""}, {LIGHTPROBE_TYPE_PLANE, "PLANE", ICON_LIGHTPROBE_PLANE, "Plane", ""},
{LIGHTPROBE_TYPE_GRID, "GRID", ICON_LIGHTPROBE_GRID, "Grid", ""}, {LIGHTPROBE_TYPE_VOLUME, "VOLUME", ICON_LIGHTPROBE_VOLUME, "Volume", ""},
{0, nullptr, 0, nullptr, nullptr}, {0, nullptr, 0, nullptr, nullptr},
}; };

View File

@ -29,13 +29,13 @@ def setup():
# Does not work in edit mode # Does not work in edit mode
try: try:
# Simple probe setup # Simple probe setup
bpy.ops.object.lightprobe_add(type='CUBEMAP', location=(0.5, 0, 1.5)) bpy.ops.object.lightprobe_add(type='SPHERE', location=(0.5, 0, 1.5))
cubemap = bpy.context.selected_objects[0] cubemap = bpy.context.selected_objects[0]
cubemap.scale = (2.5, 2.5, 1.0) cubemap.scale = (2.5, 2.5, 1.0)
cubemap.data.falloff = 0 cubemap.data.falloff = 0
cubemap.data.clip_start = 2.4 cubemap.data.clip_start = 2.4
bpy.ops.object.lightprobe_add(type='GRID', location=(0, 0, 0.25)) bpy.ops.object.lightprobe_add(type='VOLUME', location=(0, 0, 0.25))
grid = bpy.context.selected_objects[0] grid = bpy.context.selected_objects[0]
grid.scale = (1.735, 1.735, 1.735) grid.scale = (1.735, 1.735, 1.735)
grid.data.bake_samples = 256 grid.data.bake_samples = 256

View File

@ -43,13 +43,13 @@ def setup():
# Does not work in edit mode # Does not work in edit mode
try: try:
# Simple probe setup # Simple probe setup
bpy.ops.object.lightprobe_add(type='CUBEMAP', location=(0.5, 0, 1.5)) bpy.ops.object.lightprobe_add(type='SPHERE', location=(0.5, 0, 1.5))
cubemap = bpy.context.selected_objects[0] cubemap = bpy.context.selected_objects[0]
cubemap.scale = (2.5, 2.5, 1.0) cubemap.scale = (2.5, 2.5, 1.0)
cubemap.data.falloff = 0 cubemap.data.falloff = 0
cubemap.data.clip_start = 2.4 cubemap.data.clip_start = 2.4
bpy.ops.object.lightprobe_add(type='GRID', location=(0, 0, 0.25)) bpy.ops.object.lightprobe_add(type='VOLUME', location=(0, 0, 0.25))
grid = bpy.context.selected_objects[0] grid = bpy.context.selected_objects[0]
grid.scale = (1.735, 1.735, 1.735) grid.scale = (1.735, 1.735, 1.735)
grid.data.grid_resolution_x = 3 grid.data.grid_resolution_x = 3