|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CPatch Class ReferenceA landscape patch.
More...
#include <patch.h>
Collaboration diagram for NL3D::CPatch:
[legend]List of all members.
Public Methods |
| CPatch () |
| Constructor. More...
|
| ~CPatch () |
| dtor. More...
|
void | compile (CZone *z, uint8 orderS, uint8 orderT, CTessVertex *baseVertices[4], float errorSize=0) |
| compile a valid patch. More...
|
void | release () |
| Un-compile a patch. Tesselation is deleted. if patch is not compiled, no - op. More...
|
CZone* | getZone () const |
uint8 | getOrderS () const |
uint8 | getOrderT () const |
float | getErrorSize () const |
sint | getFar0 () const |
sint | getFar1 () const |
CAABBox | buildBBox () const |
| Build the bbox of the patch, according to ctrl points, and displacement map max value. More...
|
const CBSphere& | getBSphere () const |
| Return the bounding sphere. Work only when zone compiled. More...
|
CVector | computeVertex (float s, float t) const |
| Compute a vertex. More...
|
void | unbind (CPatch *except[4]) |
| unbind the patch from All neighbors. More...
|
void | bind (CBindInfo Edges[4]) |
| bind the patch to 4 neighbors, given in this patch edge order (0,1,2,3). More...
|
void | forceMergeAtTileLevel () |
| For changing TileMaxSubdivision. force tesselation to be under tile. More...
|
void | forceNoClip () |
| Classify this patch as UnClipped. More...
|
void | forceClip () |
| Classify this patch as Clipped. More...
|
void | clip (const std::vector<CPlane> &pyramid) |
| Classify this patch. More...
|
void | refine () |
| Refine / geomorph this patch. Even if clipped. More...
|
void | preRender (const std::vector<CPlane> &pyramid) |
| preRender this patch, if not clipped. Build RdrFace List .... More...
|
void | renderFar0 () |
| Render this patch, if not clipped (append to VertexBuffers / materials primitive block). More...
|
void | renderFar1 () |
void | renderTile (sint pass) |
void | resetRenderFar () |
void | deleteTileUvs () |
void | recreateTileUvs () |
void | serial (NLMISC::IStream &f) |
void | unpack (CBezierPatch &p) const |
void | expandShading (uint8 * Shading, uint ratio=1) |
| Expand the shading part of the patch in bilinear. More...
|
void | unpackShadowMap (class CTileLumel *pShadow, uint ratio=1) |
| Unpack the lumels of the patches. More...
|
void | packShadowMap (const class CTileLumel *pLumel) |
| Pack the lumels of the patches. More...
|
void | resetCompressedLumels () |
| Rebuild the packed lumels without shadow. More...
|
void | clearUncompressedLumels () |
| Clear the uncompressed lumel of the patch. More...
|
void | setSmoothFlag (uint edge, bool flag) |
| Set the smooth flag for the n-th edge. More...
|
bool | getSmoothFlag (uint edge) |
| Get the smooth flag for the n-th edge. More...
|
bool | isClipped () const |
Public Attributes |
CVector3s | Vertices [4] |
| The patch coordinates (see CBezierPatch). More...
|
CVector3s | Tangents [8] |
CVector3s | Interiors [4] |
std::vector<uint8> | CompressedLumels |
std::vector<CTileLumel> | UncompressedLumels |
std::vector<CTileElement> | Tiles |
std::vector<CTileColor> | TileColors |
Private Types |
enum | TFarVertType {
FVMasterBlock = 0,
FVTessBlock,
FVTessBlockEdge
} |
Private Methods |
void | computeDefaultErrorSize () |
void | makeRoots () |
CTessFace* | getRootFaceForEdge (sint edge) const |
CTessVertex* | getRootVertexForEdge (sint edge) const |
void | changeEdgeNeighbor (sint edge, CTessFace *to) |
void | resetMasterBlock () |
void | clearTessBlocks () |
void | addRefTessBlocks () |
void | decRefTessBlocks () |
uint | getNumTessBlock (CTessFace *face) |
void | getNumTessBlock (CParamCoord pc, TFarVertType &type, uint &numtb) |
void | appendFaceToRenderList (CTessFace *face) |
void | removeFaceFromRenderList (CTessFace *face) |
void | appendFaceToTileRenderList (CTessFace *face) |
void | removeFaceFromTileRenderList (CTessFace *face) |
void | appendTileMaterialToRenderList (CTileMaterial *tm) |
void | removeTileMaterialFromRenderList (CTileMaterial *tm) |
void | appendFarVertexToRenderList (CTessFarVertex *fv) |
void | removeFarVertexFromRenderList (CTessFarVertex *fv) |
void | appendNearVertexToRenderList (CTileMaterial *tileMat, CTessNearVertex *nv) |
void | removeNearVertexFromRenderList (CTileMaterial *tileMat, CTessNearVertex *nv) |
CPatchRdrPass* | getTileRenderPass (sint tileId, sint pass) |
void | getTileUvInfo (sint tileId, sint pass, bool alpha, uint8 &orient, CVector &uvScaleBias, bool &is256x256, uint8 &uvOff) |
uint | getTileLightMap (sint ts, sint tt, CPatchRdrPass *&rdrpass) |
void | getTileLightMapUvInfo (uint tileLightMapId, CVector &uvScaleBias) |
void | releaseTileLightMap (uint tileLightMapId) |
void | fillFar0VB (CTessList<CTessFarVertex> &vertList) |
void | fillFar1VB (CTessList<CTessFarVertex> &vertList) |
void | fillTileVB (CTessList<CTessNearVertex> &vertList) |
void | addFar0TriList (CPatchRdrPass *pass, CTessList<CTessFace> &flist) |
void | addFar1TriList (CPatchRdrPass *pass, CTessList<CTessFace> &flist) |
void | addTileTriList (CPatchRdrPass *pass, CTessList<CTileFace> &flist) |
CBezierPatch* | unpackIntoCache () const |
Private Attributes |
CZone* | Zone |
uint8 | OrderS |
uint8 | OrderT |
sint | TessBlockLimitLevel |
sint | TileLimitLevel |
sint | SquareLimitLevel |
float | ErrorSize |
CTessFace* | Son0 |
CTessFace * | Son1 |
CTessVertex* | BaseVertices [4] |
CTessFarVertex | BaseFarVertices [4] |
CBSphere | BSphere |
sint | Far0 |
sint | Far1 |
float | Far0UScale |
float | Far0VScale |
float | Far0UBias |
float | Far0VBias |
float | Far1UScale |
float | Far1VScale |
float | Far1UBias |
float | Far1VBias |
uint8 | Flags |
| Flags NL_PATCH_FAR0_ROTATED and NL_PATCH_FAR1_ROTATED NL_PATCH_FAR0_ROTATED for Far0, NL_PATCH_FAR1_ROTATED for Far1 If the flag is set, the far texture of the patch is rotated of 1 (to the left of course). More...
|
bool | Clipped |
bool | ComputeTileErrorMetric |
bool | TileFarTransition |
CPatchRdrPass* | Pass0 |
CPatchRdrPass * | Pass1 |
float | TransitionSqrMin |
float | OOTransitionSqrDelta |
CTessBlock | MasterBlock |
std::vector<CTessBlock> | TessBlocks |
sint | TessBlockRefCount |
Static Private Attributes |
uint8 | _ShadingBuffer [] |
| Static buffer used to expand shading in expandShading. More...
|
uint32 | _Version = 2 |
| Stream version of the class. More...
|
CBezierPatch | CachePatch |
const CPatch* | LastPatch = NULL |
Friends |
class | CTessFace |
class | CZone |
Detailed Description
A landscape patch.
QuadPatch layout (same notations as 3ds Max SDK).
A---> ad ---- da <---D | | | | v v ab ia id dc
| | | |
ba ib ic cd ^ ^ | | | | B---> bc ---- cb <---C
NB: Patch 1x1 or 1xX are illegal: lot of problem: rectangular geomoprh, Son0 and Son1 must be setup as tile at beginning ...
NB: Edges number are:
-
Author(s):
-
Lionel Berenguier , Nevrax France
-
Date:
-
2000
Definition at line 132 of file patch.h.
Member Enumeration Documentation
enum NL3D::CPatch::TFarVertType [private]
|
|
|
-
Enumeration values:
-
FVMasterBlock
|
|
FVTessBlock
|
|
FVTessBlockEdge
|
|
Definition at line 447 of file patch.h. |
Constructor & Destructor Documentation
NL3D::CPatch::~CPatch (
|
)
|
|
Member Function Documentation
void NL3D::CPatch::addRefTessBlocks (
|
) [private]
|
|
void NL3D::CPatch::appendFaceToRenderList (
|
CTessFace * face ) [private]
|
|
void NL3D::CPatch::appendFaceToTileRenderList (
|
CTessFace * face ) [private]
|
|
void NL3D::CPatch::appendFarVertexToRenderList (
|
CTessFarVertex * fv ) [private]
|
|
void NL3D::CPatch::appendTileMaterialToRenderList (
|
CTileMaterial * tm ) [private]
|
|
void NL3D::CPatch::bind (
|
CBindInfo Edges[4] )
|
|
|
bind the patch to 4 neighbors, given in this patch edge order (0,1,2,3).
Tesselation is reseted (patch unbound first). NB: this patch and his neighborood must be compiled... NB: neighbor patchs must not be NULL (but according to NPatchs).
Definition at line 1427 of file patch.cpp. |
CAABBox NL3D::CPatch::buildBBox (
|
) const
|
|
|
Build the bbox of the patch, according to ctrl points, and displacement map max value.
Definition at line 143 of file patch.cpp. |
void NL3D::CPatch::changeEdgeNeighbor (
|
sint edge,
|
|
CTessFace * to ) [private]
|
|
void NL3D::CPatch::clearTessBlocks (
|
) [private]
|
|
void NL3D::CPatch::clearUncompressedLumels (
|
)
|
|
void NL3D::CPatch::clip (
|
const std::vector< CPlane >& pyramid )
|
|
|
Classify this patch.
Definition at line 709 of file patch.cpp. |
|
compile a valid patch.
(init) Call this method before any other. Zone and Control points must be valid before calling compile().
This is an ERROR to call compile() two times.
-
Parameters:
-
z
|
zone where the patch must be binded. |
orderS
|
the Tile order in S direction: 2,4,8,16. |
orderT
|
the Tile order in T direction: 2,4,8,16. |
errorSize
|
if 0, setup() compute himself the errormetric of the patch. May be setup to surface of patch, modulated by tangents and displacement map. |
Definition at line 625 of file patch.cpp. |
void NL3D::CPatch::computeDefaultErrorSize (
|
) [private]
|
|
CVector NL3D::CPatch::computeVertex (
|
float s,
|
|
float t ) const
|
|
|
Compute a vertex.
Compute a vertex according to:
- s,t
- patch control points uncompressed with zone Bias/Scale.
Patch UV geometric correction.
- Patch noise (and noise of Patch neighbor).
Definition at line 671 of file patch.cpp. |
void NL3D::CPatch::decRefTessBlocks (
|
) [private]
|
|
void NL3D::CPatch::deleteTileUvs (
|
)
|
|
void NL3D::CPatch::expandShading (
|
uint8 * Shading,
|
|
uint ratio = 1 )
|
|
|
Expand the shading part of the patch in bilinear.
Array must have a size of ((OrderS*4/ratio)+1)*((OrderT*4/ratio)+1) -
Parameters:
-
Shading
|
is a pointer on the destination shading buffer. Size must be ((OrderS*4/ratio)+1)*((OrderT*4/ratio)+1). |
ratio
|
is the one over the ratio of the texture destination. Must be 1 or 2. |
-
See also:
-
unpackShadowMap(), packShadowMap(), resetCompressedLumels(), clearUncompressedLumels()
Definition at line 1758 of file patch.cpp. |
void NL3D::CPatch::forceClip (
|
) [inline]
|
|
|
Classify this patch as Clipped.
Definition at line 229 of file patch.h. |
void NL3D::CPatch::forceMergeAtTileLevel (
|
)
|
|
|
For changing TileMaxSubdivision. force tesselation to be under tile.
Definition at line 1522 of file patch.cpp. |
void NL3D::CPatch::forceNoClip (
|
) [inline]
|
|
|
Classify this patch as UnClipped.
Definition at line 227 of file patch.h. |
const CBSphere & NL3D::CPatch::getBSphere (
|
) const [inline]
|
|
|
Return the bounding sphere. Work only when zone compiled.
Definition at line 199 of file patch.h. |
float NL3D::CPatch::getErrorSize (
|
) const [inline]
|
|
sint NL3D::CPatch::getFar0 (
|
) const [inline]
|
|
sint NL3D::CPatch::getFar1 (
|
) const [inline]
|
|
uint NL3D::CPatch::getNumTessBlock (
|
CTessFace * face ) [private]
|
|
uint8 NL3D::CPatch::getOrderS (
|
) const [inline]
|
|
uint8 NL3D::CPatch::getOrderT (
|
) const [inline]
|
|
CTessFace * NL3D::CPatch::getRootFaceForEdge (
|
sint edge ) const [private]
|
|
CTessVertex * NL3D::CPatch::getRootVertexForEdge (
|
sint edge ) const [private]
|
|
bool NL3D::CPatch::getSmoothFlag (
|
uint edge ) [inline]
|
|
|
Get the smooth flag for the n-th edge.
Return false if this edge must by smoothed, true else.
Definition at line 319 of file patch.h. |
void NL3D::CPatch::getTileLightMapUvInfo (
|
uint tileLightMapId,
|
|
CVector & uvScaleBias ) [private]
|
|
void NL3D::CPatch::getTileUvInfo (
|
sint tileId,
|
|
sint pass,
|
|
bool alpha,
|
|
uint8 & orient,
|
|
CVector & uvScaleBias,
|
|
bool & is256x256,
|
|
uint8 & uvOff ) [private]
|
|
CZone * NL3D::CPatch::getZone (
|
) const [inline]
|
|
bool NL3D::CPatch::isClipped (
|
) const [inline]
|
|
void NL3D::CPatch::makeRoots (
|
) [private]
|
|
void NL3D::CPatch::packShadowMap (
|
const class CTileLumel * pLumel )
|
|
|
Pack the lumels of the patches.
Lumels are classes that describe the lighting environnement at a given texel of the lightmap. It is used to compute the shadow map of the patch, compress it and uncompress it. This method compress the lumels passed in parameter and stored them in its Lumels member. -
Parameters:
-
pShadow
|
is a pointer on the destination lumel buffer. Size must be (OrderS*4+1)*(OrderS*4+1). |
-
See also:
-
expandShading(), unpackShadowMap(), resetCompressedLumels(), clearUncompressedLumels()
|
void NL3D::CPatch::preRender (
|
const std::vector< CPlane >& pyramid )
|
|
|
preRender this patch, if not clipped. Build RdrFace List ....
Definition at line 748 of file patch.cpp. |
void NL3D::CPatch::recreateTileUvs (
|
)
|
|
void NL3D::CPatch::refine (
|
)
|
|
|
Refine / geomorph this patch. Even if clipped.
Definition at line 680 of file patch.cpp. |
void NL3D::CPatch::release (
|
void )
|
|
|
Un-compile a patch. Tesselation is deleted. if patch is not compiled, no - op.
Definition at line 74 of file patch.cpp. |
void NL3D::CPatch::releaseTileLightMap (
|
uint tileLightMapId ) [private]
|
|
void NL3D::CPatch::removeFaceFromRenderList (
|
CTessFace * face ) [private]
|
|
void NL3D::CPatch::removeFaceFromTileRenderList (
|
CTessFace * face ) [private]
|
|
void NL3D::CPatch::removeFarVertexFromRenderList (
|
CTessFarVertex * fv ) [private]
|
|
void NL3D::CPatch::removeTileMaterialFromRenderList (
|
CTileMaterial * tm ) [private]
|
|
void NL3D::CPatch::renderFar0 (
|
)
|
|
|
Render this patch, if not clipped (append to VertexBuffers / materials primitive block).
Definition at line 1187 of file patch.cpp. |
void NL3D::CPatch::renderFar1 (
|
)
|
|
void NL3D::CPatch::renderTile (
|
sint pass )
|
|
void NL3D::CPatch::resetCompressedLumels (
|
)
|
|
void NL3D::CPatch::resetMasterBlock (
|
) [private]
|
|
void NL3D::CPatch::resetRenderFar (
|
)
|
|
void NL3D::CPatch::setSmoothFlag (
|
uint edge,
|
|
bool flag ) [inline]
|
|
|
Set the smooth flag for the n-th edge.
flag is false if this edge must by smoothed, true else.
Definition at line 307 of file patch.h. |
void NL3D::CPatch::unbind (
|
CPatch * except[4] )
|
|
|
unbind the patch from All neighbors.
neighbors patchs links are modified too. The tesselation is forcemerged. unbind from patchs except those in except (usefull for bind 2/1 or 4/1).
Definition at line 1329 of file patch.cpp. |
CBezierPatch * NL3D::CPatch::unpackIntoCache (
|
) const [private]
|
|
void NL3D::CPatch::unpackShadowMap (
|
class CTileLumel * pLumel,
|
|
uint ratio = 1 )
|
|
|
Unpack the lumels of the patches.
Lumels are classes that describe the lighting environnement at a given texel of the lightmap. It is used to compute the shadow map of the patch, compress it and uncompress it. This method uncompress the lumels stored in its Lumels member. -
Parameters:
-
pShadow
|
is a pointer on the destination lumel buffer. Size must be ((OrderS*4/ratio)+1)*((OrderT*4/ratio)+1). |
ratio
|
is the one over the ratio of the texture destination. Must be 1 or 2. |
-
See also:
-
expandShading(), packShadowMap(), resetCompressedLumels(), clearUncompressedLumels()
Definition at line 1825 of file patch.cpp. |
Friends And Related Function Documentation
Member Data Documentation
CBSphere NL3D::CPatch::BSphere [private]
|
|
bool NL3D::CPatch::Clipped [private]
|
|
std::vector< uint8 > NL3D::CPatch::CompressedLumels
|
|
bool NL3D::CPatch::ComputeTileErrorMetric [private]
|
|
float NL3D::CPatch::ErrorSize [private]
|
|
sint NL3D::CPatch::Far0 [private]
|
|
float NL3D::CPatch::Far0UBias [private]
|
|
float NL3D::CPatch::Far0UScale [private]
|
|
float NL3D::CPatch::Far0VBias [private]
|
|
float NL3D::CPatch::Far0VScale [private]
|
|
sint NL3D::CPatch::Far1 [private]
|
|
float NL3D::CPatch::Far1UBias [private]
|
|
float NL3D::CPatch::Far1UScale [private]
|
|
float NL3D::CPatch::Far1VBias [private]
|
|
float NL3D::CPatch::Far1VScale [private]
|
|
uint8 NL3D::CPatch::Flags [private]
|
|
|
Flags NL_PATCH_FAR0_ROTATED and NL_PATCH_FAR1_ROTATED NL_PATCH_FAR0_ROTATED for Far0, NL_PATCH_FAR1_ROTATED for Far1 If the flag is set, the far texture of the patch is rotated of 1 (to the left of course).
Flags NL_PATCH_SMOOTH_FLAG_MASK 4 flag for smooth edge. Same as CPatchInfo::CBindInfo shifted by (<<NL_PATCH_SMOOTH_FLAG_SHIFT). See CPatchInfo::CBindInfo::Flags for details.
Definition at line 376 of file patch.h. |
const CPatch * NL3D::CPatch::LastPatch = NULL [static, private]
|
|
float NL3D::CPatch::OOTransitionSqrDelta [private]
|
|
uint8 NL3D::CPatch::OrderS [private]
|
|
uint8 NL3D::CPatch::OrderT [private]
|
|
sint NL3D::CPatch::SquareLimitLevel [private]
|
|
sint NL3D::CPatch::TessBlockLimitLevel [private]
|
|
sint NL3D::CPatch::TessBlockRefCount [private]
|
|
std::vector< CTessBlock > NL3D::CPatch::TessBlocks [private]
|
|
std::vector< CTileColor > NL3D::CPatch::TileColors
|
|
bool NL3D::CPatch::TileFarTransition [private]
|
|
sint NL3D::CPatch::TileLimitLevel [private]
|
|
float NL3D::CPatch::TransitionSqrMin [private]
|
|
std::vector< CTileLumel > NL3D::CPatch::UncompressedLumels
|
|
CZone * NL3D::CPatch::Zone [private]
|
|
uint8 NL3D::CPatch::_ShadingBuffer [static, private]
|
|
|
Static buffer used to expand shading in expandShading.
Its size is (NL_MAX_TILES_BY_PATCH_EDGE*NL_LUMEL_BY_TILE+1)*(NL_MAX_TILES_BY_PATCH_EDGE*NL_LUMEL_BY_TILE+1)
Definition at line 45 of file patch.cpp. |
uint32 NL3D::CPatch::_Version = 2 [static, private]
|
|
|
Stream version of the class.
Definition at line 46 of file patch.cpp. |
The documentation for this class was generated from the following files:
|
|