From 0ea5fc66924303d1bf73ba283a383e2aadee02f2 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 11 Aug 2018 20:21:34 +0200 Subject: Initial commit --- docs/doxygen/nel/classNL3D_1_1CZoneLighter.html | 3442 +++++++++++++++++++++++ 1 file changed, 3442 insertions(+) create mode 100644 docs/doxygen/nel/classNL3D_1_1CZoneLighter.html (limited to 'docs/doxygen/nel/classNL3D_1_1CZoneLighter.html') diff --git a/docs/doxygen/nel/classNL3D_1_1CZoneLighter.html b/docs/doxygen/nel/classNL3D_1_1CZoneLighter.html new file mode 100644 index 00000000..de3f90ee --- /dev/null +++ b/docs/doxygen/nel/classNL3D_1_1CZoneLighter.html @@ -0,0 +1,3442 @@ + + + + nevrax.org : docs + + + + + + + + + + + + + + +
# Home   # nevrax.com   
+ + + + +
Nevrax
+ + + + + + + + + + +
+ + +
+ Nevrax.org
+ + + + + + + +
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
+
+ + +
+ + +
+Docs + +
+  + + + + + +
Documentation 
+ +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  
+

NL3D::CZoneLighter Class Reference

#include <zone_lighter.h> +

+List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Static PointLights mgt.

void compilePointLightRT (uint gridSize, float gridCellSize, std::vector< CTriangle > &obstacles, bool doShadow)
 Fill CubeGrid, and set PointLightRT in _StaticPointLightQuadGrid. More...

void processZonePointLightRT (std::vector< CPointLightNamed > &listPointLight)
 Process the zone, ie process _PatchInfo. More...

std::vector< CPointLightRT_StaticPointLights
 List of PointLights. More...

CQuadGrid< CPointLightRT * > _StaticPointLightQuadGrid
 QuadGrid of PointLights. Builded from _StaticPointLights. More...


Public Methods

 CZoneLighter ()
virtual ~CZoneLighter ()
void init ()
void light (CLandscape &landscape, CZone &output, uint zoneToLight, const CLightDesc &description, std::vector< CTriangle > &obstacles, std::vector< uint > &listZone)
void addTriangles (CLandscape &landscape, std::vector< uint > &listZone, uint order, std::vector< CTriangle > &triangleArray)
void addTriangles (const IShape &shape, const NLMISC::CMatrix &modelMT, std::vector< CTriangle > &triangleArray)
void addLightableShape (IShape *shape, const NLMISC::CMatrix &modelMT)
 Some shape (water shapes for now) can be lit. More...

void addWaterShape (CWaterShape *shape, const NLMISC::CMatrix &MT)
 Add a water shape. This is needed to decide wether tiles are above / below water. More...

virtual void progress (const char *message, float progress)
Static PointLights mgt.
void addStaticPointLight (const CPointLightNamed &pln)
 Append a static point light to compute. call at setup stage (before light() ). More...


Static Public Methods

bool isLightableShape (IShape &shape)
 check wether a shape is lightable. More...


Private Types

typedef std::vector< CShapeInfoTShapeVect
 A vector of lightable shapes. More...

typedef CQuadGrid< CWaterShape * > TWaterShapeQuadGrid

Private Methods

void addTriangles (const CMeshGeom &meshGeom, const NLMISC::CMatrix &modelMT, std::vector< CTriangle > &triangleArray)
void addTriangles (const CMeshMRMGeom &meshGeom, const CMatrix &modelMT, std::vector< CTriangle > &triangleArray)
void processCalc (uint process, const CLightDesc &description)
void buildZoneInformation (CLandscape &landscape, const std::vector< uint > &listZone, bool oversampling, const CLightDesc &lightDesc)
void excludeAllPatchFromRefineAll (CLandscape &landscape, std::vector< uint > &listZone, bool exclude)
void getPatchNormalAndPositions (std::vector< CLumelDescriptor > &lumels, CLandscape &landscape, uint zoneToLight, uint patch, CPatchUVLocator *locator, bool *binded)
float calcSkyContribution (sint s, sint t, float height, float skyIntensity, const CVector &normal) const
float getSkyContribution (const CVector &pos, const CVector &normal, float SkyIntensity) const
 compute the sky contribution at the given position. More...

