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:
authorPhoenix Katsch <phoenixkatsch>2022-10-03 20:26:02 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-10-03 22:59:31 +0300
commitb475506cfbd35fe2d356ce43a6a3e1f93bd6602b (patch)
tree030ef0c4eafbb9443ae5c6ed9b8d105dd5a82974 /source/blender/makesrna
parentaf51e4b41c9e591bd0640623d5314508f8e6a8ea (diff)
Cycles: add option to bake specular from active camera viewpoint
Previously it would bake viewed from above the surface. The new option can be useful when the baked result is meant to be viewed from a fixed viewpoint or with limited camera motion. Some effort is made to give a continuous reflection on parts of the surface invisible to the camera, but this is necessarily only a rough approximation. Differential Revision: https://developer.blender.org/D15921
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_scene.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index da30b7f2136..fdf8be9cb33 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -476,6 +476,20 @@ const EnumPropertyItem rna_enum_bake_save_mode_items[] = {
{0, NULL, 0, NULL, NULL},
};
+const EnumPropertyItem rna_enum_bake_view_from_items[] = {
+ {R_BAKE_VIEW_FROM_ABOVE_SURFACE,
+ "ABOVE_SURFACE",
+ 0,
+ "Above Surface",
+ "Cast rays from above the surface"},
+ {R_BAKE_VIEW_FROM_ACTIVE_CAMERA,
+ "ACTIVE_CAMERA",
+ 0,
+ "Active Camera",
+ "Use the active camera's position to cast rays"},
+ {0, NULL, 0, NULL, NULL},
+};
+
#define R_IMF_VIEWS_ENUM_IND \
{R_IMF_VIEWS_INDIVIDUAL, \
"INDIVIDUAL", \
@@ -5413,6 +5427,11 @@ static void rna_def_bake_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Save Mode", "Where to save baked image textures");
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
+ prop = RNA_def_property(srna, "view_from", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, rna_enum_bake_view_from_items);
+ RNA_def_property_ui_text(prop, "View From", "Source of reflection ray directions");
+ RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
+
/* flags */
prop = RNA_def_property(srna, "use_selected_to_active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", R_BAKE_TO_ACTIVE);