|
|
|
|
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>
List of all members.
[NOHEADER] |
void | setCornerSmoothFlag (uint corner, bool smooth) |
| setup Smooth flags for Noise on corner: used for Noise geometry and for lighting. More...
|
bool | getCornerSmoothFlag (uint corner) const |
uint8 | NoiseRotation |
| The orientation of the NoiseMap. 0,1,2,3. This represent a CCW rotation of the NoiseMap. More...
|
uint8 | _CornerSmoothFlag |
| Put here for packing with NoiseRotation. More...
|
RenderList mgt. |
enum | TFarVertType { FVMasterBlock = 0,
FVTessBlock,
FVTessBlockEdge
} |
void | resetMasterBlock () |
void | clearTessBlocks () |
void | addRefTessBlocks () |
void | decRefTessBlocks () |
uint | getNumTessBlock (CTessFace *face) |
void | getNumTessBlock (CParamCoord pc, TFarVertType &type, uint &numtb) |
void | dirtTessBlockFaceVector (CTessBlock &block) |
void | appendFaceToRenderList (CTessFace *face) |
void | removeFaceFromRenderList (CTessFace *face) |
void | appendFaceToTileRenderList (CTessFace *face) |
void | removeFaceFromTileRenderList (CTessFace *face) |
void | extendTessBlockWithEndPos (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) |
[NOHEADER] |
CTessFace * | linkTessFaceWithEdge (const NLMISC::CVector2f &uv0, const NLMISC::CVector2f &uv1, CTessFace *linkTo) |
| Used by bind(). More...
|
CZone * | _BindZoneNeighbor [4] |
| The 4 neighbors zone of this patch (setuped at bind() time). NB: NULL if zone not loaded, or if no patch near us. More...
|
Dynamic Lighting Management |
void | addRefDLMContext () |
| Add a ref count to the DLMContext, creating it if necessary. More...
|
void | decRefDLMContext (uint count=1) |
| Dec a ref count to the DLMContext, deleting it if refCount== 0. More...
|
CPatchDLMContext * | _DLMContext |
| The Dynamic LightMap context. More...
|
sint | _DLMContextRefCount |
| The reference count for DLMContext. More...
|
Public Methods |
| CPatch () |
| Constructor. More...
|
| ~CPatch () |
| dtor. More...
|
void | compile (CZone *z, uint patchId, 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...
|
CLandscape * | getLandscape () const |
| Get the landscape in which is placed this patch. More...
|
CZone * | getZone () const |
uint8 | getOrderS () const |
uint8 | getOrderT () const |
uint8 | getOrderForEdge (sint8 edge) const |
float | getErrorSize () const |
sint | getFar0 () const |
sint | getFar1 () const |
uint16 | getPatchId () const |
void | getBindNeighbor (uint edge, CBindInfo &neighborEdge) const |
| return neighborhood information. More...
|
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...
|
CVector | computeContinousVertex (float s, float t) const |
| Same as computeVertex, but special accurate version for CVisualCollisionEntity. More...
|
void | unbind () |
| unbind the patch from All neighbors. More...
|
void | bind (CBindInfo Edges[4], bool rebind) |
| 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 | averageTesselationVertices () |
| This is especially for Pacs. More...
|
void | forceNoClip () |
| Classify this patch as UnClipped. More...
|
void | forceClip () |
| Classify this patch as Clipped. More...
|
void | forceNoRenderClip () |
| Classify this patch as Render UnClipped. More...
|
void | forceRenderClip () |
| Classify this patch as RenderClipped. More...
|
void | clip (const std::vector< CPlane > &pyramid) |
| Classify this patch. More...
|
void | refineAll () |
| Refine this patch. Even if clipped. Refine all nodes. More...
|
void | resetRenderFar () |
void | deleteTileUvs () |
void | recreateTileUvs () |
void | refreshTesselationGeometry () |
void | serial (NLMISC::IStream &f) |
void | unpack (CBezierPatch &p) const |
void | unpackShadowMap (uint8 *pShadow) |
| Unpack the lumels of the patches. More...
|
void | packShadowMap (const uint8 *pLumel) |
| Pack the lumels of the patches. More...
|
void | resetCompressedLumels () |
| Rebuild the packed lumels without shadow. More...
|
void | setupColorsFromTileFlags (const NLMISC::CRGBA colors[4]) |
| debug coloring. More...
|
void | copyTileFlagsFromPatch (const CPatch *src) |
| Set this patch flags from an other one. More...
|
void | setSmoothFlag (uint edge, bool flag) |
| Set the smooth flag for the n-th edge. More...
|
bool | getSmoothFlag (uint edge) const |
| Get the smooth flag for the n-th edge. More...
|
bool | isClipped () const |
bool | isRenderClipped () const |
const CTessVertex * | getCornerVertex (uint corner) |
uint | getTileMaterialRefCount () const |
| Get number of TileMaterial created in this Patch. More...
|
CBezierPatch * | unpackIntoCache () const |
|
void | preRender () |
| preRender this patch. no-op if(RenderClipped). Build Max faces / pass etc... More...
|
void | updateTextureFarOnly () |
void | renderFar0 () |
| Render this patch, if not clipped. Call PatchCurrentDriver->renderSimpleTriangles(). More...
|
void | renderFar1 () |
void | computeSoftwareGeomorphAndAlpha () |
|
void | addTrianglesInBBox (CPatchIdent paId, const CAABBox &bbox, std::vector< CTrianglePatch > &triangles, uint8 tileTessLevel) const |
| Add triangles to triangles array which intersect the bbox. More...
|
void | fillPatchQuadBlock (CPatchQuadBlock &quadBlock) const |
| Fill a CPatchQuadBlock, from its required PatchId. More...
|
void | addPatchBlocksInBBox (CPatchIdent paId, const CAABBox &bbox, std::vector< CPatchBlockIdent > &paBlockIds) const |
| Add CPatchBlockIdent to CPatchBlockIdent array which intersect the bbox. More...
|
CVector | getTesselatedPos (CUV uv) const |
| From the current tesselation of this patch, and a UV in this patch, return tesselated position. More...
|
void | appendTessellationLeaves (std::vector< const CTessFace * > &leaves) const |
| From the current tesselation of this patch, append to the list of leaves faces. More...
|
|
uint8 | getLumel (const CUV &uv) const |
| Get the lumel under the position. More...
|
void | appendTileLightInfluences (const CUV &uv, std::vector< CPointLightInfluence > &pointLightList) const |
| Append lights under the position to pointLightList. More...
|
void | computeCurrentTLILightmap (NLMISC::CRGBA *array) const |
| For CTextureFar, compute current TLI Lightmap at tile level. More...
|
|
CTileElement * | getTileElement (const CUV &uv) |
| Get the lumel under the position. More...
|
|
void | deleteVBAndFaceVector () |
void | allocateVBAndFaceVector () |
void | fillVB () |
void | fillVBIfVisible () |
void | deleteVBAndFaceVectorFar1Only () |
void | allocateVBAndFaceVectorFar1Only () |
void | fillVBFar0Only () |
void | fillVBFar1Only () |
void | fillVBFarsDLMUvOnly () |
void | fillFar0DLMUvOnlyVertexListVB (CTessList< CTessFarVertex > &vertList) |
void | fillFar1DLMUvOnlyVertexListVB (CTessList< CTessFarVertex > &vertList) |
void | updateClipPatchVB () |
void | debugAllocationMarkIndices (uint marker) |
void | recreateTessBlockFaceVector (CTessBlock &block) |
|
void | deleteAllVegetableIgs () |
| Delete any vegetable Ig still existing in this patch. More...
|
void | recreateAllVegetableIgs () |
| Recreate any vegetable block (as possible) in this patch. (usefull for edition). More...
|
|
void | resetTileLightInfluences () |
| make a valid empty array of TileLightInfluences (ie resized to good size, but with empty light influences. More...
|
|
void | linkBeforeNearUL (CPatch *patchNext) |
| For lighting update, insert this before patchNext (CiruclarList). textNext must be !NULL. More...
|
void | unlinkNearUL () |
| For lighting update, unlink (CiruclarList). More...
|
CPatch * | getNextNearUL () const |
| For lighting update, get Next (CiruclarList). If ==this, then list is empty. More...
|
uint | getNumNearTessBlocks () const |
| get the number of Near TessBlocks. Actually OrderS/2*OrderT/2. More...
|
uint | updateTessBlockLighting (uint numTb) |
| recompute the near lightmap of tessBlock "numTb". More...
|
|
void | beginDLMLighting () |
| begin Dynamic light Process. More...
|
void | processDLMLight (CPatchDLMPointLight &pl) |
| Process a Dynamic light, creating the DLMContext if necessary. More...
|
void | endDLMLighting () |
| end Dynamic light Process, deleting the DLMContext if necessary. More...
|
Public Attributes |
CVector3s | Vertices [4] |
| The patch coordinates (see CBezierPatch). More...
|
CVector3s | Tangents [8] |
CVector3s | Interiors [4] |
std::vector< uint8 > | CompressedLumels |
std::vector< CTileElement > | Tiles |
std::vector< CTileColor > | TileColors |
std::vector< CTileLightInfluence > | TileLightInfluences |
Private Types |
Private Methods |
void | packLumelBlock (uint8 *dest, const uint8 *source, uint8 alpha0, uint8 alpha1) |
| Pack a 4x4 lumel block. More...
|
uint | evalLumelBlock (const uint8 *original, const uint8 *unCompressed, uint width, uint height) |
| Eval an uncompressed 4x4 block against the original. More...
|
void | unpackLumelBlock (uint8 *dest, const uint8 *src) |
| Unpack a 4x4 lumel block. More...
|
void | computeDefaultErrorSize () |
void | makeRoots () |
CTessFace * | getRootFaceForEdge (sint edge) const |
CTessVertex * | getRootVertexForEdge (sint edge) const |
void | changeEdgeNeighbor (sint edge, CTessFace *to) |
void | computeNewFar (sint &newFar0, sint &newFar1) |
void | fillFar0VertexVB (CTessFarVertex *pVert) |
void | fillFar1VertexVB (CTessFarVertex *pVert) |
void | fillTileVertexVB (CTessNearVertex *pVert) |
void | fillFar0VertexListVB (CTessList< CTessFarVertex > &vertList) |
void | fillFar1VertexListVB (CTessList< CTessFarVertex > &vertList) |
void | fillTileVertexListVB (CTessList< CTessNearVertex > &vertList) |
void | updateFar0VBAlloc (CTessList< CTessFarVertex > &vertList, bool alloc) |
void | updateFar1VBAlloc (CTessList< CTessFarVertex > &vertList, bool alloc) |
void | updateTileVBAlloc (CTessList< CTessNearVertex > &vertList, bool alloc) |
void | updateVBAlloc (bool alloc) |
void | debugAllocationMarkIndicesFarList (CTessList< CTessFarVertex > &vertList, uint marker) |
void | debugAllocationMarkIndicesNearList (CTessList< CTessNearVertex > &vertList, uint marker) |
void | createFaceVectorFar1 () |
void | deleteFaceVectorFar1 () |
void | createFaceVectorFar0OrTile () |
void | deleteFaceVectorFar0OrTile () |
void | checkCreateVertexVBFar (CTessFarVertex *pVert) |
void | checkCreateVertexVBNear (CTessNearVertex *pVert) |
void | checkFillVertexVBFar (CTessFarVertex *pVert) |
void | checkFillVertexVBNear (CTessNearVertex *pVert) |
void | checkDeleteVertexVBFar (CTessFarVertex *pVert) |
void | checkDeleteVertexVBNear (CTessNearVertex *pVert) |
void | computeGeomorphVertexList (CTessList< CTessFarVertex > &vertList) |
void | computeGeomorphFar0VertexListVB (CTessList< CTessFarVertex > &vertList) |
void | computeGeomorphAlphaFar1VertexListVB (CTessList< CTessFarVertex > &vertList) |
void | computeGeomorphTileVertexListVB (CTessList< CTessNearVertex > &vertList) |
void | computeTbTm (uint &numtb, uint &numtm, uint ts, uint tt) |
|
CPatchRdrPass * | getTileRenderPass (sint tileId, sint pass) |
void | getTileUvInfo (sint tileId, sint pass, bool alpha, uint8 &orient, CVector &uvScaleBias, bool &is256x256, uint8 &uvOff) |
|
void | getTileLightMap (uint ts, uint tt, CPatchRdrPass *&rdrpass) |
void | getTileLightMapUvInfo (uint ts, uint tt, CVector &uvScaleBias) |
void | releaseTileLightMap (uint ts, uint tt) |
void | computeNearBlockLightmap (uint ts, uint tt, NLMISC::CRGBA *lightText) |
void | computeTileLightmapPixelAroundCorner (const NLMISC::CVector2f &stIn, NLMISC::CRGBA *dest, bool lookAround) |
void | computeTileLightmap (uint ts, uint tt, NLMISC::CRGBA *dest, uint stride) |
void | computeTileLightmapEdge (uint ts, uint tt, uint edge, NLMISC::CRGBA *dest, uint stride, bool inverse) |
void | computeTileLightmapPixel (uint ts, uint tt, uint s, uint t, NLMISC::CRGBA *dest) |
void | computeTileLightmapAutomatic (uint ts, uint tt, NLMISC::CRGBA *dest, uint stride) |
void | computeTileLightmapEdgeAutomatic (uint ts, uint tt, uint edge, NLMISC::CRGBA *dest, uint stride, bool inverse) |
void | computeTileLightmapPixelAutomatic (uint ts, uint tt, uint s, uint t, NLMISC::CRGBA *dest) |
void | computeTileLightmapPrecomputed (uint ts, uint tt, NLMISC::CRGBA *dest, uint stride) |
void | computeTileLightmapEdgePrecomputed (uint ts, uint tt, uint edge, NLMISC::CRGBA *dest, uint stride, bool inverse) |
void | computeTileLightmapPixelPrecomputed (uint ts, uint tt, uint s, uint t, NLMISC::CRGBA *dest) |
void | modulateTileLightmapWithTileColors (uint ts, uint tt, NLMISC::CRGBA *dest, uint stride) |
void | modulateTileLightmapEdgeWithTileColors (uint ts, uint tt, uint edge, NLMISC::CRGBA *dest, uint stride, bool inverse) |
void | modulateTileLightmapPixelWithTileColors (uint ts, uint tt, uint s, uint t, NLMISC::CRGBA *dest) |
void | getTileTileColors (uint ts, uint tt, NLMISC::CRGBA corners[4]) |
CRGBA | CPatch::getCurrentTLIColor (uint x, uint y) const |
void | getCurrentTileTLIColors (uint ts, uint tt, NLMISC::CRGBA corners[4]) |
void | addTileLightmapWithTLI (uint ts, uint tt, NLMISC::CRGBA *dest, uint stride) |
void | addTileLightmapEdgeWithTLI (uint ts, uint tt, uint edge, NLMISC::CRGBA *dest, uint stride, bool inverse) |
void | addTileLightmapPixelWithTLI (uint ts, uint tt, uint s, uint t, NLMISC::CRGBA *dest) |
|
void | buildBBoxFromBezierPatch (const CBezierPatch &p, CAABBox &ret) const |
| build a bbox from the convex hull of a bezier patch, enlarged with noise. More...
|
void | addTrianglesInBBoxRecurs (CPatchIdent paId, const CAABBox &bbox, std::vector< CTrianglePatch > &triangles, uint8 tessLevel, const CBezierPatch &pa, uint8 s0, uint8 s1, uint8 t0, uint8 t1) const |
| recurse subdivide of the bezierPatch. More...
|
void | addTileTrianglesInBBox (CPatchIdent paId, const CAABBox &bbox, std::vector< CTrianglePatch > &triangles, uint8 tessLevel, uint8 s0, uint8 t0) const |
| called by addTrianglesInBBoxRecurs(). More...
|
void | addPatchBlocksInBBoxRecurs (CPatchIdent paId, const CAABBox &bbox, std::vector< CPatchBlockIdent > &paBlockIds, const CBezierPatch &pa, uint8 s0, uint8 s1, uint8 t0, uint8 t1) const |
| recurse method of addPatchBlocksInBBox. More...
|
CVector | computeVertexButCorner (float s, float t, bool &onCorner) const |
| Used by computeContinousVertex(). More...
|
|
float | computeDisplaceRawInteger (sint ts, sint tt, sint ms, sint mt) const |
void | computeDisplaceRawCoordinates (float sTile, float tTile, float s, float t, sint &ts, sint &tt, sint &ms, sint &mt) const |
float | computeDisplaceRaw (float sTile, float tTile, float s, float t) const |
| compute the displacement for s,t ([0;OrderS], [0;OrderT]) (sTile, tTile) choose what NoiseMap to use, and (s,t) choose the coordinate in the patch to compute this NoiseMap. More...
|
float | computeDisplaceRawOnNeighbor (float sTile, float tTile, float s, float t) const |
| usefull only for computeDisplaceCornerSmooth(). More...
|
float | computeDisplaceInteriorSmooth (float s, float t) const |
| compute the smoothed displacement for s,t ([0;OrderS], [0;OrderT]). More...
|
float | computeDisplaceEdgeSmooth (float s, float t, sint8 smoothBorderX, sint8 smoothBorderY) const |
| compute the smoothed displacement for s,t ([0;OrderS], [0;OrderT]). More...
|
float | computeDisplaceCornerSmooth (float s, float t, sint8 smoothBorderX, sint8 smoothBorderY) const |
| compute the smoothed displacement for s,t ([0;OrderS], [0;OrderT]). More...
|
CVector | computeNormalEdgeSmooth (float s, float t, sint8 smoothBorderX, sint8 smoothBorderY) const |
| compute the smoothed normal for s,t ([0;OrderS], [0;OrderT]). More...
|
CVector | computeNormalCornerSmooth (float s, float t, sint8 smoothBorderX, sint8 smoothBorderY) const |
| compute the smoothed normal for s,t ([0;OrderS], [0;OrderT]). More...
|
CVector | computeNormalOnNeighbor (float s, float t, uint edgeExclude) const |
| same reasoning as in computeDisplaceRawOnNeighbor(). More...
|
void | computeNoise (float s, float t, CVector &displace) const |
| compute the Final displacement for s,t ([0;1], [0;1]). More...
|
|
void | createVegetableBlock (uint numTb, uint ts, uint tt) |
| Create / init the vegetableBlock in the corresponding TessBlock. TessBlocks must exist. More...
|
void | releaseVegetableBlock (uint numTb) |
| release the vegetableBlock in the corresponding TessBlock. TessBlocks must exist. More...
|
void | generateTileVegetable (CVegetableInstanceGroup *vegetIg, uint distType, uint ts, uint tt, CLandscapeVegetableBlockCreateContext &vbCreateCtx) |
void | getTileLumelmapPrecomputed (uint ts, uint tt, uint8 *dest, uint stride) |
void | getTileLumelmapPixelPrecomputed (uint ts, uint tt, uint s, uint t, uint8 &dest) const |
| same as computeTileLightmapPixelPrecomputed, but brut result, not modified by colorTable. More...
|
Private Attributes |
CZone * | Zone |
uint16 | PatchId |
uint8 | OrderS |
uint8 | OrderT |
bool | ExcludeFromRefineAll |
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 | RenderClipped |
bool | OldRenderClipped |
CRdrPatchId | Pass0 |
CRdrPatchId | Pass1 |
float | TransitionSqrMin |
float | OOTransitionSqrDelta |
|
CTessBlock | MasterBlock |
std::vector< CTessBlock > | TessBlocks |
sint | TessBlockRefCount |
sint | NumRenderableFaces |
|
std::vector< CVegetableClipBlock * > | VegetableClipBlocks |
| list of vegetable clipBlocks, created/destroyed at same time as TessBlocks. More...
|
|
CPatch * | _ULNearPrec |
CPatch * | _ULNearNext |
Static Private Attributes |
uint32 | _Version = 7 |
| Stream version of the class. More...
|
CBezierPatch | CachePatch |
const CPatch * | LastPatch = NULL |
Friends |
class | CTessFace |
class | CZone |
class | CLandscapeVegetableBlock |
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:
-
Lionel Berenguier , Nevrax France
-
Date:
-
2000
Definition at line 299 of file patch.h.
Member Enumeration Documentation
enum NL3D::CPatch::TFarVertType [private]
|
|
Constructor & Destructor Documentation
|
Constructor.
Definition at line 57 of file patch.cpp.
References _BindZoneNeighbor, _CornerSmoothFlag, _DLMContext, _DLMContextRefCount, _ULNearNext, _ULNearPrec, Clipped, ExcludeFromRefineAll, Far0, Far1, MasterBlock, NoiseRotation, NumRenderableFaces, OldRenderClipped, OrderS, OrderT, RenderClipped, Son0, Son1, TessBlockRefCount, and Zone.
Referenced by bind, computeContinousVertex, computeDisplaceCornerSmooth, computeDisplaceEdgeSmooth, computeDisplaceRawOnNeighbor, computeNearBlockLightmap, computeNormalCornerSmooth, computeNormalEdgeSmooth, computeNormalOnNeighbor, computeTileLightmapPixelAroundCorner, and getNextNearUL. |
NL3D::CPatch::~CPatch |
( |
|
) |
|
|
Member Function Documentation
void NL3D::CPatch::addRefDLMContext |
( |
|
) |
[private] |
|
void NL3D::CPatch::addRefTessBlocks |
( |
|
) |
[private] |
|
|
Definition at line 594 of file patch.cpp.
References getLandscape, NL3D_PATCH_VEGETABLE_NUM_TESSBLOCK_PER_CLIPBLOCK, NL3D_PATCH_VEGETABLE_NUM_TESSBLOCK_PER_CLIPBLOCK_SHIFT, NL3D_TESSBLOCK_TILESIZE, nlassert, OrderS, OrderT, TessBlockRefCount, TessBlocks, and VegetableClipBlocks.
Referenced by appendFaceToRenderList, appendFarVertexToRenderList, appendNearVertexToRenderList, and appendTileMaterialToRenderList. |
void NL3D::CPatch::addTrianglesInBBox |
( |
CPatchIdent |
paId, |
|
|
const CAABBox & |
bbox, |
|
|
std::vector< CTrianglePatch > & |
triangles, |
|
|
uint8 |
tileTessLevel |
|
) |
const |
|
|
Add triangles to triangles array which intersect the bbox.
NB: this method use a convex hull subdivion to search in O(logn) what part of the patch to insert. -
Parameters:
-
patchId |
the id of this patch, used to fill triangles. |
bbox |
the bbox to test against. |
triangles |
array to be filled (no clear performed, elements added). |
tileTessLevel |
0,1 or 2 size of the triangles (2*2m, 1*1m or 0.5*0.5m). Level of subdivision of a tile. |
Definition at line 263 of file patch.cpp.
References addTrianglesInBBoxRecurs, OrderS, OrderT, and unpackIntoCache. |
void NL3D::CPatch::allocateVBAndFaceVector |
( |
|
) |
|
|
void NL3D::CPatch::allocateVBAndFaceVectorFar1Only |
( |
|
) |
|
|
void NL3D::CPatch::appendFaceToRenderList |
( |
CTessFace * |
face |
) |
[private] |
|
void NL3D::CPatch::appendFaceToTileRenderList |
( |
CTessFace * |
face |
) |
[private] |
|
void NL3D::CPatch::appendFarVertexToRenderList |
( |
CTessFarVertex * |
fv |
) |
[private] |
|
void NL3D::CPatch::appendTessellationLeaves |
( |
std::vector< const CTessFace * > & |
leaves |
) |
const |
|
|
From the current tesselation of this patch, append to the list of leaves faces.
Definition at line 2153 of file patch.cpp.
References nlassert, Son0, and Son1. |
void NL3D::CPatch::appendTileLightInfluences |
( |
const CUV & |
uv, |
|
|
std::vector< CPointLightInfluence > & |
pointLightList |
|
) |
const |
|
void NL3D::CPatch::appendTileMaterialToRenderList |
( |
CTileMaterial * |
tm |
) |
[private] |
|
void NL3D::CPatch::averageTesselationVertices |
( |
|
) |
|
|
void NL3D::CPatch::beginDLMLighting |
( |
|
) |
|
|
void NL3D::CPatch::bind |
( |
CBindInfo |
Edges[4], |
|
|
bool |
rebind |
|
) |
|
|
|
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 1824 of file patch.cpp.
References _BindZoneNeighbor, BaseVertices, bind, changeEdgeNeighbor, checkFillVertexVBFar, computeVertex, CPatch, CTessFace, getBindNeighbor, getRootFaceForEdge, nlassert, OrderS, OrderT, Son0, and Son1.
Referenced by bind. |
CAABBox NL3D::CPatch::buildBBox |
( |
|
) |
const |
|
void NL3D::CPatch::buildBBoxFromBezierPatch |
( |
const CBezierPatch & |
p, |
|
|
CAABBox & |
ret |
|
) |
const [private] |
|
void NL3D::CPatch::changeEdgeNeighbor |
( |
sint |
edge, |
|
|
CTessFace * |
to |
|
) |
[private] |
|
void NL3D::CPatch::checkCreateVertexVBFar |
( |
CTessFarVertex * |
pVert |
) |
[private] |
|
void NL3D::CPatch::checkCreateVertexVBNear |
( |
CTessNearVertex * |
pVert |
) |
[private] |
|
void NL3D::CPatch::checkDeleteVertexVBFar |
( |
CTessFarVertex * |
pVert |
) |
[private] |
|
void NL3D::CPatch::checkDeleteVertexVBNear |
( |
CTessNearVertex * |
pVert |
) |
[private] |
|
void NL3D::CPatch::checkFillVertexVBFar |
( |
CTessFarVertex * |
pVert |
) |
[private] |
|
void NL3D::CPatch::checkFillVertexVBNear |
( |
CTessNearVertex * |
pVert |
) |
[private] |
|
void NL3D::CPatch::clearTessBlocks |
( |
|
) |
[private] |
|
void NL3D::CPatch::clip |
( |
const std::vector< CPlane > & |
pyramid |
) |
|
|
|
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 1238 of file patch.cpp.
References _ULNearNext, _ULNearPrec, BaseVertices, BSphere, buildBBox, computeDefaultErrorSize, ErrorSize, NLMISC::getPowerOf2, makeRoots, MasterBlock, min, nlassert, OrderS, OrderT, Pass0, Pass1, PatchId, SquareLimitLevel, TessBlockLimitLevel, TileLimitLevel, z, and Zone. |
CVector NL3D::CPatch::computeContinousVertex |
( |
float |
s, |
|
|
float |
t |
|
) |
const |
|
|
Same as computeVertex, but special accurate version for CVisualCollisionEntity.
If on a corner of the patch (0,0), (0,1) ...., take directly the BaseVertices[] result if on a border of a patch (ie s==0, s==1, t==0 or t==1), also compute the vertex of the neighbor patch (if any), and then average the result. This ensure that tesselation generated is perfectly continous, even across patchs of same or different zones. This feature is very important for CVisualCollisionEntity::snapToGround()
Definition at line 1327 of file patch.cpp.
References BaseVertices, computeVertex, CPatch, getBindNeighbor, getOrderS, getOrderT, nlassert, nlstop, s, t, and Zone. |
void NL3D::CPatch::computeCurrentTLILightmap |
( |
NLMISC::CRGBA * |
array |
) |
const |
|
void NL3D::CPatch::computeDefaultErrorSize |
( |
|
) |
[private] |
|
float NL3D::CPatch::computeDisplaceCornerSmooth |
( |
float |
s, |
|
|
float |
t, |
|
|
sint8 |
smoothBorderX, |
|
|
sint8 |
smoothBorderY |
|
) |
const [private] |
|
|
compute the smoothed displacement for s,t ([0;OrderS], [0;OrderT]).
Special case on corner.
Definition at line 469 of file patch_noise.cpp.
References NL3D::computeDisplaceBilinear, computeDisplaceInteriorSmooth, computeDisplaceRaw, CPatch, getBindNeighbor, nlassert, nlstop, NL3D::noiseFloor, OrderS, OrderT, s, and t.
Referenced by computeNoise. |
float NL3D::CPatch::computeDisplaceEdgeSmooth |
( |
float |
s, |
|
|
float |
t, |
|
|
sint8 |
smoothBorderX, |
|
|
sint8 |
smoothBorderY |
|
) |
const [private] |
|
|
compute the smoothed displacement for s,t ([0;OrderS], [0;OrderT]).
Special case on edge.
Definition at line 286 of file patch_noise.cpp.
References NL3D::computeDisplaceBilinear, computeDisplaceInteriorSmooth, computeDisplaceRaw, CPatch, getBindNeighbor, nlassert, nlstop, NL3D::noiseFloor, OrderS, OrderT, s, and t.
Referenced by computeNoise. |
float NL3D::CPatch::computeDisplaceInteriorSmooth |
( |
float |
s, |
|
|
float |
t |
|
) |
const [private] |
|
float NL3D::CPatch::computeDisplaceRaw |
( |
float |
sTile, |
|
|
float |
tTile, |
|
|
float |
s, |
|
|
float |
t |
|
) |
const [private] |
|
|
compute the displacement for s,t ([0;OrderS], [0;OrderT]) (sTile, tTile) choose what NoiseMap to use, and (s,t) choose the coordinate in the patch to compute this NoiseMap.
Any rotation of the NoiseMap is included in this method. NB: s,t does not have to be clamped to ([0;OrderS], [0;OrderT]).
Definition at line 217 of file patch_noise.cpp.
References computeDisplaceRawCoordinates, computeDisplaceRawInteger, s, and t.
Referenced by computeDisplaceCornerSmooth, computeDisplaceEdgeSmooth, and computeDisplaceRawOnNeighbor. |
void NL3D::CPatch::computeDisplaceRawCoordinates |
( |
float |
sTile, |
|
|
float |
tTile, |
|
|
float |
s, |
|
|
float |
t, |
|
|
sint & |
ts, |
|
|
sint & |
tt, |
|
|
sint & |
ms, |
|
|
sint & |
mt |
|
) |
const [private] |
|
float NL3D::CPatch::computeDisplaceRawInteger |
( |
sint |
ts, |
|
|
sint |
tt, |
|
|
sint |
ms, |
|
|
sint |
mt |
|
) |
const [private] |
|
float NL3D::CPatch::computeDisplaceRawOnNeighbor |
( |
float |
sTile, |
|
|
float |
tTile, |
|
|
float |
s, |
|
|
float |
t |
|
) |
const [private] |
|
|
Definition at line 817 of file patch_lightmap.cpp.
References computeTileLightmap, computeTileLightmapEdge, computeTileLightmapPixel, CPatch, getBindNeighbor, getCornerSmoothFlag, getSmoothFlag, NL_LUMEL_BY_TILE, NL_LUMEL_BY_TILE_SHIFT, NL_TILE_LIGHTMAP_SIZE, nlassert, OrderS, OrderT, src, stride, and v.
Referenced by getTileLightMap, and updateTessBlockLighting. |
void NL3D::CPatch::computeNewFar |
( |
sint & |
newFar0, |
|
|
sint & |
newFar1 |
|
) |
[private] |
|
|
Definition at line 54 of file patch_render.cpp.
References BSphere, Far0, Far0UBias, Far0UScale, Far0VBias, Far0VScale, Far1, Far1UBias, Far1UScale, Far1VBias, Far1VScale, Flags, NL_PATCH_FAR0_ROTATED, NL_PATCH_FAR1_ROTATED, nlassert, nlstop, OOTransitionSqrDelta, Pass0, Pass1, r, NLMISC::sqr, TransitionSqrMin, and Zone.
Referenced by preRender, and updateTextureFarOnly. |
void NL3D::CPatch::computeNoise |
( |
float |
s, |
|
|
float |
t, |
|
|
CVector & |
displace |
|
) |
const [private] |
|
|
compute the Final displacement for s,t ([0;1], [0;1]).
This is the top call. displace.norm() should be <= NL3D_NOISE_MAX.
Definition at line 872 of file patch_noise.cpp.
References computeDisplaceCornerSmooth, computeDisplaceEdgeSmooth, computeDisplaceInteriorSmooth, computeNormalCornerSmooth, computeNormalEdgeSmooth, OrderS, OrderT, s, t, and unpackIntoCache.
Referenced by computeVertex. |
CVector NL3D::CPatch::computeNormalCornerSmooth |
( |
float |
s, |
|
|
float |
t, |
|
|
sint8 |
smoothBorderX, |
|
|
sint8 |
smoothBorderY |
|
) |
const [private] |
|
|
compute the smoothed normal for s,t ([0;OrderS], [0;OrderT]).
Special case on corner.
Definition at line 726 of file patch_noise.cpp.
References computeNormalEdgeSmooth, CPatch, getBindNeighbor, getCornerSmoothFlag, getOrderS, getOrderT, nlassert, nlstop, NL3D::noiseCeilF, NL3D::noiseFloorF, s, t, and unpackIntoCache.
Referenced by computeNoise. |
CVector NL3D::CPatch::computeNormalEdgeSmooth |
( |
float |
s, |
|
|
float |
t, |
|
|
sint8 |
smoothBorderX, |
|
|
sint8 |
smoothBorderY |
|
) |
const [private] |
|
|
compute the smoothed normal for s,t ([0;OrderS], [0;OrderT]).
Special case on edge.
Definition at line 586 of file patch_noise.cpp.
References CPatch, getBindNeighbor, getOrderS, getOrderT, getSmoothFlag, nlassert, nlstop, NL3D::noiseCeilF, NL3D::noiseFloorF, s, t, and unpackIntoCache.
Referenced by computeNoise, and computeNormalCornerSmooth. |
CVector NL3D::CPatch::computeNormalOnNeighbor |
( |
float |
s, |
|
|
float |
t, |
|
|
uint |
edgeExclude |
|
) |
const [private] |
|
void NL3D::CPatch::computeSoftwareGeomorphAndAlpha |
( |
|
) |
|
|
void NL3D::CPatch::computeTbTm |
( |
uint & |
numtb, |
|
|
uint & |
numtm, |
|
|
uint |
ts, |
|
|
uint |
tt |
|
) |
[private] |
|
|
Definition at line 554 of file patch_lightmap.cpp.
References NLMISC::clamp, computeVertex, getLandscape, NL_LUMEL_BY_TILE, OrderS, OrderT, s, t, and v.
Referenced by computeTileLightmapAutomatic, computeTileLightmapEdgeAutomatic, and computeTileLightmapPixel. |
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 1302 of file patch.cpp.
References computeNoise, getLandscape, s, t, and unpackIntoCache.
Referenced by addTileTrianglesInBBox, averageTesselationVertices, bind, computeContinousVertex, computeTileLightmapPixelAutomatic, computeVertexButCorner, makeRoots, and refreshTesselationGeometry. |
CVector NL3D::CPatch::computeVertexButCorner |
( |
float |
s, |
|
|
float |
t, |
|
|
bool & |
onCorner |
|
) |
const [private] |
|
void NL3D::CPatch::copyTileFlagsFromPatch |
( |
const CPatch * |
src |
) |
|
|
CRGBA NL3D::CPatch::CPatch::getCurrentTLIColor |
( |
uint |
x, |
|
|
uint |
y |
|
) |
const [private] |
|
void NL3D::CPatch::createFaceVectorFar0OrTile |
( |
|
) |
[private] |
|
void NL3D::CPatch::createFaceVectorFar1 |
( |
|
) |
[private] |
|
void NL3D::CPatch::createVegetableBlock |
( |
uint |
numTb, |
|
|
uint |
ts, |
|
|
uint |
tt |
|
) |
[private] |
|
void NL3D::CPatch::debugAllocationMarkIndices |
( |
uint |
marker |
) |
|
|
void NL3D::CPatch::decRefDLMContext |
( |
uint |
count = 1 |
) |
[private] |
|
void NL3D::CPatch::decRefTessBlocks |
( |
|
) |
[private] |
|
void NL3D::CPatch::deleteAllVegetableIgs |
( |
|
) |
|
|
void NL3D::CPatch::deleteFaceVectorFar0OrTile |
( |
|
) |
[private] |
|
void NL3D::CPatch::deleteFaceVectorFar1 |
( |
|
) |
[private] |
|
void NL3D::CPatch::deleteTileUvs |
( |
|
) |
|
|
void NL3D::CPatch::deleteVBAndFaceVector |
( |
|
) |
|
|
void NL3D::CPatch::deleteVBAndFaceVectorFar1Only |
( |
|
) |
|
|
void NL3D::CPatch::dirtTessBlockFaceVector |
( |
CTessBlock & |
block |
) |
[private] |
|
void NL3D::CPatch::endDLMLighting |
( |
|
) |
|
|
uint NL3D::CPatch::evalLumelBlock |
( |
const uint8 * |
original, |
|
|
const uint8 * |
unCompressed, |
|
|
uint |
width, |
|
|
uint |
height |
|
) |
[private] |
|
void NL3D::CPatch::extendTessBlockWithEndPos |
( |
CTessFace * |
face |
) |
[private] |
|
void NL3D::CPatch::fillFar0VertexVB |
( |
CTessFarVertex * |
pVert |
) |
[inline, private] |
|
void NL3D::CPatch::fillFar1VertexVB |
( |
CTessFarVertex * |
pVert |
) |
[inline, private] |
|
|
Definition at line 1058 of file patch_render.cpp.
References _DLMContext, Far1UBias, Far1UScale, Far1VBias, Far1VScale, Flags, NL_PATCH_FAR1_ROTATED, nlassert, OOTransitionSqrDelta, and TransitionSqrMin.
Referenced by checkFillVertexVBFar, and fillFar1VertexListVB. |
void NL3D::CPatch::fillPatchQuadBlock |
( |
CPatchQuadBlock & |
quadBlock |
) |
const |
|
void NL3D::CPatch::fillTileVertexVB |
( |
CTessNearVertex * |
pVert |
) |
[inline, private] |
|
void NL3D::CPatch::fillVB |
( |
|
) |
|
|
void NL3D::CPatch::fillVBFar0Only |
( |
|
) |
|
|
void NL3D::CPatch::fillVBFar1Only |
( |
|
) |
|
|
void NL3D::CPatch::fillVBFarsDLMUvOnly |
( |
|
) |
|
|
void NL3D::CPatch::fillVBIfVisible |
( |
|
) |
|
|
void NL3D::CPatch::forceClip |
( |
|
) |
[inline] |
|
|
Classify this patch as Clipped.
Definition at line 445 of file patch.h.
References Clipped. |
void NL3D::CPatch::forceMergeAtTileLevel |
( |
|
) |
|
|
|
For changing TileMaxSubdivision. force tesselation to be under tile.
Definition at line 1999 of file patch.cpp.
References nlassert, Son0, and Son1. |
void NL3D::CPatch::forceNoClip |
( |
|
) |
[inline] |
|
|
Classify this patch as UnClipped.
Definition at line 443 of file patch.h.
References Clipped. |
void NL3D::CPatch::forceNoRenderClip |
( |
|
) |
[inline] |
|
void NL3D::CPatch::forceRenderClip |
( |
|
) |
[inline] |
|
|
Definition at line 50 of file patch_vegetable.cpp.
References _DLMContext, appendTileLightInfluences, NLMISC::clamp, NLMISC::contReset, getLandscape, getTileLumelmapPrecomputed, min, NL3D_PATCH_TILE_AREA, NL3D_VEGETABLE_BLOCK_ELTDIST, NL_LUMEL_BY_TILE, NL_LUMEL_BY_TILE_SHIFT, nlassert, NL3D::OptFastFloor, OrderS, OrderT, size, Tiles, unpackIntoCache, x, and y. |
void NL3D::CPatch::getBindNeighbor |
( |
uint |
edge, |
|
|
CBindInfo & |
neighborEdge |
|
) |
const |
|
|
return neighborhood information.
Definition at line 2190 of file patch.cpp.
References _BindZoneNeighbor, getZone, nlassert, and PatchId.
Referenced by bind, computeContinousVertex, computeDisplaceCornerSmooth, computeDisplaceEdgeSmooth, computeDisplaceRawOnNeighbor, computeNearBlockLightmap, computeNormalCornerSmooth, computeNormalEdgeSmooth, computeNormalOnNeighbor, and computeTileLightmapPixelAroundCorner. |
const CBSphere& NL3D::CPatch::getBSphere |
( |
|
) |
const [inline] |
|
|
Return the bounding sphere. Work only when zone compiled.
Definition at line 403 of file patch.h.
References BSphere. |
bool NL3D::CPatch::getCornerSmoothFlag |
( |
uint |
corner |
) |
const |
|
float NL3D::CPatch::getErrorSize |
( |
|
) |
const [inline] |
|
sint NL3D::CPatch::getFar0 |
( |
|
) |
const [inline] |
|
sint NL3D::CPatch::getFar1 |
( |
|
) |
const [inline] |
|
|
Get the landscape in which is placed this patch.
Definition at line 2163 of file patch.cpp.
References Zone.
Referenced by addRefDLMContext, addRefTessBlocks, appendTileMaterialToRenderList, clearTessBlocks, computeTileLightmap, computeTileLightmapEdge, computeTileLightmapEdgePrecomputed, computeTileLightmapPixel, computeTileLightmapPixelAutomatic, computeTileLightmapPixelPrecomputed, computeTileLightmapPrecomputed, computeVertex, createFaceVectorFar0OrTile, createFaceVectorFar1, createVegetableBlock, deleteFaceVectorFar0OrTile, deleteFaceVectorFar1, dirtTessBlockFaceVector, generateTileVegetable, makeRoots, recreateAllVegetableIgs, recreateTessBlockFaceVector, release, and releaseVegetableBlock. |
uint8 NL3D::CPatch::getLumel |
( |
const CUV & |
uv |
) |
const |
|
CPatch* NL3D::CPatch::getNextNearUL |
( |
|
) |
const [inline] |
|
|
For lighting update, get Next (CiruclarList). If ==this, then list is empty.
Definition at line 755 of file patch.h.
References _ULNearNext, and CPatch. |
uint NL3D::CPatch::getNumNearTessBlocks |
( |
|
) |
const [inline] |
|
|
get the number of Near TessBlocks. Actually OrderS/2*OrderT/2.
Definition at line 758 of file patch.h.
References TessBlocks. |
uint NL3D::CPatch::getNumTessBlock |
( |
CTessFace * |
face |
) |
[private] |
|
uint8 NL3D::CPatch::getOrderForEdge |
( |
sint8 |
edge |
) |
const |
|
uint8 NL3D::CPatch::getOrderS |
( |
|
) |
const [inline] |
|
uint8 NL3D::CPatch::getOrderT |
( |
|
) |
const [inline] |
|
uint16 NL3D::CPatch::getPatchId |
( |
|
) |
const [inline] |
|
CTessFace * NL3D::CPatch::getRootFaceForEdge |
( |
sint |
edge |
) |
const [private] |
|
CTessVertex * NL3D::CPatch::getRootVertexForEdge |
( |
sint |
edge |
) |
const [private] |
|
bool NL3D::CPatch::getSmoothFlag |
( |
uint |
edge |
) |
const [inline] |
|
CVector NL3D::CPatch::getTesselatedPos |
( |
CUV |
uv |
) |
const |
|
|
From the current tesselation of this patch, and a UV in this patch, return tesselated position.
Definition at line 572 of file patch.cpp.
References NLMISC::clamp, Son0, and Son1. |
CTileElement * NL3D::CPatch::getTileElement |
( |
const CUV & |
uv |
) |
|
|
void NL3D::CPatch::getTileLightMapUvInfo |
( |
uint |
ts, |
|
|
uint |
tt, |
|
|
CVector & |
uvScaleBias |
|
) |
[private] |
|
void NL3D::CPatch::getTileLumelmapPixelPrecomputed |
( |
uint |
ts, |
|
|
uint |
tt, |
|
|
uint |
s, |
|
|
uint |
t, |
|
|
uint8 & |
dest |
|
) |
const [private] |
|
void NL3D::CPatch::getTileLumelmapPrecomputed |
( |
uint |
ts, |
|
|
uint |
tt, |
|
|
uint8 * |
dest, |
|
|
uint |
stride |
|
) |
[private] |
|
uint NL3D::CPatch::getTileMaterialRefCount |
( |
|
) |
const [inline] |
|
|
Get number of TileMaterial created in this Patch.
Definition at line 793 of file patch.h.
References MasterBlock. |
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] |
|
bool NL3D::CPatch::isRenderClipped |
( |
|
) |
const [inline] |
|
void NL3D::CPatch::linkBeforeNearUL |
( |
CPatch * |
patchNext |
) |
|
|
|
Used by bind().
Search in the tesselation the first face which own the edge uv0-uv1. link it with linkTo, and return it. NULL if not found (obviously because not so tesselated)
Definition at line 1811 of file patch.cpp.
References CTessFace, nlassert, Son0, and Son1. |
void NL3D::CPatch::makeRoots |
( |
|
) |
[private] |
|
|
Definition at line 1079 of file patch.cpp.
References appendFaceToRenderList, appendFarVertexToRenderList, BaseFarVertices, BaseVertices, clearTessBlocks, computeVertex, ErrorSize, getLandscape, nlassert, OrderS, OrderT, RenderClipped, resetMasterBlock, Son0, and Son1.
Referenced by compile. |
void NL3D::CPatch::modulateTileLightmapEdgeWithTileColors |
( |
uint |
ts, |
|
|
uint |
tt, |
|
|
uint |
edge, |
|
|
NLMISC::CRGBA * |
dest, |
|
|
uint |
stride, |
|
|
bool |
inverse |
|
) |
[private] |
|
void NL3D::CPatch::packLumelBlock |
( |
uint8 * |
dest, |
|
|
const uint8 * |
source, |
|
|
uint8 |
alpha0, |
|
|
uint8 |
alpha1 |
|
) |
[private] |
|
void NL3D::CPatch::packShadowMap |
( |
const uint8 * |
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:
-
unpackShadowMap(), resetCompressedLumels()
Definition at line 1220 of file patch_lightmap.cpp.
References CompressedLumels, evalLumelBlock, NL_BLOCK_LUMEL_COMPRESSED_SIZE, NL_LUMEL_BY_TILE, nlassert, OrderS, OrderT, packLumelBlock, unpackLumelBlock, and v. |
void NL3D::CPatch::preRender |
( |
|
) |
|
|
|
preRender this patch. no-op if(RenderClipped). Build Max faces / pass etc...
Definition at line 253 of file patch_render.cpp.
References allocateVBAndFaceVector, allocateVBAndFaceVectorFar1Only, computeNewFar, deleteVBAndFaceVector, deleteVBAndFaceVectorFar1Only, Far0, Far1, fillFar0VertexListVB, fillFar1VertexListVB, fillTileVertexListVB, fillVB, fillVBFar0Only, fillVBFar1Only, NL3D_TESSBLOCK_TILESIZE, NumRenderableFaces, Pass0, Pass1, TessBlocks, updateFar0VBAlloc, updateFar1VBAlloc, and updateTileVBAlloc. |
void NL3D::CPatch::recreateAllVegetableIgs |
( |
|
) |
|
|
void NL3D::CPatch::recreateTessBlockFaceVector |
( |
CTessBlock & |
block |
) |
|
|
void NL3D::CPatch::recreateTileUvs |
( |
|
) |
|
|
void NL3D::CPatch::refineAll |
( |
|
) |
|
|
void NL3D::CPatch::refreshTesselationGeometry |
( |
|
) |
|
|
void NL3D::CPatch::release |
( |
|
) |
|
|
|
Un-compile a patch. Tesselation is deleted. if patch is not compiled, no - op.
Definition at line 108 of file patch.cpp.
References _DLMContext, _DLMContextRefCount, _ULNearNext, _ULNearPrec, clearTessBlocks, Clipped, deleteVBAndFaceVector, getLandscape, nlassert, OldRenderClipped, OrderS, OrderT, Pass0, Pass1, RenderClipped, resetMasterBlock, resetRenderFar, Son0, Son1, and Zone.
Referenced by ~CPatch. |
void NL3D::CPatch::releaseTileLightMap |
( |
uint |
ts, |
|
|
uint |
tt |
|
) |
[private] |
|
void NL3D::CPatch::releaseVegetableBlock |
( |
uint |
numTb |
) |
[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. Call PatchCurrentDriver->renderSimpleTriangles().
Definition at line 526 of file patch_render.cpp.
References MasterBlock, NL3D_PROFILE_LAND_ADD_FACE_VECTOR, nlassert, Pass0, NL3D::ProfNRdrFar0, RenderClipped, NL3D::renderFaceVector, t, TessBlocks, and Zone. |
void NL3D::CPatch::renderFar1 |
( |
|
) |
|
|
void NL3D::CPatch::resetCompressedLumels |
( |
|
) |
|
|
void NL3D::CPatch::resetMasterBlock |
( |
|
) |
[private] |
|
void NL3D::CPatch::resetRenderFar |
( |
|
) |
|
|
void NL3D::CPatch::resetTileLightInfluences |
( |
|
) |
|
|
|
Definition at line 1560 of file patch.cpp.
References _CornerSmoothFlag, _Version, CompressedLumels, Flags, Interiors, NLMISC::IStream::isReading, NL_PATCH_SMOOTH_FLAG_MASK, nlassert, NoiseRotation, OrderS, OrderT, resetTileLightInfluences, NLMISC::IStream::serial, NLMISC::IStream::serialCont, NLMISC::IStream::serialVersion, Tangents, TileColors, TileLightInfluences, Tiles, Vertices, NLMISC::IStream::xmlPop, NLMISC::IStream::xmlPush, and NLMISC::IStream::xmlSerial. |
void NL3D::CPatch::setCornerSmoothFlag |
( |
uint |
corner, |
|
|
bool |
smooth |
|
) |
|
|
|
setup Smooth flags for Noise on corner: used for Noise geometry and for lighting.
NB: convention: corner0==A, corner1==B ...
Definition at line 949 of file patch_noise.cpp.
References _CornerSmoothFlag, and nlassert. |
void NL3D::CPatch::setSmoothFlag |
( |
uint |
edge, |
|
|
bool |
flag |
|
) |
[inline] |
|
void NL3D::CPatch::setupColorsFromTileFlags |
( |
const NLMISC::CRGBA |
colors[4] |
) |
|
|
|
debug coloring.
User provides a table with 4 colors for each state : color 0 = above water color 1 = underwater color 2 = intersect water color 3 = vegetable disabled
Definition at line 2208 of file patch.cpp.
References index, min, s, and t. |
void NL3D::CPatch::unbind |
( |
|
) |
|
|
void NL3D::CPatch::unlinkNearUL |
( |
|
) |
|
|
|
Definition at line 175 of file patch.cpp.
References CachePatch, LastPatch, and unpack.
Referenced by addPatchBlocksInBBox, addTrianglesInBBox, buildBBox, computeDefaultErrorSize, computeNoise, computeNormalCornerSmooth, computeNormalEdgeSmooth, computeNormalOnNeighbor, computeVertex, createVegetableBlock, and generateTileVegetable. |
void NL3D::CPatch::unpackLumelBlock |
( |
uint8 * |
dest, |
|
|
const uint8 * |
src |
|
) |
[private] |
|
void NL3D::CPatch::unpackShadowMap |
( |
uint8 * |
pShadow |
) |
|
|
void NL3D::CPatch::updateClipPatchVB |
( |
|
) |
|
|
uint NL3D::CPatch::updateTessBlockLighting |
( |
uint |
numTb |
) |
|
|
void NL3D::CPatch::updateTextureFarOnly |
( |
|
) |
|
|
void NL3D::CPatch::updateVBAlloc |
( |
bool |
alloc |
) |
[private] |
|
Friends And Related Function Documentation
friend class CLandscapeVegetableBlock [friend]
|
|
friend class CTessFace [friend]
|
|
friend class CZone [friend]
|
|
Member Data Documentation
CZone* NL3D::CPatch::_BindZoneNeighbor[4] [private]
|
|
uint8 NL3D::CPatch::_CornerSmoothFlag [private]
|
|
|
The Dynamic LightMap context.
created only when compiled, AND (when in Near OR (when in Far AND touched by pointLight)) else NULL.
Definition at line 1205 of file patch.h.
Referenced by addRefDLMContext, beginDLMLighting, CPatch, decRefDLMContext, endDLMLighting, fillFar0DLMUvOnlyVertexListVB, fillFar0VertexVB, fillFar1DLMUvOnlyVertexListVB, fillFar1VertexVB, generateTileVegetable, processDLMLight, and release. |
sint NL3D::CPatch::_DLMContextRefCount [private]
|
|
CPatch* NL3D::CPatch::_ULNearNext [private]
|
|
CPatch* NL3D::CPatch::_ULNearPrec [private]
|
|
uint32 NL3D::CPatch::_Version = 7 [static, private]
|
|
|
Stream version of the class.
Definition at line 53 of file patch.cpp.
Referenced by serial. |
CBSphere NL3D::CPatch::BSphere [private]
|
|
bool NL3D::CPatch::Clipped [private]
|
|
std::vector<uint8> NL3D::CPatch::CompressedLumels
|
|
float NL3D::CPatch::ErrorSize [private]
|
|
bool NL3D::CPatch::ExcludeFromRefineAll [private]
|
|
sint NL3D::CPatch::Far0 [private]
|
|
|
Definition at line 833 of file patch.h.
Referenced by checkCreateVertexVBFar, checkCreateVertexVBNear, checkDeleteVertexVBFar, checkDeleteVertexVBNear, checkFillVertexVBFar, checkFillVertexVBNear, computeNewFar, computeSoftwareGeomorphAndAlpha, CPatch, createFaceVectorFar0OrTile, deleteFaceVectorFar0OrTile, fillVB, fillVBFar0Only, fillVBFarsDLMUvOnly, getFar0, preRender, recreateTessBlockFaceVector, resetRenderFar, updateTextureFarOnly, and updateVBAlloc. |
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]
|
|
|
Definition at line 834 of file patch.h.
Referenced by allocateVBAndFaceVectorFar1Only, checkCreateVertexVBFar, checkDeleteVertexVBFar, checkFillVertexVBFar, computeNewFar, computeSoftwareGeomorphAndAlpha, CPatch, createFaceVectorFar1, deleteFaceVectorFar1, deleteVBAndFaceVectorFar1Only, fillVB, fillVBFar1Only, fillVBFarsDLMUvOnly, getFar1, preRender, recreateTessBlockFaceVector, resetRenderFar, updateTextureFarOnly, and updateVBAlloc. |
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]
|
|
const CPatch * NL3D::CPatch::LastPatch = NULL [static, private]
|
|
|
Definition at line 870 of file patch.h.
Referenced by allocateVBAndFaceVectorFar1Only, appendFaceToRenderList, appendFarVertexToRenderList, appendTileMaterialToRenderList, compile, computeSoftwareGeomorphAndAlpha, CPatch, createFaceVectorFar0OrTile, createFaceVectorFar1, debugAllocationMarkIndices, deleteFaceVectorFar0OrTile, deleteFaceVectorFar1, deleteVBAndFaceVectorFar1Only, fillVB, fillVBFar0Only, fillVBFar1Only, fillVBFarsDLMUvOnly, getTileMaterialRefCount, recreateTessBlockFaceVector, removeFaceFromRenderList, removeFarVertexFromRenderList, removeTileMaterialFromRenderList, renderFar0, renderFar1, resetMasterBlock, and updateVBAlloc. |
uint8 NL3D::CPatch::NoiseRotation
|
|
sint NL3D::CPatch::NumRenderableFaces [private]
|
|
bool NL3D::CPatch::OldRenderClipped [private]
|
|
float NL3D::CPatch::OOTransitionSqrDelta [private]
|
|
uint8 NL3D::CPatch::OrderS [private]
|
|
|
Definition at line 808 of file patch.h.
Referenced by addPatchBlocksInBBox, addPatchBlocksInBBoxRecurs, addRefTessBlocks, addTileTrianglesInBBox, addTrianglesInBBox, appendTileLightInfluences, bind, changeEdgeNeighbor, compile, computeCurrentTLILightmap, computeDisplaceCornerSmooth, computeDisplaceEdgeSmooth, computeDisplaceRawInteger, computeDisplaceRawOnNeighbor, computeNearBlockLightmap, computeNoise, computeNormalOnNeighbor, computeTbTm, computeTileLightmapEdgePrecomputed, computeTileLightmapPixelAroundCorner, computeTileLightmapPixelAutomatic, computeTileLightmapPixelPrecomputed, computeTileLightmapPrecomputed, copyTileFlagsFromPatch, CPatch, createVegetableBlock, generateTileVegetable, getLumel, getNumTessBlock, getOrderForEdge, getOrderS, getRootFaceForEdge, getRootVertexForEdge, getTileElement, getTileLumelmapPixelPrecomputed, getTileLumelmapPrecomputed, getTileTileColors, makeRoots, packShadowMap, recreateAllVegetableIgs, release, resetCompressedLumels, resetTileLightInfluences, serial, unpackShadowMap, and updateTessBlockLighting. |
uint8 NL3D::CPatch::OrderT [private]
|
|
|
Definition at line 808 of file patch.h.
Referenced by addPatchBlocksInBBox, addPatchBlocksInBBoxRecurs, addRefTessBlocks, addTileTrianglesInBBox, addTrianglesInBBox, appendTileLightInfluences, bind, changeEdgeNeighbor, compile, computeCurrentTLILightmap, computeDisplaceCornerSmooth, computeDisplaceEdgeSmooth, computeDisplaceRawInteger, computeDisplaceRawOnNeighbor, computeNearBlockLightmap, computeNoise, computeNormalOnNeighbor, computeTileLightmapPixelAroundCorner, computeTileLightmapPixelAutomatic, copyTileFlagsFromPatch, CPatch, createVegetableBlock, generateTileVegetable, getLumel, getNumTessBlock, getOrderForEdge, getOrderT, getRootFaceForEdge, getRootVertexForEdge, getTileElement, makeRoots, packShadowMap, release, resetCompressedLumels, resetTileLightInfluences, serial, and unpackShadowMap. |
uint16 NL3D::CPatch::PatchId [private]
|
|
bool NL3D::CPatch::RenderClipped [private]
|
|
|
Definition at line 855 of file patch.h.
Referenced by addRefDLMContext, beginDLMLighting, checkCreateVertexVBFar, checkCreateVertexVBNear, checkDeleteVertexVBFar, checkDeleteVertexVBNear, checkFillVertexVBFar, checkFillVertexVBNear, clip, CPatch, decRefDLMContext, dirtTessBlockFaceVector, fillVBIfVisible, forceNoRenderClip, forceRenderClip, isRenderClipped, makeRoots, processDLMLight, recreateTessBlockFaceVector, release, renderFar0, renderFar1, resetMasterBlock, updateClipPatchVB, and updateTextureFarOnly. |
|
Definition at line 822 of file patch.h.
Referenced by appendTessellationLeaves, averageTesselationVertices, bind, changeEdgeNeighbor, CPatch, deleteTileUvs, forceMergeAtTileLevel, getRootFaceForEdge, getRootVertexForEdge, getTesselatedPos, linkTessFaceWithEdge, makeRoots, recreateTileUvs, refineAll, refreshTesselationGeometry, release, and unbind. |
|
Definition at line 822 of file patch.h.
Referenced by appendTessellationLeaves, averageTesselationVertices, bind, changeEdgeNeighbor, CPatch, deleteTileUvs, forceMergeAtTileLevel, getRootFaceForEdge, getRootVertexForEdge, getTesselatedPos, linkTessFaceWithEdge, makeRoots, recreateTileUvs, refineAll, refreshTesselationGeometry, release, and unbind. |
sint NL3D::CPatch::SquareLimitLevel [private]
|
|
sint NL3D::CPatch::TessBlockLimitLevel [private]
|
|
sint NL3D::CPatch::TessBlockRefCount [private]
|
|
std::vector<CTessBlock> NL3D::CPatch::TessBlocks [private]
|
|
|
Definition at line 873 of file patch.h.
Referenced by addRefTessBlocks, allocateVBAndFaceVectorFar1Only, appendFaceToRenderList, appendFaceToTileRenderList, appendFarVertexToRenderList, appendNearVertexToRenderList, appendTileMaterialToRenderList, clearTessBlocks, computeSoftwareGeomorphAndAlpha, createFaceVectorFar0OrTile, createFaceVectorFar1, createVegetableBlock, debugAllocationMarkIndices, deleteAllVegetableIgs, deleteFaceVectorFar0OrTile, deleteFaceVectorFar1, deleteVBAndFaceVectorFar1Only, extendTessBlockWithEndPos, fillVB, fillVBFar0Only, fillVBFar1Only, fillVBFarsDLMUvOnly, getNumNearTessBlocks, getTileLightMap, getTileLightMapUvInfo, preRender, recreateAllVegetableIgs, recreateTileUvs, releaseTileLightMap, releaseVegetableBlock, removeFaceFromRenderList, removeFaceFromTileRenderList, removeFarVertexFromRenderList, removeNearVertexFromRenderList, removeTileMaterialFromRenderList, renderFar0, renderFar1, updateClipPatchVB, updateTessBlockLighting, and updateVBAlloc. |
sint NL3D::CPatch::TileLimitLevel [private]
|
|
float NL3D::CPatch::TransitionSqrMin [private]
|
|
CZone* NL3D::CPatch::Zone [private]
|
|
|
Definition at line 803 of file patch.h.
Referenced by addRefDLMContext, compile, computeContinousVertex, computeNewFar, computeVertexButCorner, CPatch, decRefDLMContext, getLandscape, getTileLightMap, getTileLightMapUvInfo, getTileRenderPass, getTileUvInfo, getZone, release, releaseTileLightMap, renderFar0, renderFar1, resetRenderFar, unpack, and updateTessBlockLighting. |
The documentation for this class was generated from the following files:
|
|