render simplify option to disable triangulation.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 2 Feb 2010 15:51:44 +0000 (15:51 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 2 Feb 2010 15:51:44 +0000 (15:51 +0000)
- 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.

release/scripts/ui/properties_scene.py
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/intern/rna_scene.c
source/blender/render/intern/source/convertblender.c

index 3a29381fe7707eef36673678c8bfc8c7609897eb..61938ca93b455f45132762bcd75e4405fda002bd 100644 (file)
@@ -208,11 +208,15 @@ class SCENE_PT_simplify(SceneButtonsPanel):
         col = split.column()
         col.prop(rd, "simplify_subdivision", text="Subdivision")
         col.prop(rd, "simplify_child_particles", text="Child Particles")
+        
+        col.prop(rd, "simplify_triangulate")
 
         if wide_ui:
             col = split.column()
         col.prop(rd, "simplify_shadow_samples", text="Shadow Samples")
         col.prop(rd, "simplify_ao_sss", text="AO and SSS")
+        
+        
 
 bpy.types.register(SCENE_PT_scene)
 bpy.types.register(SCENE_PT_unit)
index 636596f7af70acd5e9e48cc318b39d40da66c5ce..d646d9b7c67112c5fa1e2d17abde88a2312151dc 100644 (file)
@@ -359,8 +359,9 @@ typedef struct RenderData {
        float bg_stamp[4];
 
        /* render simplify */
-       int simplify_subsurf;
-       int simplify_shadowsamples;
+       int simplify_flag;
+       short simplify_subsurf;
+       short simplify_shadowsamples;
        float simplify_particles;
        float simplify_aosss;
 
@@ -966,6 +967,9 @@ typedef struct Scene {
 #define R_BAKE_SPACE_OBJECT     2
 #define R_BAKE_SPACE_TANGENT 3
 
+/* simplify_flag */
+#define R_SIMPLE_NO_TRIANGULATE                1
+
 /* **************** SCENE ********************* */
 
 /* for general use */
index 416058946132e6426b68795cb866a2ab2dd9c38e..12415d1c6355c74d28b466b318b5932a1d12afd4 100644 (file)
@@ -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_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 */
        RNA_api_scene_render(srna);
 }
index a8afc40f04d6cc314f12a1803a3ff513e150ab89..0b818ca761efc9a24e139b36d2443241c4ca77e5 100644 (file)
@@ -4098,7 +4098,8 @@ static void finalize_render_object(Render *re, ObjectRen *obr, int timeoffset)
                                /* Baking lets us define a quad split order */
                                split_quads(obr, re->r.bake_quad_split);
                        } 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);