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:
authorNicholas Bishop <nicholasbishop@gmail.com>2012-03-06 06:40:08 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2012-03-06 06:40:08 +0400
commitc7ffe7f621810f61e53343850ce42f367830fad9 (patch)
treefb1559aeac12e64ab91bedd25a8bf6c153d68dbb /source/blender/blenkernel/BKE_subsurf.h
parent9c7e8e837d07ef4b6e296e6effd6eea2c53945e6 (diff)
Draw individual face's material and shading correctly in the PBVH.
Previously, the shading and material was set once per PBVHNode when drawing. This is still the case, but PBVHNodes are now built to contain only one material and shading mode. This is done with an extra partitioning step; once the number of primitives in the node falls below the PBVH leaf limit, it's primitives are checked for matching materials. If more than one material or shading mode is present in the node, it is split and partitioned (partitioned by material rather than 3D location.) Given a sufficiently 'annoying' input, like a dense mesh with thousands of materials randomly scattered across it, this could greatly increase PBVH build time (since nodes might end up containing a single primitive), but in general this shouldn't come up. In order to support materials for grids, the CCGDM is building another grid array (of DMFaceMat structs). This could be used to replace CCGDM.faceFlag for some small memory savings (TODO).
Diffstat (limited to 'source/blender/blenkernel/BKE_subsurf.h')
-rw-r--r--source/blender/blenkernel/BKE_subsurf.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_subsurf.h b/source/blender/blenkernel/BKE_subsurf.h
index a85ef88473b..f3cdd858e7d 100644
--- a/source/blender/blenkernel/BKE_subsurf.h
+++ b/source/blender/blenkernel/BKE_subsurf.h
@@ -31,7 +31,7 @@
* \ingroup bke
*/
-struct DMFaceFlags;
+struct DMFlagMat;
struct DMGridAdjacency;
struct DMGridData;
struct DerivedMesh;
@@ -76,7 +76,7 @@ typedef struct CCGDerivedMesh {
int startFace; struct CCGFace *face;} *faceMap;
short *edgeFlags;
- struct DMFaceFlags *faceFlags;
+ struct DMFlagMat *faceFlags;
int *reverseFaceMap;
@@ -91,6 +91,7 @@ typedef struct CCGDerivedMesh {
struct DMGridAdjacency *gridAdjacency;
int *gridOffset;
struct CCGFace **gridFaces;
+ struct DMFlagMat *gridFlagMats;
struct {
struct MultiresModifierData *mmd;