uint8 getMaxPhi (sint s, sint t, sint deltaS, sint deltaT, float heightPos) const
void rayTrace (const CVector &position, const CVector &normal, float s, float t, uint patchId, float &factor, CMultiShape &shape, CMultiShape &shapeTmp, uint cpu)
void getNormal (const NL3D::CPatch *pPatch, sint16 lumelS, sint16 lumelT, std::vector< NL3D::CPatchUVLocator > &locator, const std::vector< NL3D::CPatch::CBindInfo > &bindInfo, const std::vector< bool > &binded, std::set< uint64 > &visited, float deltaS, float deltaT, uint rotation, const NL3D::CBezierPatch &bezierPatch, uint lastEdge=5)
void rayTraceTriangle (const NLMISC::CTriangle &toOverSample, NLMISC::CVector &normal, uint order, float s, float t, float &factor, uint &tested, uint patchId)
void testRaytrace (const CVector &position, const CVector &normal, const CPlane &plane, float s, float t, uint patchId, CMultiShape &shape, CMultiShape &shapeTmp, uint cpu)
bool isLumelOnEdgeMustBeOversample (uint patch, uint edge, sint s, sint t, const std::vector< bool > &binded, const std::vector< bool > &oversampleEdges, std::vector< CPatchUVLocator > &locator, uint8 shadowed, std::vector< std::vector< uint8 > > &shadowBuffer)
void lightShapes (uint zoneID, const CLightDesc &description)
 Launch a set of threads to perform lighting of lightable shapes. More...

void processLightableShapeCalc (uint process, TShapeVect *shapeToLit, uint firstShape, uint lastShape, const CLightDesc &description)
 Process lighting for a set of lightable shapes. This is called by the threads created by lightShapes(). More...

void lightSingleShape (CShapeInfo &lsi, CMultiShape &shape, CMultiShape &shapeTmp, const CLightDesc &description, uint cpu)
 Compute the lighting for a single lightable shape. More...

void lightWater (CWaterShape &ws, const CMatrix &MT, CMultiShape &shape, CMultiShape &shapeTmp, const CLightDesc &description, uint cpu)
 Compute the lighting for a water shape. More...

void makeQuadGridFromWaterShapes (NLMISC::CAABBox zoneBBox)
 Make a quad grid of all the water shapes that where registered by calling addWaterShape() The vector of water shapes is released then. More...

void computeTileFlagsForPositionTowardWater (const CLightDesc &lightDesc, std::vector< const CTessFace * > &tessFaces)
 For each tile of the current zone, check wether it below or above water. More...

void setTileFlagsToDefault (std::vector< const CTessFace * > &tessFaces)
 If no water surface overlap the zone, so we set all the flags to 'AboveWater", or don't change them if they were set to 'DisableVegetable'. More...

uint getAPatch (uint process)
 ***********************************************************. More...


Static Private Methods

void copyTileFlags (CZone &destZone, const CZone &srcZone)
 This copy the flags of the tiles from the source zone to a dest zone (result of the lighting). More...


Private Attributes

CQuadGrid< const CTriangle * > _QuadGrid [MAX_CPU_PROCESS]
NLMISC::CMatrix _RayBasis
NLMISC::CVector _RayAdd
NLMISC::CVector _LightDirection
uint _ZoneToLight
NL3D::CLandscape_Landscape
float _ShadowBias
bool _Softshadow
std::vector< std::vector<
+ uint8 > > 
_ShadowArray
CSynchronized< std::vector<
+ bool > > 
_PatchComputed
std::vector< uint_LastPatchComputed
uint _NumberOfPatchComputed
uint _ProcessCount
uint64 _CPUMask
volatile uint _ProcessExited
CShape _Shape
float _ShapeArea
float _ShapeRadius
float _FallofDistance
std::vector< float > _HeightField
sint _HeightFieldCellCount
NLMISC::CVector _OrigineHeightField
float _HeightfieldCellSize
std::vector< CPatchInfo_PatchInfo
std::vector< CBorderVertex_BorderVertices
std::vector< std::vector<
+ CLumelDescriptor > > 
_Lumels
std::vector< std::vector<
+ CBezierPatch > > 
_BezierPatch
std::vector< std::vector<
+ std::vector< CPatchUVLocator > > > 
_Locator
std::vector< std::vector<
+ std::vector< CPatch::CBindInfo > > > 
_BindInfo
std::vector< std::vector<
+ std::vector< bool > > > 
_Binded
std::vector< std::vector<
+ bool > > 
_OversampleEdges
std::map< uint, uint_ZoneId
const NL3D::CPatch_GetNormalPatch
NLMISC::CVector _GetNormalNormal
uint _GetNormalRadius
uint _GetNormalSqRadius
NLMISC::CPoolMemory< CTriangleList_TriangleListAllocateur
NLMISC::CVector _K [256][8]
TShapeVect _LightableShapes
 lightable shapes. More...

uint _NumLightableShapesProcessed
TShapeVect _WaterShapes
 List of all the water shapes in the zone. More...

TWaterShapeQuadGrid _WaterShapeQuadGrid

Static Private Attributes

sint16 _GetNormalDeltaS [4] = { -1, 0, 1, 0 }
sint16 _GetNormalDeltaT [4] = { 0, 1, 0, -1 }

Friends

class NL3D::CCalcRunnable
class CCalcLightableShapeRunnable
+


Member Typedef Documentation

+

