forked from bartvdbraak/blender
Eevee: Irradiance Visibility: Add RNA / Engine properties
This commit is contained in:
parent
d439e87064
commit
847f568bf5
@ -75,6 +75,13 @@ class DATA_PT_lightprobe(DataButtonsPanel, Panel):
|
|||||||
col.prop(probe, "influence_distance", "Distance")
|
col.prop(probe, "influence_distance", "Distance")
|
||||||
col.prop(probe, "falloff")
|
col.prop(probe, "falloff")
|
||||||
|
|
||||||
|
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")
|
||||||
|
|
||||||
elif probe.type == 'PLANAR':
|
elif probe.type == 'PLANAR':
|
||||||
col = split.column(align=True)
|
col = split.column(align=True)
|
||||||
col.label("Influence:")
|
col.label("Influence:")
|
||||||
|
@ -873,6 +873,7 @@ class RENDER_PT_eevee_indirect_lighting(RenderButtonsPanel, Panel):
|
|||||||
col = layout.column()
|
col = layout.column()
|
||||||
col.prop(props, "gi_diffuse_bounces")
|
col.prop(props, "gi_diffuse_bounces")
|
||||||
col.prop(props, "gi_cubemap_resolution")
|
col.prop(props, "gi_cubemap_resolution")
|
||||||
|
col.prop(props, "gi_visibility_resolution")
|
||||||
|
|
||||||
|
|
||||||
classes = (
|
classes = (
|
||||||
|
@ -448,6 +448,8 @@ class VIEWLAYER_PT_eevee_indirect_lighting(ViewLayerButtonsPanel, Panel):
|
|||||||
|
|
||||||
col = layout.column()
|
col = layout.column()
|
||||||
col.template_override_property(layer_props, scene_props, "gi_diffuse_bounces")
|
col.template_override_property(layer_props, scene_props, "gi_diffuse_bounces")
|
||||||
|
col.template_override_property(layer_props, scene_props, "gi_cubemap_resolution")
|
||||||
|
col.template_override_property(layer_props, scene_props, "gi_visibility_resolution")
|
||||||
|
|
||||||
|
|
||||||
classes = (
|
classes = (
|
||||||
|
@ -50,6 +50,8 @@ void BKE_lightprobe_init(LightProbe *probe)
|
|||||||
probe->falloff = 0.2f;
|
probe->falloff = 0.2f;
|
||||||
probe->clipsta = 0.8f;
|
probe->clipsta = 0.8f;
|
||||||
probe->clipend = 40.0f;
|
probe->clipend = 40.0f;
|
||||||
|
probe->vis_bias = 1.0f;
|
||||||
|
probe->vis_blur = 0.2f;
|
||||||
probe->data_draw_size = 1.0f;
|
probe->data_draw_size = 1.0f;
|
||||||
|
|
||||||
probe->flag = LIGHTPROBE_FLAG_SHOW_INFLUENCE | LIGHTPROBE_FLAG_SHOW_DATA;
|
probe->flag = LIGHTPROBE_FLAG_SHOW_INFLUENCE | LIGHTPROBE_FLAG_SHOW_DATA;
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
#include "DNA_group_types.h"
|
#include "DNA_group_types.h"
|
||||||
#include "DNA_lamp_types.h"
|
#include "DNA_lamp_types.h"
|
||||||
#include "DNA_layer_types.h"
|
#include "DNA_layer_types.h"
|
||||||
|
#include "DNA_lightprobe_types.h"
|
||||||
#include "DNA_material_types.h"
|
#include "DNA_material_types.h"
|
||||||
#include "DNA_mesh_types.h"
|
#include "DNA_mesh_types.h"
|
||||||
#include "DNA_scene_types.h"
|
#include "DNA_scene_types.h"
|
||||||
@ -736,6 +737,13 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!DNA_struct_elem_find(fd->filesdna, "LightProbe", "float", "vis_bias")) {
|
||||||
|
for (LightProbe *probe = main->lightprobe.first; probe; probe = probe->id.next) {
|
||||||
|
probe->vis_bias = 1.0f;
|
||||||
|
probe->vis_blur = 0.2f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
typedef enum eNTreeDoVersionErrors {
|
typedef enum eNTreeDoVersionErrors {
|
||||||
NTREE_DOVERSION_NO_ERROR = 0,
|
NTREE_DOVERSION_NO_ERROR = 0,
|
||||||
NTREE_DOVERSION_NEED_OUTPUT = (1 << 0),
|
NTREE_DOVERSION_NEED_OUTPUT = (1 << 0),
|
||||||
|
@ -338,6 +338,7 @@ static void eevee_view_layer_settings_create(RenderEngine *UNUSED(engine), IDPro
|
|||||||
|
|
||||||
BKE_collection_engine_property_add_int(props, "gi_diffuse_bounces", 3);
|
BKE_collection_engine_property_add_int(props, "gi_diffuse_bounces", 3);
|
||||||
BKE_collection_engine_property_add_int(props, "gi_cubemap_resolution", 512);
|
BKE_collection_engine_property_add_int(props, "gi_cubemap_resolution", 512);
|
||||||
|
BKE_collection_engine_property_add_int(props, "gi_visibility_resolution", 32);
|
||||||
|
|
||||||
BKE_collection_engine_property_add_int(props, "taa_samples", 8);
|
BKE_collection_engine_property_add_int(props, "taa_samples", 8);
|
||||||
|
|
||||||
|
@ -54,6 +54,9 @@ typedef struct LightProbe {
|
|||||||
|
|
||||||
float clipsta, clipend;
|
float clipsta, clipend;
|
||||||
|
|
||||||
|
float vis_bias, vis_bleedbias; /* VSM visibility biases */
|
||||||
|
float vis_blur, pad2;
|
||||||
|
|
||||||
int grid_resolution_x; /* Irradiance grid resolution */
|
int grid_resolution_x; /* Irradiance grid resolution */
|
||||||
int grid_resolution_y;
|
int grid_resolution_y;
|
||||||
int grid_resolution_z;
|
int grid_resolution_z;
|
||||||
|
@ -399,6 +399,7 @@ RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(shadow_high_bitdepth)
|
|||||||
RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(taa_samples)
|
RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(taa_samples)
|
||||||
RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(gi_diffuse_bounces)
|
RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(gi_diffuse_bounces)
|
||||||
RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(gi_cubemap_resolution)
|
RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(gi_cubemap_resolution)
|
||||||
|
RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(gi_visibility_resolution)
|
||||||
|
|
||||||
/* object engine */
|
/* object engine */
|
||||||
RNA_LAYER_MODE_OBJECT_GET_SET_BOOL(show_wire)
|
RNA_LAYER_MODE_OBJECT_GET_SET_BOOL(show_wire)
|
||||||
@ -1206,6 +1207,14 @@ static void rna_def_view_layer_engine_settings_eevee(BlenderRNA *brna)
|
|||||||
{0, NULL, 0, NULL, NULL}
|
{0, NULL, 0, NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const EnumPropertyItem eevee_gi_visibility_size_items[] = {
|
||||||
|
{8, "8", 0, "8px", ""},
|
||||||
|
{16, "16", 0, "16px", ""},
|
||||||
|
{32, "32", 0, "32px", ""},
|
||||||
|
{64, "64", 0, "64px", ""},
|
||||||
|
{0, NULL, 0, NULL, NULL}
|
||||||
|
};
|
||||||
|
|
||||||
static const EnumPropertyItem eevee_volumetric_tile_size_items[] = {
|
static const EnumPropertyItem eevee_volumetric_tile_size_items[] = {
|
||||||
{2, "2", 0, "2px", ""},
|
{2, "2", 0, "2px", ""},
|
||||||
{4, "4", 0, "4px", ""},
|
{4, "4", 0, "4px", ""},
|
||||||
@ -1232,12 +1241,22 @@ static void rna_def_view_layer_engine_settings_eevee(BlenderRNA *brna)
|
|||||||
RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
|
RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "gi_cubemap_resolution", PROP_ENUM, PROP_NONE);
|
prop = RNA_def_property(srna, "gi_cubemap_resolution", PROP_ENUM, PROP_NONE);
|
||||||
RNA_def_property_enum_funcs(prop, "rna_LayerEngineSettings_Eevee_gi_cubemap_resolution_get", "rna_LayerEngineSettings_Eevee_gi_cubemap_resolution_set", NULL);
|
RNA_def_property_enum_funcs(prop, "rna_LayerEngineSettings_Eevee_gi_cubemap_resolution_get",
|
||||||
|
"rna_LayerEngineSettings_Eevee_gi_cubemap_resolution_set", NULL);
|
||||||
RNA_def_property_enum_items(prop, eevee_shadow_size_items);
|
RNA_def_property_enum_items(prop, eevee_shadow_size_items);
|
||||||
RNA_def_property_ui_text(prop, "Cubemap Size", "Size of every cubemaps");
|
RNA_def_property_ui_text(prop, "Cubemap Size", "Size of every cubemaps");
|
||||||
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
||||||
RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
|
RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
|
||||||
|
|
||||||
|
prop = RNA_def_property(srna, "gi_visibility_resolution", PROP_ENUM, PROP_NONE);
|
||||||
|
RNA_def_property_enum_funcs(prop, "rna_LayerEngineSettings_Eevee_gi_visibility_resolution_get",
|
||||||
|
"rna_LayerEngineSettings_Eevee_gi_visibility_resolution_set", NULL);
|
||||||
|
RNA_def_property_enum_items(prop, eevee_gi_visibility_size_items);
|
||||||
|
RNA_def_property_ui_text(prop, "Irradiance Visibility Size",
|
||||||
|
"Size of the shadow map applied to each irradiance sample");
|
||||||
|
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
||||||
|
RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_ViewLayerEngineSettings_update");
|
||||||
|
|
||||||
/* Temporal Anti-Aliasing (super sampling) */
|
/* Temporal Anti-Aliasing (super sampling) */
|
||||||
prop = RNA_def_property(srna, "taa_samples", PROP_INT, PROP_NONE);
|
prop = RNA_def_property(srna, "taa_samples", PROP_INT, PROP_NONE);
|
||||||
RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_taa_samples_get",
|
RNA_def_property_int_funcs(prop, "rna_LayerEngineSettings_Eevee_taa_samples_get",
|
||||||
|
@ -160,6 +160,25 @@ static void rna_def_lightprobe(BlenderRNA *brna)
|
|||||||
RNA_def_property_ui_text(prop, "Resolution Z", "Number of sample along the z axis of the volume");
|
RNA_def_property_ui_text(prop, "Resolution Z", "Number of sample along the z axis of the volume");
|
||||||
RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING, "rna_LightProbe_recalc");
|
RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING, "rna_LightProbe_recalc");
|
||||||
|
|
||||||
|
prop = RNA_def_property(srna, "visibility_buffer_bias", PROP_FLOAT, PROP_NONE);
|
||||||
|
RNA_def_property_float_sdna(prop, NULL, "vis_bias");
|
||||||
|
RNA_def_property_range(prop, 0.001f, 9999.0f);
|
||||||
|
RNA_def_property_ui_range(prop, 0.001f, 5.0f, 1.0, 3);
|
||||||
|
RNA_def_property_ui_text(prop, "Visibility Bias", "Bias for reducing self shadowing");
|
||||||
|
RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING, NULL);
|
||||||
|
|
||||||
|
prop = RNA_def_property(srna, "visibility_bleed_bias", PROP_FLOAT, PROP_NONE);
|
||||||
|
RNA_def_property_float_sdna(prop, NULL, "vis_bleedbias");
|
||||||
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
||||||
|
RNA_def_property_ui_text(prop, "Visibility Bleed Bias", "Bias for reducing light-bleed on variance shadow maps");
|
||||||
|
RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING, NULL);
|
||||||
|
|
||||||
|
prop = RNA_def_property(srna, "visibility_blur", PROP_FLOAT, PROP_NONE);
|
||||||
|
RNA_def_property_float_sdna(prop, NULL, "vis_blur");
|
||||||
|
RNA_def_property_range(prop, 0.0f, 1.0f);
|
||||||
|
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");
|
||||||
|
|
||||||
/* Data preview */
|
/* Data preview */
|
||||||
prop = RNA_def_property(srna, "show_data", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "show_data", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIGHTPROBE_FLAG_SHOW_DATA);
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", LIGHTPROBE_FLAG_SHOW_DATA);
|
||||||
|
Loading…
Reference in New Issue
Block a user