diff options
author | Andre Susano Pinto <andresusanopinto@gmail.com> | 2009-09-25 02:55:57 +0400 |
---|---|---|
committer | Andre Susano Pinto <andresusanopinto@gmail.com> | 2009-09-25 02:55:57 +0400 |
commit | 1305715d2d84f67027b870f263cef3a7f009c056 (patch) | |
tree | 50076f8e30adb6f12735fc486abfa11e138511ec /source/blender/render/intern/include | |
parent | d3e88cb3e0d4117ab845a7c77254a5ab05ce1657 (diff) |
*Added VlakPrimitive (this rayobject rimitive only stores ObjectRenderInstance and VlakRen pointers)
- it difers from RayFace that localy stored the vertex coordinates.
- basicaly this reduces memory usage
Diffstat (limited to 'source/blender/render/intern/include')
-rw-r--r-- | source/blender/render/intern/include/rayobject.h | 27 | ||||
-rw-r--r-- | source/blender/render/intern/include/render_types.h | 3 |
2 files changed, 12 insertions, 18 deletions
diff --git a/source/blender/render/intern/include/rayobject.h b/source/blender/render/intern/include/rayobject.h index dbd68fe8b8b..337f9ca3fdd 100644 --- a/source/blender/render/intern/include/rayobject.h +++ b/source/blender/render/intern/include/rayobject.h @@ -57,17 +57,18 @@ extern "C" { In order to allow a mixture of RayFace+RayObjects, all RayObjects must be 4byte aligned, allowing us to use the - 2 least significant bits (with the mask 0x02) to define the + 2 least significant bits (with the mask 0x03) to define the type of RayObject. - This leads to 4 possible types of RayObject, but at the moment - only 2 are used: + This leads to 4 possible types of RayObject: - addr&2 - type of object + addr&3 - type of object 0 Self (reserved for each structure) - 1 RayFace + 1 RayFace (tri/quad primitive) 2 RayObject (generic with API callbacks) - 3 RayObject_Vlak + 3 VlakPrimitive + (vlak primitive - to be used when we have a vlak describing the data + eg.: on render code) 0 means it's reserved and has it own meaning inside each ray acceleration structure (this way each structure can use the allign offset to determine if a node represents a @@ -83,26 +84,16 @@ extern "C" { /* used to unalign a given ray object */ #define RE_rayobject_unalignRayFace(o) ((RayObject*)(((intptr_t)o)|1)) #define RE_rayobject_unalignRayAPI(o) ((RayObject*)(((intptr_t)o)|2)) -#define RE_rayobject_unalignRayVlak(o) ((RayObject*)(((intptr_t)o)|3)) +#define RE_rayobject_unalignVlakPrimitive(o) ((RayObject*)(((intptr_t)o)|3)) /* used to test the type of ray object */ #define RE_rayobject_isAligned(o) ((((intptr_t)o)&3) == 0) #define RE_rayobject_isRayFace(o) ((((intptr_t)o)&3) == 1) #define RE_rayobject_isRayAPI(o) ((((intptr_t)o)&3) == 2) -#define RE_rayobject_isRayVlak(o) ((((intptr_t)o)&3) == 3) +#define RE_rayobject_isVlakPrimitive(o) ((((intptr_t)o)&3) == 3) /* - * This ray object represents faces directly from a given VlakRen structure. - * Thus allowing to save memory, but making code dependant on render structures -typedef struct RayVlak -{ - struct ObjectInstanceRen *ob; - struct VlakRen *face; -} RayVlak; - */ - -/* * This rayobject represents a generic object. With it's own callbacks for raytrace operations. * It's suitable to implement things like LOD. */ diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index 67c69259213..8c106f60e1d 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -172,6 +172,7 @@ struct Render /* octree tables and variables for raytrace */ struct RayObject *raytree; struct RayFace *rayfaces; + struct VlakPrimitive *rayprimitives; float maxdist; /* needed for keeping an incorrect behaviour of SUN and HEMI lights (avoid breaking old scenes) */ /* occlusion tree */ @@ -289,6 +290,7 @@ typedef struct ObjectRen { /* used on makeraytree */ struct RayObject *raytree; struct RayFace *rayfaces; + struct VlakPrimitive *rayprimitives; struct ObjectInstanceRen *rayobi; } ObjectRen; @@ -313,6 +315,7 @@ typedef struct ObjectInstanceRen { /* used on makeraytree */ struct RayObject *raytree; + int transform_primitives; } ObjectInstanceRen; |