Revision: 23593 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23593 Author: jaguarandi Date: 2009-10-01 20:30:59 +0200 (Thu, 01 Oct 2009)
Log Message: ----------- *Updated UI options and added UI options to: control whether instances are used or not control whether vertexs are stored localy or not *Removed unsused code Modified Paths: -------------- branches/soc-2009-jaguarandi/release/scripts/ui/buttons_scene.py branches/soc-2009-jaguarandi/source/blender/makesdna/DNA_scene_types.h branches/soc-2009-jaguarandi/source/blender/makesrna/intern/rna_scene.c branches/soc-2009-jaguarandi/source/blender/render/SConscript branches/soc-2009-jaguarandi/source/blender/render/extern/include/RE_raytrace.h branches/soc-2009-jaguarandi/source/blender/render/intern/raytrace/rayobject.cpp branches/soc-2009-jaguarandi/source/blender/render/intern/raytrace/rayobject_qbvh.cpp branches/soc-2009-jaguarandi/source/blender/render/intern/raytrace/rayobject_svbvh.cpp branches/soc-2009-jaguarandi/source/blender/render/intern/raytrace/rayobject_vbvh.cpp branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayobject_blibvh.c branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayobject_octree.c branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayshade.c Removed Paths: ------------- branches/soc-2009-jaguarandi/source/blender/render/intern/raytrace/rayobject_bih.cpp branches/soc-2009-jaguarandi/source/blender/render/intern/raytrace/rayobject_bvh.cpp Modified: branches/soc-2009-jaguarandi/release/scripts/ui/buttons_scene.py =================================================================== --- branches/soc-2009-jaguarandi/release/scripts/ui/buttons_scene.py 2009-10-01 18:00:00 UTC (rev 23592) +++ branches/soc-2009-jaguarandi/release/scripts/ui/buttons_scene.py 2009-10-01 18:30:59 UTC (rev 23593) @@ -171,8 +171,11 @@ sub.itemR(rd, "free_image_textures") sub = col.column() sub.active = rd.render_raytracing - sub.itemL(text="Ray Tracing Octree:") - sub.itemR(rd, "octree_resolution", text="") + sub.itemL(text="Acceleration structure:") + sub.itemR(rd, "raytrace_structure", text="") + sub.itemR(rd, "use_instances", text="Instance support") + sub.itemR(rd, "use_local_coords", text="Local coords") + sub.itemR(rd, "octree_resolution", text="Octree resolution") class SCENE_PT_post_processing(RenderButtonsPanel): __label__ = "Post Processing" Modified: branches/soc-2009-jaguarandi/source/blender/makesdna/DNA_scene_types.h =================================================================== --- branches/soc-2009-jaguarandi/source/blender/makesdna/DNA_scene_types.h 2009-10-01 18:00:00 UTC (rev 23592) +++ branches/soc-2009-jaguarandi/source/blender/makesdna/DNA_scene_types.h 2009-10-01 18:30:59 UTC (rev 23593) @@ -242,12 +242,23 @@ */ int mode; - /* render engine (deprecated), octree resolution */ - short renderer, ocres; - short raystructure; - short raytrace_tree_type; - short pad4[2]; + /** + * Flags for raytrace settings. Use bit-masking to access the settings. + */ + int raytrace_options; + + /** + * Raytrace acceleration structure + */ + short raytrace_structure; + /* renderer (deprecated) */ + short renderer; + + /* octree resolution */ + short ocres; + short pad4; + /** * What to do with the sky/background. Picks sky/premul/key * blending for the background @@ -260,6 +271,7 @@ short osa; short frs_sec, edgeint; + /* safety, border and display rect */ rctf safety, border; @@ -808,8 +820,11 @@ #define R_RAYSTRUCTURE_VBVH 3 #define R_RAYSTRUCTURE_SIMD_SVBVH 4 /* needs SIMD */ #define R_RAYSTRUCTURE_SIMD_QBVH 5 /* needs SIMD */ -#define R_RAYSTRUCTURE_BIH 6 +/* raytrace_options */ +#define R_RAYTRACE_USE_LOCAL_COORDS 0x0001 +#define R_RAYTRACE_USE_INSTANCES 0x0002 + /* scemode (int now) */ #define R_DOSEQ 0x0001 #define R_BG_RENDER 0x0002 Modified: branches/soc-2009-jaguarandi/source/blender/makesrna/intern/rna_scene.c =================================================================== --- branches/soc-2009-jaguarandi/source/blender/makesrna/intern/rna_scene.c 2009-10-01 18:00:00 UTC (rev 23592) +++ branches/soc-2009-jaguarandi/source/blender/makesrna/intern/rna_scene.c 2009-10-01 18:30:59 UTC (rev 23593) @@ -1185,7 +1185,6 @@ {R_RAYSTRUCTURE_VBVH, "R_RAYSTRUCTURE_VBVH", 0, "vBVH", ""}, {R_RAYSTRUCTURE_SIMD_SVBVH, "R_RAYSTRUCTURE_SIMD_SVBVH", 0, "SIMD SVBVH", "Requires SIMD"}, {R_RAYSTRUCTURE_SIMD_QBVH, "R_RAYSTRUCTURE_SIMD_QBVH", 0, "SIMD QBVH", "Requires SIMD"}, - {R_RAYSTRUCTURE_BIH, "R_RAYSTRUCTURE_BIH", 0, "BIH", ""}, {0, NULL, 0, NULL, NULL} }; @@ -1618,11 +1617,22 @@ RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "raytrace_structure", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "raystructure"); + RNA_def_property_enum_sdna(prop, NULL, "raytrace_structure"); RNA_def_property_enum_items(prop, raytrace_structure_items); RNA_def_property_ui_text(prop, "Raytrace Acceleration Structure", "Type of raytrace accelerator structure."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + prop= RNA_def_property(srna, "use_instances", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_INSTANCES); + RNA_def_property_ui_text(prop, "Use Instances", "Instance support leads to effective memory reduction when using duplicates."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "use_local_coords", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "raytrace_options", R_RAYTRACE_USE_LOCAL_COORDS); + RNA_def_property_ui_text(prop, "Use Local Coords", "Vertex coordinates are stored localy on each primitive. Increases memory usage, but may have impact on speed."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "antialiasing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_OSA); RNA_def_property_ui_text(prop, "Anti-Aliasing", "Render and combine multiple samples per pixel to prevent jagged edges."); Modified: branches/soc-2009-jaguarandi/source/blender/render/SConscript =================================================================== --- branches/soc-2009-jaguarandi/source/blender/render/SConscript 2009-10-01 18:00:00 UTC (rev 23592) +++ branches/soc-2009-jaguarandi/source/blender/render/SConscript 2009-10-01 18:30:59 UTC (rev 23593) @@ -1,8 +1,8 @@ #!/usr/bin/python Import ('env') -cflags = ['-msse2','-mfpmath=sse'] -cxxflags = ['-msse2','-mfpmath=sse'] +cflags = ['-O2','-msse2','-mfpmath=sse'] +cxxflags = ['-O2','-msse2','-mfpmath=sse'] sources = env.Glob('intern/source/*.c') raysources = env.Glob('intern/raytrace/*.cpp') Modified: branches/soc-2009-jaguarandi/source/blender/render/extern/include/RE_raytrace.h =================================================================== --- branches/soc-2009-jaguarandi/source/blender/render/extern/include/RE_raytrace.h 2009-10-01 18:00:00 UTC (rev 23592) +++ branches/soc-2009-jaguarandi/source/blender/render/extern/include/RE_raytrace.h 2009-10-01 18:30:59 UTC (rev 23593) @@ -85,11 +85,9 @@ RayObject* RE_rayobject_instance_create(RayObject *target, float transform[][4], void *ob, void *target_ob); RayObject* RE_rayobject_blibvh_create(int size); /* BLI_kdopbvh.c */ -RayObject* RE_rayobject_bvh_create(int size); /* raytrace/rayobject_bvh.c */ RayObject* RE_rayobject_vbvh_create(int size); /* raytrace/rayobject_vbvh.c */ -RayObject* RE_rayobject_qbvh_create(int size); /* raytrace/rayobject_qbvh.c */ RayObject* RE_rayobject_svbvh_create(int size); /* raytrace/rayobject_svbvh.c */ -RayObject* RE_rayobject_bih_create(int size); /* rayobject_bih.c */ +RayObject* RE_rayobject_qbvh_create(int size); /* raytrace/rayobject_qbvh.c */ /* Modified: branches/soc-2009-jaguarandi/source/blender/render/intern/raytrace/rayobject.cpp =================================================================== --- branches/soc-2009-jaguarandi/source/blender/render/intern/raytrace/rayobject.cpp 2009-10-01 18:00:00 UTC (rev 23592) +++ branches/soc-2009-jaguarandi/source/blender/render/intern/raytrace/rayobject.cpp 2009-10-01 18:30:59 UTC (rev 23593) @@ -142,7 +142,7 @@ return 0; } -static int vlr_check_intersect(Isect *is, ObjectInstanceRen *obi, VlakRen *vlr) +static inline int vlr_check_intersect(Isect *is, ObjectInstanceRen *obi, VlakRen *vlr) { /* for baking selected to active non-traceable materials might still * be in the raytree */ @@ -156,7 +156,7 @@ return (is->lay & obi->lay); } -static int vlr_check_intersect_solid(Isect *is, ObjectInstanceRen* obi, VlakRen *vlr) +static inline int vlr_check_intersect_solid(Isect *is, ObjectInstanceRen* obi, VlakRen *vlr) { /* solid material types only */ if (vlr->mat->material_type == MA_TYPE_SURFACE) @@ -165,7 +165,7 @@ return 0; } -static int rayface_check_cullface(RayFace *face, Isect *is) +static inline int rayface_check_cullface(RayFace *face, Isect *is) { float nor[3]; @@ -189,7 +189,7 @@ if(is->orig.ob == face->ob && is->orig.face == face->face) return 0; -/* + if(is->skip & RE_SKIP_VLR_RENDER_CHECK) { if(vlr_check_intersect(is, (ObjectInstanceRen*)face->ob, (VlakRen*)face->face ) == 0) @@ -205,7 +205,7 @@ if(rayface_check_cullface(face, is) == 0) return 0; } -*/ + RE_RC_COUNT(is->raycounter->faces.test); //Load coords Deleted: branches/soc-2009-jaguarandi/source/blender/render/intern/raytrace/rayobject_bih.cpp =================================================================== --- branches/soc-2009-jaguarandi/source/blender/render/intern/raytrace/rayobject_bih.cpp 2009-10-01 18:00:00 UTC (rev 23592) +++ branches/soc-2009-jaguarandi/source/blender/render/intern/raytrace/rayobject_bih.cpp 2009-10-01 18:30:59 UTC (rev 23593) @@ -1,248 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2009 Blender Foundation. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): André Pinto. - * - * ***** END GPL LICENSE BLOCK ***** - */ -#include <assert.h> -#include <stdio.h> - -#include "MEM_guardedalloc.h" -#include "BKE_utildefines.h" -#include "BLI_arithb.h" -#include "RE_raytrace.h" -#include "rayobject_rtbuild.h" -#include "rayobject.h" - -#define BIH_NCHILDS 4 -typedef struct BIHTree BIHTree; - -static int bih_intersect(BIHTree *obj, Isect *isec); -static void bih_add(BIHTree *o, RayObject *ob); -static void bih_done(BIHTree *o); -static void bih_free(BIHTree *o); -static void bih_bb(BIHTree *o, float *min, float *max); - -static RayObjectAPI bih_api = -{ - (RE_rayobject_raycast_callback) bih_intersect, - (RE_rayobject_add_callback) bih_add, - (RE_rayobject_done_callback) bih_done, - (RE_rayobject_free_callback) bih_free, - (RE_rayobject_merge_bb_callback)bih_bb -}; - -typedef struct BIHNode BIHNode; -struct BIHNode -{ - BIHNode *child[BIH_NCHILDS]; - float bi[BIH_NCHILDS][2]; - int split_axis; -}; - -struct BIHTree -{ - RayObject rayobj; - - BIHNode *root; - - BIHNode *node_alloc, *node_next; @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs