forked from bartvdbraak/blender
render simplify option to disable triangulation.
- triangulating non planer quads is needed to resolve some artifacts however this also ends up triangulating most faces in - Suzzane subsurf level 4 for eg. this check could be tuned for better performance but for now skipping it is useful for test renders.
This commit is contained in:
parent
11e011b409
commit
f80617ab37
@ -208,11 +208,15 @@ class SCENE_PT_simplify(SceneButtonsPanel):
|
|||||||
col = split.column()
|
col = split.column()
|
||||||
col.prop(rd, "simplify_subdivision", text="Subdivision")
|
col.prop(rd, "simplify_subdivision", text="Subdivision")
|
||||||
col.prop(rd, "simplify_child_particles", text="Child Particles")
|
col.prop(rd, "simplify_child_particles", text="Child Particles")
|
||||||
|
|
||||||
|
col.prop(rd, "simplify_triangulate")
|
||||||
|
|
||||||
if wide_ui:
|
if wide_ui:
|
||||||
col = split.column()
|
col = split.column()
|
||||||
col.prop(rd, "simplify_shadow_samples", text="Shadow Samples")
|
col.prop(rd, "simplify_shadow_samples", text="Shadow Samples")
|
||||||
col.prop(rd, "simplify_ao_sss", text="AO and SSS")
|
col.prop(rd, "simplify_ao_sss", text="AO and SSS")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bpy.types.register(SCENE_PT_scene)
|
bpy.types.register(SCENE_PT_scene)
|
||||||
bpy.types.register(SCENE_PT_unit)
|
bpy.types.register(SCENE_PT_unit)
|
||||||
|
@ -359,8 +359,9 @@ typedef struct RenderData {
|
|||||||
float bg_stamp[4];
|
float bg_stamp[4];
|
||||||
|
|
||||||
/* render simplify */
|
/* render simplify */
|
||||||
int simplify_subsurf;
|
int simplify_flag;
|
||||||
int simplify_shadowsamples;
|
short simplify_subsurf;
|
||||||
|
short simplify_shadowsamples;
|
||||||
float simplify_particles;
|
float simplify_particles;
|
||||||
float simplify_aosss;
|
float simplify_aosss;
|
||||||
|
|
||||||
@ -966,6 +967,9 @@ typedef struct Scene {
|
|||||||
#define R_BAKE_SPACE_OBJECT 2
|
#define R_BAKE_SPACE_OBJECT 2
|
||||||
#define R_BAKE_SPACE_TANGENT 3
|
#define R_BAKE_SPACE_TANGENT 3
|
||||||
|
|
||||||
|
/* simplify_flag */
|
||||||
|
#define R_SIMPLE_NO_TRIANGULATE 1
|
||||||
|
|
||||||
/* **************** SCENE ********************* */
|
/* **************** SCENE ********************* */
|
||||||
|
|
||||||
/* for general use */
|
/* for general use */
|
||||||
|
@ -2471,6 +2471,10 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
|
|||||||
RNA_def_property_ui_text(prop, "Simplify AO and SSS", "Global approximate AA and SSS quality factor.");
|
RNA_def_property_ui_text(prop, "Simplify AO and SSS", "Global approximate AA and SSS quality factor.");
|
||||||
RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
|
RNA_def_property_update(prop, 0, "rna_Scene_simplify_update");
|
||||||
|
|
||||||
|
prop= RNA_def_property(srna, "simplify_triangulate", PROP_BOOLEAN, PROP_NONE);
|
||||||
|
RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", R_SIMPLE_NO_TRIANGULATE);
|
||||||
|
RNA_def_property_ui_text(prop, "Skip Quad to Triangles", "Disables non-planer quads being triangulated.");
|
||||||
|
|
||||||
/* Scene API */
|
/* Scene API */
|
||||||
RNA_api_scene_render(srna);
|
RNA_api_scene_render(srna);
|
||||||
}
|
}
|
||||||
|
@ -4098,7 +4098,8 @@ static void finalize_render_object(Render *re, ObjectRen *obr, int timeoffset)
|
|||||||
/* Baking lets us define a quad split order */
|
/* Baking lets us define a quad split order */
|
||||||
split_quads(obr, re->r.bake_quad_split);
|
split_quads(obr, re->r.bake_quad_split);
|
||||||
} else {
|
} else {
|
||||||
check_non_flat_quads(obr);
|
if((re->r.simplify_flag & R_SIMPLE_NO_TRIANGULATE) == 0)
|
||||||
|
check_non_flat_quads(obr);
|
||||||
}
|
}
|
||||||
|
|
||||||
set_fullsample_flag(re, obr);
|
set_fullsample_flag(re, obr);
|
||||||
|
Loading…
Reference in New Issue
Block a user