Rendercache (lx-rendercache.hpp)
Contents
- 1 RenderCache SDK ILxRenderCacheService
- 2 RenderCache SDK ILxRenderCache
- 2.1 (4) SDK: LXfRENDERCACHE_GEOCACHE_DISPLACE, etc. defines
- 2.2 (5) SDK: RenderCache::Time
- 2.3 (6) SDK: RenderCache::Update
- 2.4 (7) SDK: RenderCache::Clear
- 2.5 (8) SDK: RenderCache::GeoSurfaceCount
- 2.6 (9) SDK: RenderCache::GeoSurfaceAt
- 2.7 (10) SDK: CLxUser_RenderCache::GetGeoSurface method
- 2.8 (11) SDK: LXu_RENDERCACHE, etc. defines
- 3 RenderCache SDK ILxRenderCacheListener
- 3.1 (12) SDK: LXu_RENDERCACHELISTENER define
- 3.2 (13) SDK: RenderCacheListener::RenderCacheDestroy
- 3.3 (14) SDK: RenderCacheListener::UpdateBegin
- 3.4 (15) SDK: RenderCacheListener::UpdateEnd
- 3.5 (16) SDK: ILxRenderCacheListener interface
- 3.6 (17) SDK: ILxRenderCacheListener interface
- 3.7 (18) SDK: ILxRenderCacheListener interface
- 3.8 (19) SDK: ILxRenderCacheListener interface
- 3.9 (20) SDK: ILxRenderCacheListener interface
- 4 RenderCache SDK ILxGeoCacheSegment
- 4.1 (21) SDK: ILxGeoCacheSegment interface
- 4.2 (22) SDK: GeoCacheSegment::PolygonCount
- 4.3 (23) SDK: GeoCacheSegment::VertexCount
- 4.4 (24) SDK: GeoCacheSegment::VertsPerPoly
- 4.5 (25) SDK: GeoCacheSegment::VertexFeatureCount
- 4.6 (26) SDK: GeoCacheSegment::GetPolygonVertexFeature
- 4.7 (27) SDK: GeoCacheSegment::GetVertexFeature
- 4.8 (28) SDK: GeoCacheSegment::GetPolygonVertexInds
- 4.9 (29) SDK: empty GeoCacheSegment User Class
- 4.10 (30) SDK: LXu_GEOCACHESEGMENT, etc. defines
- 5 RenderCache SDK ILxGeoCacheSurface
- 5.1 (31) SDK: LXiRENDERCACHE_GEOVERT_OPOS, etc. defines
- 5.2 (32) SDK: LXtGeoCacheSrfVisibility struct
- 5.3 (33) SDK: GeoCacheSurface::ShaderMaskName
- 5.4 (34) SDK: GeoCacheSurface::ShaderMaskType
- 5.5 (35) SDK: GeoCacheSurface::SourceItem
- 5.6 (36) SDK: GeoCacheSurface::IsInstanced
- 5.7 (37) SDK: GeoCacheSurface::InstanceIndex
- 5.8 (38) SDK: GeoCacheSurface::SourceSurface
- 5.9 (39) SDK: GeoCacheSurface::GetBBox
- 5.10 (40) SDK: GeoCacheSurface::GetXfrm
- 5.11 (41) SDK: GeoCacheSurface::SegmentCount
- 5.12 (42) SDK: GeoCacheSurface::PolygonCount
- 5.13 (43) SDK: GeoCacheSurface::VertexCount
- 5.14 (44) SDK: GeoCacheSurface::SegmentAt
- 5.15 (45) SDK: GeoCacheSurface::VisibilityFlags
- 5.16 (46) SDK: GeoCacheSurface::ID
- 5.17 (47) SDK: GeoCacheSurface::IsValid
- 5.18 (48) SDK: GeoCacheSurface::LoadSegments
- 5.19 (49) SDK: GeoCacheSurface::UnloadSegments
- 5.20 (50) SDK: ILxGeoCacheSurface interface
- 5.21 (51) SDK: ILxGeoCacheSurface interface
- 5.22 (52) SDK: ILxGeoCacheSurface interface
- 5.23 (53) SDK: ILxGeoCacheSurface interface
- 5.24 (54) SDK: CLxUser_GeoCacheSurface::GetSourceItem method
- 5.25 (55) SDK: CLxUser_GeoCacheSurface::GetSourceSurface method
- 5.26 (56) SDK: CLxUser_GeoCacheSurface::GetSegment method
- 5.27 (57) SDK: LXu_GEOCACHESURFACE, etc. defines
RenderCache SDK ILxRenderCacheService
(1) SDK: LXu_RENDERCACHESERVICE, etc. defines
#define LXu_RENDERCACHESERVICE "138FF638-1E34-4CC6-BAFC-4F734969F47E" #define LXa_RENDERCACHESERVICE "rendercacheservice"
Create render cache. Caller can pass LXiRENDERCACHE_XXX flags to guide the cache initialization.
(2) SDK: RenderCacheService::CreateRenderCache
LXxMETHOD ( LxResult, CreateRenderCache) ( LXtObjectID self, void **ppvObj, unsigned int createFlags);
(3) SDK: CLxUser_RenderCacheService::NewRenderCache method
bool NewRenderCache ( CLxLoc_RenderCache &rcache, unsigned createFlags) { LXtObjectID obj; if (LXx_FAIL (CreateRenderCache (&obj, createFlags))) return false; return rcache.take (obj); }
RenderCache SDK ILxRenderCache
(4) SDK: LXfRENDERCACHE_GEOCACHE_DISPLACE, etc. defines
#define LXfRENDERCACHE_GEOCACHE_DISPLACE 0x1 #define LXfRENDERCACHE_GEOCACHE_GENFUR 0x2 #define LXfRENDERCACHE_FULL LXfRENDERCACHE_GEOCACHE_DISPLACE | LXfRENDERCACHE_GEOCACHE_GENFUR #define LXfRENDERCACHE_TRACK_CURRENT_SCENE 0x100 #define LXfRENDERCACHE_TURN_OFF_AUTO_UPDATES 0x200 #define LXfRENDERCACHE_FORCE_FULL_UPDATE 0x400
Return current render cache time and time offsets (for motion blur). Argument timeOffsets is an array of 2 double values.
(5) SDK: RenderCache::Time
LXxMETHOD ( void, Time) ( LXtObjectID self, double *time, double *timeOffsets);
Update render cache to given time. If render cache is created without LXfRENDERCACHE_TURN_OFF_AUTO_UPDATES flag, the method will return LXe_FAILED. If time is the same as internal time no update will happen. In that case specify the force to force the full render cache update.
(6) SDK: RenderCache::Update
LXxMETHOD ( LxResult, Update) ( LXtObjectID self, double time, int force);
Clear the render cache.
(7) SDK: RenderCache::Clear
LXxMETHOD ( void, Clear) ( LXtObjectID self);
Return number of geo cache surfaces.
(8) SDK: RenderCache::GeoSurfaceCount
LXxMETHOD ( LxResult, GeoSurfaceCount) ( LXtObjectID self, int *count);
Get geo cache surface at given index.
(9) SDK: RenderCache::GeoSurfaceAt
LXxMETHOD ( LxResult, GeoSurfaceAt) ( LXtObjectID self, int index, void **srf);
(10) SDK: CLxUser_RenderCache::GetGeoSurface method
bool GetGeoSurface ( int index, CLxLoc_GeoCacheSurface &srf) { LXtObjectID obj; if (LXx_FAIL (GeoSurfaceAt (index, &obj))) return false; return srf.set (obj); }
(11) SDK: LXu_RENDERCACHE, etc. defines
#define LXu_RENDERCACHE "1ED14AD3-B202-46FF-A720-A1DCFC0B893A" #define LXa_RENDERCACHE "rendercache"
RenderCache SDK ILxRenderCacheListener
(12) SDK: LXu_RENDERCACHELISTENER define
#define LXu_RENDERCACHELISTENER "E1EBCD71-B28A-42FB-9AF7-FADA18FEBFC6"
Called when render cache is being destroyed. This happens when user changes the current scene (if LXfRENDERCACHE_TRACK_CURRENT_SCENE was specified).
(13) SDK: RenderCacheListener::RenderCacheDestroy
LXxMETHOD (void, RenderCacheDestroy) ( LXtObjectID self);
(14) SDK: RenderCacheListener::UpdateBegin
LXxMETHOD (void, UpdateBegin) ( LXtObjectID self);
(15) SDK: RenderCacheListener::UpdateEnd
LXxMETHOD (void, UpdateEnd) ( LXtObjectID self);
Called after the geo surface has been added to cache.
(16) SDK: ILxRenderCacheListener interface
LXxMETHOD (void, GeoCacheSurfaceAdd )( LXtObjectID self, LXtObjectID geoSrf);
Called before the geo surface has been removed from cache.
(17) SDK: ILxRenderCacheListener interface
LXxMETHOD (void, GeoCacheSurfaceRemove )( LXtObjectID self, LXtObjectID geoSrf);
Called when the geo surface data has been changed (this method is called only for non-instanced surfaces).
(18) SDK: ILxRenderCacheListener interface
LXxMETHOD (void, GeoCacheSurfaceGeoUpdate )( LXtObjectID self, LXtObjectID geoSrf);
Called when the xform data has been changed.
(19) SDK: ILxRenderCacheListener interface
LXxMETHOD (void, GeoCacheSurfaceXformUpdate )( LXtObjectID self, LXtObjectID geoSrf);
Called when the shading data has been changed.
(20) SDK: ILxRenderCacheListener interface
LXxMETHOD (void, GeoCacheSurfaceShaderUpdate )( LXtObjectID self, LXtObjectID geoSrf);
RenderCache SDK ILxGeoCacheSegment
Return the segment's bounding box in the world-space.
(21) SDK: ILxGeoCacheSegment interface
LXxMETHOD ( LxResult, GetBBox ) ( LXtObjectID self, LXtBBox *bbox);
(22) SDK: GeoCacheSegment::PolygonCount
LXxMETHOD ( void, PolygonCount) ( LXtObjectID self, int *count);
(23) SDK: GeoCacheSegment::VertexCount
LXxMETHOD ( void, VertexCount) ( LXtObjectID self, int *count);
All polygons in the segments have same number of vertices in the polygon. It can be 3 for triangles, 2 for curves and (hair & fur) and 1 for particles.
(24) SDK: GeoCacheSegment::VertsPerPoly
LXxMETHOD ( void, VertsPerPoly) ( LXtObjectID self, int *count);
Return if the vertex feature is stored in the segment. OPOS and ONRM are always stored. The count for WVEL, RAD and FUR will be either 0 or 1. For UV, DPDU and DPDV the count will return how many UV vmaps are stored in the segment.
(25) SDK: GeoCacheSegment::VertexFeatureCount
LXxMETHOD ( void, VertexFeatureCount) ( LXtObjectID self, int feature, int *count);
Segment vertex feature is copied per-polygon-per-vertex into client's memory (like a triangle soup). Caller can specify the start offset into the segment's data. The start and count are in number of elements which are from 0 to VertsPerPoly * PolygonCount (not in byte size).
(26) SDK: GeoCacheSegment::GetPolygonVertexFeature
LXxMETHOD ( LxResult, GetPolygonVertexFeature) ( LXtObjectID self, int feature, void *featureData, int count, int start);
Segment vertex feature is copied per-vertex into client's memory. Caller can specify the start offset into the segment's data. The start and count are in number of elements which are from 0 to VertexCount (not in byte size).
(27) SDK: GeoCacheSegment::GetVertexFeature
LXxMETHOD ( LxResult, GetVertexFeature) ( LXtObjectID self, int feature, void *featureData, int count, int start);
Copy polygon vertex indices into client's memory. Caller can specify the start offset into the segment's data. The start and count are in number of elements which are from 0 to VertsPerPoly * PolygonVertexCount (not in byte size).
(28) SDK: GeoCacheSegment::GetPolygonVertexInds
LXxMETHOD (LxResult, GetPolygonVertexInds) ( LXtObjectID self, int *polyVertexInds, int count, int start);
(29) SDK: empty GeoCacheSegment User Class
(30) SDK: LXu_GEOCACHESEGMENT, etc. defines
#define LXu_GEOCACHESEGMENT "CDA6EDAD-8E71-4EA9-A05A-326CEAD7DE9B" #define LXa_GEOCACHESEGMENT "rendercachegeosegment"
RenderCache SDK ILxGeoCacheSurface
(31) SDK: LXiRENDERCACHE_GEOVERT_OPOS, etc. defines
#define LXiRENDERCACHE_GEOVERT_OPOS 0 // Object-space position (LXtFVector) #define LXiRENDERCACHE_GEOVERT_ONRM 1 // Object-space normal (LXtFVector) #define LXiRENDERCACHE_GEOVERT_OVEL 2 // Object-space velocity (LXtFVector) #define LXiRENDERCACHE_GEOVERT_RAD 3 // Vertex radius (float) #define LXiRENDERCACHE_GEOVERT_FUR 4 // Fur params (LXtFVector [U, V(=lenParm), id]) #define LXiRENDERCACHE_GEOVERT_UV 0x100 // Vertex UV coords. (LXtFVector2) #define LXiRENDERCACHE_GEOVERT_DPDU 0x200 // Vertex UV derivatives (LXtFVector3) #define LXiRENDERCACHE_GEOVERT_DPDV 0x300 // Vertex UV derivatives (LXtFVector3)
Surface visibility flags
(32) SDK: LXtGeoCacheSrfVisibility struct
unsigned camera : 1; unsigned indirect : 1; unsigned reflection : 1; unsigned refraction : 1; unsigned subscatter : 1; unsigned occlusion : 1;
Obtain geo surface shader mask name (for example Surf(ShaderMaskName)).
(33) SDK: GeoCacheSurface::ShaderMaskName
LXxMETHOD ( LxResult, ShaderMaskName) ( LXtObjectID self, const char **name);
Returns one of LXi_SURF_XXX flags.
(34) SDK: GeoCacheSurface::ShaderMaskType
LXxMETHOD ( int, ShaderMaskType) ( LXtObjectID self);
Every surface has a source item. For replicated and instanced surfaces this method will return the source mesh.
(35) SDK: GeoCacheSurface::SourceItem
LXxMETHOD ( LxResult, SourceItem) ( LXtObjectID self, void **ppvObj);
Returns 1 if surface is instanced.
(36) SDK: GeoCacheSurface::IsInstanced
LXxMETHOD ( int, IsInstanced) ( LXtObjectID self);
Returns surface instance index, if surface is not instanced the returned value is -1.
(37) SDK: GeoCacheSurface::InstanceIndex
LXxMETHOD ( int, InstanceIndex) ( LXtObjectID self);
If geo surface is instanced then it doesn't contain any geometry segments. This mehtod returns the source geo cache surface which contains the segment data.
(38) SDK: GeoCacheSurface::SourceSurface
LXxMETHOD ( LxResult, SourceSurface) ( LXtObjectID self, void **ppvObj);
Obtain surface's bounding box.
(39) SDK: GeoCacheSurface::GetBBox
LXxMETHOD ( LxResult, GetBBox) ( LXtObjectID self, LXtBBox *bbox);
Return surface's xform information at given time endpoint (T0 or T1). T0 (=0) is time for shutter open, T1 (=1) is time for shutter close.
(40) SDK: GeoCacheSurface::GetXfrm
LXxMETHOD ( LxResult, GetXfrm) ( LXtObjectID self, LXtVector pos, LXtMatrix rot, LXtVector scl, int endpoint);
Return how many segments are in this surface.
(41) SDK: GeoCacheSurface::SegmentCount
LXxMETHOD ( void, SegmentCount) ( LXtObjectID self, int *count);
Return how many polygons are in this surface.
(42) SDK: GeoCacheSurface::PolygonCount
LXxMETHOD ( void, PolygonCount) ( LXtObjectID self, int *count);
Return how many vertices are in this surface.
(43) SDK: GeoCacheSurface::VertexCount
LXxMETHOD ( void, VertexCount) ( LXtObjectID self, int *count);
Get segment by index
(44) SDK: GeoCacheSurface::SegmentAt
LXxMETHOD ( LxResult, SegmentAt) ( LXtObjectID self, int index, void **segment);
Return surface visibility flags (visible in camera, etc.)
(45) SDK: GeoCacheSurface::VisibilityFlags
LXxMETHOD ( LxResult, VisibilityFlags) ( LXtObjectID self, LXtGeoCacheSrfVisibility *flags);
Return surface unique id.
(46) SDK: GeoCacheSurface::ID
LXxMETHOD ( int, ID) ( LXtObjectID self);
Return if surface is valid, i.e. not deleted.
(47) SDK: GeoCacheSurface::IsValid
LXxMETHOD ( int, IsValid) ( LXtObjectID self);
Populate geometry segments with vertices and polygons. If surface is already populated this method will do nothing. Use this method when you want to populate geometry cache on-demand.
(48) SDK: GeoCacheSurface::LoadSegments
LXxMETHOD ( LxResult, LoadSegments) ( LXtObjectID self);
(49) SDK: GeoCacheSurface::UnloadSegments
LXxMETHOD ( LxResult, UnloadSegments) ( LXtObjectID self);
Return ILxTableauVertexID which can be used to query vertex information.
(50) SDK: ILxGeoCacheSurface interface
LXxMETHOD ( ILxTableauVertexID, GetVertexDesc )( LXtObjectID self);
(51) SDK: ILxGeoCacheSurface interface
LXxMETHOD (const char*, MaterialPTag ) ( LXtObjectID self);
(52) SDK: ILxGeoCacheSurface interface
LXxMETHOD (const char*, PartPTag ) ( LXtObjectID self);
(53) SDK: ILxGeoCacheSurface interface
LXxMETHOD (const char*, PickPTag ) ( LXtObjectID self);
(54) SDK: CLxUser_GeoCacheSurface::GetSourceItem method
bool GetSourceItem ( CLxLoc_Item &item) { LXtObjectID obj; if (LXx_FAIL (SourceItem (&obj))) return false; return item.set (obj); }
(55) SDK: CLxUser_GeoCacheSurface::GetSourceSurface method
bool GetSourceSurface ( CLxLoc_GeoCacheSurface &srf) { LXtObjectID obj; if (LXx_FAIL (SourceSurface (&obj))) return false; return srf.set (obj); }
(56) SDK: CLxUser_GeoCacheSurface::GetSegment method
bool GetSegment ( int index, CLxLoc_GeoCacheSegment &seg) { LXtObjectID obj; if (LXx_FAIL (SegmentAt (index, &obj))) return false; return seg.set (obj); }
(57) SDK: LXu_GEOCACHESURFACE, etc. defines
#define LXu_GEOCACHESURFACE "770BD566-315B-4EEC-A2A5-266D122D8DDF" #define LXa_GEOCACHESURFACE "rendercachegeosurface"