+ + + + +
+ + +
typedef std::vector<CShapeInfo> NL3D::CZoneLighter::TShapeVect [private] +
+
+ + + + + +
+   + + +

+A vector of lightable shapes. +

+ +

+Definition at line 372 of file zone_lighter.h.

+

+ + + + +
+ + +
typedef CQuadGrid<CWaterShape *> NL3D::CZoneLighter::TWaterShapeQuadGrid [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 556 of file zone_lighter.h.

+


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + +
CZoneLighter::CZoneLighter  
+
+ + + + + +
+   + + +

+ +

+Definition at line 92 of file zone_lighter.cpp. +

+Referenced by ~CZoneLighter.

+

+ + + + +
+ + + + + + + + + +
virtual NL3D::CZoneLighter::~CZoneLighter   [inline, virtual]
+
+ + + + + +
+   + + +

+ +

+Definition at line 62 of file zone_lighter.h. +

+References CZoneLighter.

+


Member Function Documentation

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void CZoneLighter::addLightableShape IShape  shape,
const NLMISC::CMatrix  modelMT
+
+ + + + + +
+   + + +

+Some shape (water shapes for now) can be lit. +

+This add such a shape to the process of lighting.

+See also:
+isLightableShape()
+

+Definition at line 2421 of file zone_lighter.cpp. +

+References _LightableShapes.

+

+ + + + +
+ + + + + + + + + + +
void CZoneLighter::addStaticPointLight const CPointLightNamed  pln
+
+ + + + + +
+   + + +

+Append a static point light to compute. call at setup stage (before light() ). +

+ +

+Definition at line 2836 of file zone_lighter.cpp. +

+References _StaticPointLights.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
void CZoneLighter::addTriangles const CMeshMRMGeom  meshGeom,
const CMatrix &   modelMT,
std::vector< CTriangle > &   triangleArray
[private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 1647 of file zone_lighter.cpp.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
void CZoneLighter::addTriangles const CMeshGeom  meshGeom,
const NLMISC::CMatrix  modelMT,
std::vector< CTriangle > &   triangleArray
[private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 1595 of file zone_lighter.cpp.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
void CZoneLighter::addTriangles const IShape  shape,
const NLMISC::CMatrix  modelMT,
std::vector< CTriangle > &   triangleArray
+
+ + + + + +
+   + + +

+ +

+Definition at line 1548 of file zone_lighter.cpp. +

+References addTriangles.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void CZoneLighter::addTriangles CLandscape  landscape,
std::vector< uint > &   listZone,
uint   order,
std::vector< CTriangle > &   triangleArray
+
+ + + + + +
+   + + +

+ +

+Definition at line 1490 of file zone_lighter.cpp. +

+References excludeAllPatchFromRefineAll, and min. +

+Referenced by addTriangles.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void CZoneLighter::addWaterShape CWaterShape  shape,
const NLMISC::CMatrix  MT
+
+ + + + + +
+   + + +

+Add a water shape. This is needed to decide wether tiles are above / below water. +

+ +

+Definition at line 2714 of file zone_lighter.cpp. +

+References _WaterShapes.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void CZoneLighter::buildZoneInformation CLandscape  landscape,
const std::vector< uint > &   listZone,
bool   oversampling,
const CLightDesc  lightDesc
[private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 1713 of file zone_lighter.cpp. +

+References _BezierPatch, _Binded, _BindInfo, _GetNormalNormal, _Locator, _Lumels, _OversampleEdges, _TriangleListAllocateur, _WaterShapes, _ZoneId, _ZoneToLight, NLMISC::CPoolMemory< CTriangleList >::allocate, computeTileFlagsForPositionTowardWater, easineasout, getNormal, NLMISC::getPowerOf2, index, NLMISC::isPowerOf2, makeQuadGridFromWaterShapes, NL_LUMEL_BY_TILE, NL_MAX_TILES_BY_PATCH_EDGE, nlassert, NLMISC::CVector::normalize, progress, s, setTileFlagsToDefault, t, and value. +

+Referenced by light.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
float CZoneLighter::calcSkyContribution sint   s,
sint   t,
float   height,
float   skyIntensity,
const CVector &   normal
const [private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 151 of file zone_lighter.cpp. +

+References _K, NLMISC::clamp, deltaDirection, getMaxPhi, height, NLMISC::Pi, s, and t. +

+Referenced by getSkyContribution.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void CZoneLighter::compilePointLightRT uint   gridSize,
float   gridCellSize,
std::vector< CTriangle > &   obstacles,
bool   doShadow
[private]
+
+ + + + + +
+   + + +

+Fill CubeGrid, and set PointLightRT in _StaticPointLightQuadGrid. +

+ +

+Definition at line 2859 of file zone_lighter.cpp. +

+References _StaticPointLightQuadGrid, _StaticPointLights, NL3D_ZONE_LIGHTER_CUBE_GRID_SIZE, and progress. +

+Referenced by light.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void CZoneLighter::computeTileFlagsForPositionTowardWater const CLightDesc  lightDesc,
std::vector< const CTessFace * > &   tessFaces
[private]
+
+ + + + + +
+   + + +

+For each tile of the current zone, check wether it below or above water. +

+The result is stored in the flags of the tile. The quadtree is removed then. +

+Definition at line 3205 of file zone_lighter.cpp. +

+References _WaterShapeQuadGrid, _ZoneToLight, NLMISC::contReset, NLMISC::CAABBox::extend, NLMISC::CAABBox::getMax, NLMISC::CPolygon2D::intersect, NLMISC::CVector::K, nlinfo, progress, NLMISC::CAABBox::setMinMax, TTileOfPatchMap, NLMISC::CPolygon2D::Vertices, NLMISC::CVector::x, NLMISC::CVector::y, z, and NLMISC::CVector::z. +

+Referenced by buildZoneInformation.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void CZoneLighter::copyTileFlags CZone  destZone,
const CZone  srcZone
[static, private]
+
+ + + + + +
+   + + +

+This copy the flags of the tiles from the source zone to a dest zone (result of the lighting). +

+This is needed beacuse these flags are updated to say wether a given tile is above / below water IMPORTANT : the source and destination zones must match of course... +

+Definition at line 606 of file zone_lighter.cpp. +

+References nlassert. +

+Referenced by light.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
void CZoneLighter::excludeAllPatchFromRefineAll CLandscape  landscape,
std::vector< uint > &   listZone,
bool   exclude
[private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 1694 of file zone_lighter.cpp. +

+Referenced by addTriangles.

+

+ + + + +
+ + + + + + + + + + +
uint CZoneLighter::getAPatch uint   process [private]
+
+ + + + + +
+   + + +

+***********************************************************. +

+ +

+Definition at line 3367 of file zone_lighter.cpp. +

+References _LastPatchComputed, _NumberOfPatchComputed, _PatchComputed, _PatchInfo, index, and progress. +

+Referenced by processCalc.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
uint8 CZoneLighter::getMaxPhi sint   s,
sint   t,
sint   deltaS,
sint   deltaT,
float   heightPos
const [private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 866 of file zone_lighter.cpp. +

+References _HeightField, _HeightFieldCellCount, _HeightfieldCellSize, NLMISC::clamp, height, nlassert, NLMISC::Pi, res, s, and t. +

+Referenced by calcSkyContribution.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void CZoneLighter::getNormal const NL3D::CPatch  pPatch,
sint16   lumelS,
sint16   lumelT,
std::vector< NL3D::CPatchUVLocator > &   locator,
const std::vector< NL3D::CPatch::CBindInfo > &   bindInfo,
const std::vector< bool > &   binded,
std::set< uint64 > &   visited,
float   deltaS,
float   deltaT,
uint   rotation,
const NL3D::CBezierPatch  bezierPatch,
uint   lastEdge = 5
[private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 1383 of file zone_lighter.cpp. +

+References _BezierPatch, _Binded, _BindInfo, _GetNormalDeltaS, _GetNormalDeltaT, _GetNormalNormal, _Locator, _ZoneId, id, and nlassert. +

+Referenced by buildZoneInformation.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void NL3D::CZoneLighter::getPatchNormalAndPositions std::vector< CLumelDescriptor > &   lumels,
CLandscape  landscape,
uint   zoneToLight,
uint   patch,
CPatchUVLocator  locator,
bool *   binded
[private]
+
+ + + + + +
+   + + +

+

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
float CZoneLighter::getSkyContribution const CVector &   pos,
const CVector &   normal,
float   SkyIntensity
const [private]
+
+ + + + + +
+   + + +

+compute the sky contribution at the given position. +

+ +

+Definition at line 616 of file zone_lighter.cpp. +

+References _HeightfieldCellSize, _OrigineHeightField, calcSkyContribution, s, t, NLMISC::CVector::x, and NLMISC::CVector::y. +

+Referenced by lightWater, and processCalc.

+

+ + + + +
+ + + + + + + + + +
void CZoneLighter::init  
+
+ + + + + +
+   + + +

+ +

+Definition at line 99 of file zone_lighter.cpp. +

+References _K, NLMISC::Pi, and NLMISC::CVector::set.

+

+ + + + +
+ + + + + + + + + + +
bool CZoneLighter::isLightableShape IShape  shape [static]
+
+ + + + + +
+   + + +

+check wether a shape is lightable. +

+ +

+Definition at line 2431 of file zone_lighter.cpp. +

+Referenced by processLightableShapeCalc.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool CZoneLighter::isLumelOnEdgeMustBeOversample uint   patch,
uint   edge,
sint   s,
sint   t,
const std::vector< bool > &   binded,
const std::vector< bool > &   oversampleEdges,
std::vector< CPatchUVLocator > &   locator,
uint8   shadowed,
std::vector< std::vector< uint8 > > &   shadowBuffer
[private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 1316 of file zone_lighter.cpp. +

+References _GetNormalDeltaS, _GetNormalDeltaT, s, and t. +

+Referenced by processCalc.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void CZoneLighter::light CLandscape  landscape,
CZone  output,
uint   zoneToLight,
const CLightDesc  description,
std::vector< CTriangle > &   obstacles,
std::vector< uint > &   listZone
+
+ + + + + +
+   + + +

+ +

+Definition at line 283 of file zone_lighter.cpp. +

+References _BorderVertices, _CPUMask, _FallofDistance, _HeightField, _HeightFieldCellCount, _HeightfieldCellSize, _Landscape, _LastPatchComputed, _LightDirection, _NumberOfPatchComputed, _OrigineHeightField, _PatchComputed, _PatchInfo, _ProcessCount, _ProcessExited, _QuadGrid, _RayAdd, _RayBasis, _ShadowArray, _ShadowBias, _Shape, _ShapeArea, _ShapeRadius, _Softshadow, _ZoneToLight, buildZoneInformation, compilePointLightRT, copyTileFlags, NLMISC::CMatrix::getI, NLMISC::CMatrix::getJ, NLMISC::CMatrix::invert, lightShapes, MAX_CPU_PROCESS, min, NEL3DCalcBase, nlassert, NLMISC::nlSleep, NLMISC::CVector::normalize, NL3D::CZoneLighter::CShape::NumVertex, NLMISC::Pi, processZonePointLightRT, progress, NL3D::CZoneLighter::CShape::Vertices, x, NLMISC::CVector::x, y, and NLMISC::CVector::y.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void CZoneLighter::lightShapes uint   zoneID,
const CLightDesc  description
[private]
+
+ + + + + +
+   + + +

+Launch a set of threads to perform lighting of lightable shapes. +

+ +

+Definition at line 2448 of file zone_lighter.cpp. +

+References _LightableShapes, _NumLightableShapesProcessed, _ProcessCount, _ProcessExited, CCalcLightableShapeRunnable, min, NLMISC::nlSleep, and progress. +

+Referenced by light.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void CZoneLighter::lightSingleShape CShapeInfo  lsi,
CMultiShape  shape,
CMultiShape  shapeTmp,
const CLightDesc  description,
uint   cpu
[private]
+
+ + + + + +
+   + + +

+Compute the lighting for a single lightable shape. +

+ +

+Definition at line 2508 of file zone_lighter.cpp. +

+References _LightableShapes, _NumLightableShapesProcessed, lightWater, and progress. +

+Referenced by processLightableShapeCalc.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void CZoneLighter::lightWater CWaterShape  ws,
const CMatrix &   MT,
CMultiShape  shape,
CMultiShape  shapeTmp,
const CLightDesc  description,
uint   cpu
[private]
+
+ + + + + +
+   + + +

+Compute the lighting for a water shape. +

+ +

+Definition at line 2584 of file zone_lighter.cpp. +

+References NLMISC::clamp, getExt, NLMISC::CPolygon::getNumVertices, getSkyContribution, height, NLMISC::CMatrix::inverted, NLMISC::CVector::K, min, NLMISC::CRGBA::modulateFromColor, nlwarning, rayTrace, NLMISC::CMatrix::setPos, NLMISC::CMatrix::setRot, NLMISC::CPolygon::Vertices, width, x, NLMISC::CVector::x, NLMISC::CVector2f::x, y, NLMISC::CVector::y, and NLMISC::CVector2f::y. +

+Referenced by lightSingleShape.

+

+ + + + +
+ + + + + + + + + + +
void CZoneLighter::makeQuadGridFromWaterShapes NLMISC::CAABBox   zoneBBox [private]
+
+ + + + + +
+   + + +

+Make a quad grid of all the water shapes that where registered by calling addWaterShape() The vector of water shapes is released then. +

+

+Parameters:
+ + +
bbox  +the bbox of the zone containing the water shapes
+
+

+Definition at line 2724 of file zone_lighter.cpp. +

+References _WaterShapeQuadGrid, _WaterShapes, NLMISC::contReset, NLMISC::CAABBox::getMax, NLMISC::CAABBox::getMin, height, NLMISC::CAABBox::intersect, progress, NLMISC::CAABBox::transformAABBox, and width. +

+Referenced by buildZoneInformation.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void CZoneLighter::processCalc uint   process,
const CLightDesc  description
[private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 638 of file zone_lighter.cpp. +

+References _Binded, _Landscape, _LightDirection, _Locator, _Lumels, _OversampleEdges, _PatchInfo, _ShadowArray, _ZoneId, _ZoneToLight, NLMISC::clamp, getAPatch, getSkyContribution, NL3D::CLandscape::getZone, isLumelOnEdgeMustBeOversample, nlassert, rayTrace, rayTraceTriangle, s, SHAPE_MAX, and t.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void CZoneLighter::processLightableShapeCalc uint   process,
TShapeVect  shapeToLit,
uint   firstShape,
uint   lastShape,
const CLightDesc  description
[private]
+
+ + + + + +
+   + + +

+Process lighting for a set of lightable shapes. This is called by the threads created by lightShapes(). +

+ +

+Definition at line 2484 of file zone_lighter.cpp. +

+References isLightableShape, lightSingleShape, nlassert, and SHAPE_MAX.

+

+ + + + +
+ + + + + + + + + + +
void CZoneLighter::processZonePointLightRT std::vector< CPointLightNamed > &   listPointLight [private]
+
+ + + + + +
+   + + +

+Process the zone, ie process _PatchInfo. +

+MultiCPU: not done for now. Be aware of CPointLightRT::RefCount!!!! +

+Definition at line 2988 of file zone_lighter.cpp. +

+References _Landscape, _PatchInfo, _StaticPointLightQuadGrid, _StaticPointLights, _ZoneToLight, NLMISC::clamp, NL3D::CLandscape::getZone, min, progress, s, t, w, x, and y. +

+Referenced by light.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
virtual void NL3D::CZoneLighter::progress const char *   message,
float   progress
[inline, virtual]
+
+ + + + + +
+   + + +

+ +

+Definition at line 304 of file zone_lighter.h. +

+References progress. +

+Referenced by buildZoneInformation, compilePointLightRT, computeTileFlagsForPositionTowardWater, getAPatch, light, lightShapes, lightSingleShape, makeQuadGridFromWaterShapes, processZonePointLightRT, and progress.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void CZoneLighter::rayTrace const CVector &   position,
const CVector &   normal,
float   s,
float   t,
uint   patchId,
float &   factor,
CMultiShape  shape,
CMultiShape  shapeTmp,
uint   cpu
[private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 1211 of file zone_lighter.cpp. +

+References _LightDirection, _Shape, _ShapeArea, nlassert, s, t, testRaytrace, and NL3D::CZoneLighter::CShape::Vertices. +

+Referenced by lightWater, and processCalc.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void CZoneLighter::rayTraceTriangle const NLMISC::CTriangle  toOverSample,
NLMISC::CVector  normal,
uint   order,
float   s,
float   t,
float &   factor,
uint  tested,
uint   patchId
[private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 1286 of file zone_lighter.cpp. +

+References s, t, NLMISC::CTriangle::V0, NLMISC::CTriangle::V1, and NLMISC::CTriangle::V2. +

+Referenced by processCalc.

+

+ + + + +
+ + + + + + + + + + +
void CZoneLighter::setTileFlagsToDefault std::vector< const CTessFace * > &   tessFaces [private]
+
+ + + + + +
+   + + +

+If no water surface overlap the zone, so we set all the flags to 'AboveWater", or don't change them if they were set to 'DisableVegetable'. +

+ +

+Definition at line 3351 of file zone_lighter.cpp. +

+References _ZoneToLight. +

+Referenced by buildZoneInformation.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void CZoneLighter::testRaytrace const CVector &   position,
const CVector &   normal,
const CPlane &   plane,
float   s,
float   t,
uint   patchId,
CMultiShape  shape,
CMultiShape  shapeTmp,
uint   cpu
[private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 927 of file zone_lighter.cpp. +

+References _FallofDistance, _LightDirection, _QuadGrid, _RayAdd, _RayBasis, _ShadowBias, _ShapeRadius, _Softshadow, _ZoneToLight, AllBack, Clipped, s, NLMISC::CMatrix::setPos, SHAPE_VERTICES_MAX, t, v, NLMISC::CTriangle::V0, NLMISC::CTriangle::V1, NLMISC::CTriangle::V2, x, and y. +

+Referenced by rayTrace.

+


Friends And Related Function Documentation

+

+ + + + +
+ + +
friend class CCalcLightableShapeRunnable [friend] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 316 of file zone_lighter.h. +

+Referenced by lightShapes.

+

+ + + + +
+ + +
friend class NL3D::CCalcRunnable [friend] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 59 of file zone_lighter.h.

+


Member Data Documentation

+

+ + + + +
+ + +
std::vector<std::vector<CBezierPatch> > NL3D::CZoneLighter::_BezierPatch [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 456 of file zone_lighter.h. +

+Referenced by buildZoneInformation, and getNormal.

+

+ + + + +
+ + +
std::vector<std::vector<std::vector<bool> > > NL3D::CZoneLighter::_Binded [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 459 of file zone_lighter.h. +

+Referenced by buildZoneInformation, getNormal, and processCalc.

+

+ + + + +
+ + +
std::vector<std::vector<std::vector<CPatch::CBindInfo> > > NL3D::CZoneLighter::_BindInfo [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 458 of file zone_lighter.h. +

+Referenced by buildZoneInformation, and getNormal.

+

+ + + + +
+ + +
std::vector<CBorderVertex> NL3D::CZoneLighter::_BorderVertices [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 454 of file zone_lighter.h. +

+Referenced by light.

+

+ + + + +
+ + +
uint64 NL3D::CZoneLighter::_CPUMask [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 437 of file zone_lighter.h. +

+Referenced by light.

+

+ + + + +
+ + +
float NL3D::CZoneLighter::_FallofDistance [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 444 of file zone_lighter.h. +

+Referenced by light, and testRaytrace.

+

+ + + + +
+ + +
sint16 CZoneLighter::_GetNormalDeltaS = { -1, 0, 1, 0 } [static, private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 1378 of file zone_lighter.cpp. +

+Referenced by getNormal, and isLumelOnEdgeMustBeOversample.

+

+ + + + +
+ + +
sint16 CZoneLighter::_GetNormalDeltaT = { 0, 1, 0, -1 } [static, private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 1379 of file zone_lighter.cpp. +

+Referenced by getNormal, and isLumelOnEdgeMustBeOversample.

+

+ + + + +
+ + +
NLMISC::CVector NL3D::CZoneLighter::_GetNormalNormal [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 465 of file zone_lighter.h. +

+Referenced by buildZoneInformation, and getNormal.

+

+ + + + +
+ + +
const NL3D::CPatch* NL3D::CZoneLighter::_GetNormalPatch [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 464 of file zone_lighter.h.

+

+ + + + +
+ + +
uint NL3D::CZoneLighter::_GetNormalRadius [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 466 of file zone_lighter.h.

+

+ + + + +
+ + +
uint NL3D::CZoneLighter::_GetNormalSqRadius [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 467 of file zone_lighter.h.

+

+ + + + +
+ + +
std::vector<float> NL3D::CZoneLighter::_HeightField [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 447 of file zone_lighter.h. +

+Referenced by getMaxPhi, and light.

+

+ + + + +
+ + +
sint NL3D::CZoneLighter::_HeightFieldCellCount [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 448 of file zone_lighter.h. +

+Referenced by getMaxPhi, and light.

+

+ + + + +
+ + +
float NL3D::CZoneLighter::_HeightfieldCellSize [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 450 of file zone_lighter.h. +

+Referenced by getMaxPhi, getSkyContribution, and light.

+

+ + + + +
+ + +
NLMISC::CVector NL3D::CZoneLighter::_K[256][8] [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 475 of file zone_lighter.h. +

+Referenced by calcSkyContribution, and init.

+

+ + + + +
+ + +
NL3D::CLandscape* NL3D::CZoneLighter::_Landscape [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 427 of file zone_lighter.h. +

+Referenced by light, processCalc, and processZonePointLightRT.

+

+ + + + +
+ + +
std::vector<uint> NL3D::CZoneLighter::_LastPatchComputed [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 434 of file zone_lighter.h. +

+Referenced by getAPatch, and light.

+

+ + + + +
+ + +
TShapeVect NL3D::CZoneLighter::_LightableShapes [private] +
+
+ + + + + +
+   + + +

+lightable shapes. +

+ +

+Definition at line 549 of file zone_lighter.h. +

+Referenced by addLightableShape, lightShapes, and lightSingleShape.

+

+ + + + +
+ + +
NLMISC::CVector NL3D::CZoneLighter::_LightDirection [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 425 of file zone_lighter.h. +

+Referenced by light, processCalc, rayTrace, and testRaytrace.

+

+ + + + +
+ + +
std::vector<std::vector<std::vector<CPatchUVLocator> > > NL3D::CZoneLighter::_Locator [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 457 of file zone_lighter.h. +

+Referenced by buildZoneInformation, getNormal, and processCalc.

+

+ + + + +
+ + +
std::vector<std::vector<CLumelDescriptor> > NL3D::CZoneLighter::_Lumels [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 455 of file zone_lighter.h. +

+Referenced by buildZoneInformation, and processCalc.

+

+ + + + +
+ + +
uint NL3D::CZoneLighter::_NumberOfPatchComputed [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 435 of file zone_lighter.h. +

+Referenced by getAPatch, and light.

+

+ + + + +
+ + +
uint NL3D::CZoneLighter::_NumLightableShapesProcessed [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 550 of file zone_lighter.h. +

+Referenced by lightShapes, and lightSingleShape.

+

+ + + + +
+ + +
NLMISC::CVector NL3D::CZoneLighter::_OrigineHeightField [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 449 of file zone_lighter.h. +

+Referenced by getSkyContribution, and light.

+

+ + + + +
+ + +
std::vector<std::vector<bool> > NL3D::CZoneLighter::_OversampleEdges [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 460 of file zone_lighter.h. +

+Referenced by buildZoneInformation, and processCalc.

+

+ + + + +
+ + +
CSynchronized<std::vector<bool> > NL3D::CZoneLighter::_PatchComputed [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 433 of file zone_lighter.h. +

+Referenced by getAPatch, and light.

+

+ + + + +
+ + +
std::vector<CPatchInfo> NL3D::CZoneLighter::_PatchInfo [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 453 of file zone_lighter.h. +

+Referenced by getAPatch, light, processCalc, and processZonePointLightRT.

+

+ + + + +
+ + +
uint NL3D::CZoneLighter::_ProcessCount [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 436 of file zone_lighter.h. +

+Referenced by light, and lightShapes.

+

+ + + + +
+ + +
volatile uint NL3D::CZoneLighter::_ProcessExited [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 438 of file zone_lighter.h. +

+Referenced by light, and lightShapes.

+

+ + + + +
+ + +
CQuadGrid<const CTriangle*> NL3D::CZoneLighter::_QuadGrid[MAX_CPU_PROCESS] [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 422 of file zone_lighter.h. +

+Referenced by light, and testRaytrace.

+

+ + + + +
+ + +
NLMISC::CVector NL3D::CZoneLighter::_RayAdd [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 424 of file zone_lighter.h. +

+Referenced by light, and testRaytrace.

+

+ + + + +
+ + +
NLMISC::CMatrix NL3D::CZoneLighter::_RayBasis [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 423 of file zone_lighter.h. +

+Referenced by light, and testRaytrace.

+

+ + + + +
+ + +
std::vector<std::vector<uint8> > NL3D::CZoneLighter::_ShadowArray [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 430 of file zone_lighter.h. +

+Referenced by light, and processCalc.

+

+ + + + +
+ + +
float NL3D::CZoneLighter::_ShadowBias [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 428 of file zone_lighter.h. +

+Referenced by light, and testRaytrace.

+

+ + + + +
+ + +
CShape NL3D::CZoneLighter::_Shape [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 441 of file zone_lighter.h. +

+Referenced by light, and rayTrace.

+

+ + + + +
+ + +
float NL3D::CZoneLighter::_ShapeArea [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 442 of file zone_lighter.h. +

+Referenced by light, and rayTrace.

+

+ + + + +
+ + +
float NL3D::CZoneLighter::_ShapeRadius [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 443 of file zone_lighter.h. +

+Referenced by light, and testRaytrace.

+

+ + + + +
+ + +
bool NL3D::CZoneLighter::_Softshadow [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 429 of file zone_lighter.h. +

+Referenced by light, and testRaytrace.

+

+ + + + +
+ + +
CQuadGrid<CPointLightRT*> NL3D::CZoneLighter::_StaticPointLightQuadGrid [private] +
+
+ + + + + +
+   + + +

+QuadGrid of PointLights. Builded from _StaticPointLights. +

+ +

+Definition at line 533 of file zone_lighter.h. +

+Referenced by compilePointLightRT, and processZonePointLightRT.

+

+ + + + +
+ + +
std::vector<CPointLightRT> NL3D::CZoneLighter::_StaticPointLights [private] +
+
+ + + + + +
+   + + +

+List of PointLights. +

+ +

+Definition at line 531 of file zone_lighter.h. +

+Referenced by addStaticPointLight, compilePointLightRT, and processZonePointLightRT.

+

+ + + + +
+ + +
NLMISC::CPoolMemory<CTriangleList> NL3D::CZoneLighter::_TriangleListAllocateur [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 472 of file zone_lighter.h. +

+Referenced by buildZoneInformation.

+

+ + + + +
+ + +
TWaterShapeQuadGrid NL3D::CZoneLighter::_WaterShapeQuadGrid [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 558 of file zone_lighter.h. +

+Referenced by computeTileFlagsForPositionTowardWater, and makeQuadGridFromWaterShapes.

+

+ + + + +
+ + +
TShapeVect NL3D::CZoneLighter::_WaterShapes [private] +
+
+ + + + + +
+   + + +

+List of all the water shapes in the zone. +

+We need them to check wether the tiles are above / below water, or if theyr intersect water +

+Definition at line 554 of file zone_lighter.h. +

+Referenced by addWaterShape, buildZoneInformation, and makeQuadGridFromWaterShapes.

+

+ + + + +
+ + +
std::map<uint, uint> NL3D::CZoneLighter::_ZoneId [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 461 of file zone_lighter.h. +

+Referenced by buildZoneInformation, getNormal, and processCalc.

+

+ + + + +
+ + +
uint NL3D::CZoneLighter::_ZoneToLight [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 426 of file zone_lighter.h. +

+Referenced by buildZoneInformation, computeTileFlagsForPositionTowardWater, light, processCalc, processZonePointLightRT, setTileFlagsToDefault, and testRaytrace.

+


The documentation for this class was generated from the following files: + + + +
                                                                                                                                                                    +
+ + -- cgit v1.2.1