|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CPatchDLMContext Class ReferenceA Dynamic LightMap (DLM) context for a patch.
More...
#include <patchdlm_context.h>
Inheritance diagram for NL3D::CPatchDLMContext:
List of all members.
Public Types |
enum | TCompileType { ModulateTileColor = 0,
ModulateTextureFar,
ModulateConstant,
NoModulate
} |
| see compileLighting(). More...
|
Public Methods |
| CPatchDLMContext () |
| Constructor. More...
|
| ~CPatchDLMContext () |
| Destructor: lightmap is released from _DLMTexture. More...
|
bool | generate (CPatch *patch, CTextureDLM *textureDLM, CPatchDLMContextList *ctxList) |
| generate: link to patch and allocate texture space, compile vertices etc... More...
|
void | clearLighting () |
| Fill texture space with Black: RAM texture is updated. More...
|
void | addPointLightInfluence (const CPatchDLMPointLight &pl) |
| Add a pointLight influence to the lighting: RAM texture is updated. More...
|
void | compileLighting (TCompileType compType, NLMISC::CRGBA modulateCte=NLMISC::CRGBA::White) |
| update VRAM texture with RAM texture. More...
|
CPatch * | getPatch () const |
uint | getMemorySize () const |
Public Attributes |
uint | TextPosX |
| DLM info The position and size of the DLM in the texture, in pixels. More...
|
uint | TextPosY |
| DLM info The position and size of the DLM in the texture, in pixels. More...
|
uint | Width |
| DLM info The position and size of the DLM in the texture, in pixels. More...
|
uint | Height |
| DLM info The position and size of the DLM in the texture, in pixels. More...
|
float | DLMUScale |
| Mapping to this rectangle from 0-1 basis. More...
|
float | DLMVScale |
| Mapping to this rectangle from 0-1 basis. More...
|
float | DLMUBias |
| Mapping to this rectangle from 0-1 basis. More...
|
float | DLMVBias |
| Mapping to this rectangle from 0-1 basis. More...
|
uint8 | MinU8 |
| texture coordinate bound in 8 bits. Important for Vegetable special DLM mapping. More...
|
uint8 | MaxU8 |
| texture coordinate bound in 8 bits. Important for Vegetable special DLM mapping. More...
|
uint8 | MinV8 |
uint8 | MaxV8 |
uint | OldPointLightCount |
| Lighting Process: number of light contribution to this patch in last rneder, and in cur Render. More...
|
uint | CurPointLightCount |
Private Methods |
void | computeTextureFar () |
Static Private Methods |
const CRGBA * | computeTileFarSrcDeltas (sint nRot, bool is256x256, uint8 uvOff, const CRGBA *srcPixel, sint &srcDeltaX, sint &srcDeltaY) |
void | copyTileToTexture (const CRGBA *srcPixel, sint srcDeltaX, sint srcDeltaY, CRGBA *dstPixel, uint dstStride) |
void | blendTileToTexture (const CRGBA *srcPixel, sint srcDeltaX, sint srcDeltaY, CRGBA *dstPixel, uint dstStride) |
Private Attributes |
CPatch * | _Patch |
| The patch which owns us. More...
|
CTextureDLM * | _DLMTexture |
| The DLM texture (only one per landscape). More...
|
CPatchDLMContextList * | _DLMContextList |
NLMISC::CObjectVector< CVertex > | _Vertices |
| Bezier Patch Array information: Width*Height. More...
|
NLMISC::CObjectVector< CRGBA > | _LightMap |
| The computed lightmap: Width*Height. More...
|
NLMISC::CObjectVector< CCluster > | _Clusters |
| Bounding Sphere QuadTree (with NSkips paradigm). More...
|
bool | _IsSrcTextureFullBlack |
bool | _IsDstTextureFullBlack |
NLMISC::CObjectVector< uint16,
false > | _LowResTileColors |
NLMISC::CObjectVector< CRGBA > | _TextureFar |
| The TextureFar (at tile level or less), which is always computed at generate(). More...
|
Detailed Description
A Dynamic LightMap (DLM) context for a patch.
-
Author:
-
Lionel Berenguier , Nevrax France
-
Date:
-
2002
Definition at line 100 of file patchdlm_context.h.
Member Enumeration Documentation
enum NL3D::CPatchDLMContext::TCompileType
|
|
Constructor & Destructor Documentation
NL3D::CPatchDLMContext::CPatchDLMContext |
( |
|
) |
|
|
NL3D::CPatchDLMContext::~CPatchDLMContext |
( |
|
) |
|
|
Member Function Documentation
|
Add a pointLight influence to the lighting: RAM texture is updated.
NB: full src blackness is reseted.
Definition at line 648 of file patchdlm_context.cpp.
References _Clusters, _IsSrcTextureFullBlack, _LightMap, _Vertices, NL3D::fastClamp01, Height, min, NL_DLM_CLIP_FACTOR, nlassert, NL3D::OptFastFloor24, NL3D::OptFastFloorBegin24, NL3D::OptFastFloorEnd24, r, NLMISC::CObjectVector< CCluster >::size, NLMISC::CObjectVector< CRGBA >::size, NLMISC::CObjectVector< CVertex >::size, Width, x, and y. |
void NL3D::CPatchDLMContext::blendTileToTexture |
( |
const CRGBA * |
srcPixel, |
|
|
sint |
srcDeltaX, |
|
|
sint |
srcDeltaY, |
|
|
CRGBA * |
dstPixel, |
|
|
uint |
dstStride |
|
) |
[static, private] |
|
void NL3D::CPatchDLMContext::clearLighting |
( |
|
) |
|
|
|
update VRAM texture with RAM texture.
Uploaded in 16 bits format. NB: full dst blackness is cached. -
Parameters:
-
compType |
say if, before writing to the texture, the lightmap is modulated with _Patch TileColor, _Patch textureFar (precomputed in the context), modulate with a constant or not modulated at all |
modulateCte |
used only if compType==ModulateConstant. this is the cte to be modulate by lightmap before copy to texture |
Definition at line 888 of file patchdlm_context.cpp.
References _DLMTexture, _IsDstTextureFullBlack, _IsSrcTextureFullBlack, _LightMap, _LowResTileColors, _Patch, _TextureFar, Height, ModulateConstant, ModulateTextureFar, ModulateTileColor, nlassert, NLMISC::CObjectVector< CRGBA >::size, TextPosX, TextPosY, and Width. |
void NL3D::CPatchDLMContext::computeTextureFar |
( |
|
) |
[private] |
|
|
Definition at line 964 of file patchdlm_context.cpp.
References _LowResTileColors, _Patch, _TextureFar, blendTileToTexture, computeTileFarSrcDeltas, copyTileToTexture, Height, NLAISCRIPT::l, NL_TILE_ELM_LAYER_EMPTY, nlassert, NLMISC::CObjectVector< CRGBA >::resize, src, Width, x, and y.
Referenced by generate. |
const CRGBA * NL3D::CPatchDLMContext::computeTileFarSrcDeltas |
( |
sint |
nRot, |
|
|
bool |
is256x256, |
|
|
uint8 |
uvOff, |
|
|
const CRGBA * |
srcPixel, |
|
|
sint & |
srcDeltaX, |
|
|
sint & |
srcDeltaY |
|
) |
[static, private] |
|
void NL3D::CPatchDLMContext::copyTileToTexture |
( |
const CRGBA * |
srcPixel, |
|
|
sint |
srcDeltaX, |
|
|
sint |
srcDeltaY, |
|
|
CRGBA * |
dstPixel, |
|
|
uint |
dstStride |
|
) |
[static, private] |
|
|
generate: link to patch and allocate texture space, compile vertices etc...
The context is also linked to the list, and removed automaticllay at dtor Texture space is filled with black (RAM only) -
Returns:
-
false if cannot allocate texture space for this patch
Definition at line 214 of file patchdlm_context.cpp.
References _Clusters, _DLMContextList, _DLMTexture, _LightMap, _LowResTileColors, _Patch, _Vertices, NLMISC::clamp, clearLighting, computeTextureFar, DLMUBias, DLMUScale, DLMVBias, DLMVScale, Height, MaxU8, MaxV8, min, MinU8, MinV8, NL_DLM_CLIP_FACTOR, NL_DLM_CLIP_NUM_LEVEL, nlassert, nlstop, NLMISC::CObjectVector< uint16, false >::resize, NLMISC::CObjectVector< CCluster >::resize, NLMISC::CObjectVector< CVertex >::resize, NLMISC::CObjectVector< CRGBA >::resize, s, NLMISC::CObjectVector< CCluster >::size, t, TextPosX, TextPosY, Width, x, and y. |
uint NL3D::CPatchDLMContext::getMemorySize |
( |
|
) |
const |
|
CPatch* NL3D::CPatchDLMContext::getPatch |
( |
|
) |
const [inline] |
|
Member Data Documentation
CTextureDLM* NL3D::CPatchDLMContext::_DLMTexture [private]
|
|
bool NL3D::CPatchDLMContext::_IsDstTextureFullBlack [private]
|
|
bool NL3D::CPatchDLMContext::_IsSrcTextureFullBlack [private]
|
|
CPatch* NL3D::CPatchDLMContext::_Patch [private]
|
|
uint NL3D::CPatchDLMContext::CurPointLightCount
|
|
float NL3D::CPatchDLMContext::DLMUBias
|
|
float NL3D::CPatchDLMContext::DLMUScale
|
|
float NL3D::CPatchDLMContext::DLMVBias
|
|
float NL3D::CPatchDLMContext::DLMVScale
|
|
uint NL3D::CPatchDLMContext::Height
|
|
uint8 NL3D::CPatchDLMContext::MaxU8
|
|
|
texture coordinate bound in 8 bits. Important for Vegetable special DLM mapping.
Definition at line 121 of file patchdlm_context.h.
Referenced by generate. |
uint8 NL3D::CPatchDLMContext::MaxV8
|
|
uint8 NL3D::CPatchDLMContext::MinU8
|
|
|
texture coordinate bound in 8 bits. Important for Vegetable special DLM mapping.
Definition at line 121 of file patchdlm_context.h.
Referenced by generate. |
uint8 NL3D::CPatchDLMContext::MinV8
|
|
uint NL3D::CPatchDLMContext::OldPointLightCount
|
|
uint NL3D::CPatchDLMContext::TextPosX
|
|
uint NL3D::CPatchDLMContext::TextPosY
|
|
uint NL3D::CPatchDLMContext::Width
|
|
The documentation for this class was generated from the following files:
|
|