|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CInstanceLighter Class ReferenceA class to precompute "StaticSetup" lighting for instances in an InstanceGroup.
More...
#include <instance_lighter.h>
List of all members.
Cell Iteration. ie iteration on _IGRetrieverGridMap cells and _IGSurfaceLightBuild cells |
void | beginCell () |
void | nextCell () |
bool | isEndCell () |
CSurfaceLightGrid::CCellCorner & | getCurrentCell () |
CIGSurfaceLightBuild::CCellCorner & | getCurrentCellInfo () |
bool | isCurrentNeighborCellInSurface (sint xnb, sint ynb) |
CSurfaceLightGrid::CCellCorner & | getCurrentNeighborCell (sint xnb, sint ynb) |
CIGSurfaceLightBuild::CCellCorner & | getCurrentNeighborCellInfo (sint xnb, sint ynb) |
uint | getCurrentCellNumber () const |
uint | getTotalCellNumber () const |
void | progressCell (const char *message) |
CIGSurfaceLight::ItRetrieverGridMap | _ItRetriever |
CIGSurfaceLightBuild::ItRetrieverGridMap | _ItRetrieverInfo |
uint | _ItSurfId |
uint | _ItCellId |
bool | _IsEndCell |
uint | _ItCurrentCellNumber |
uint | _TotalCellNumber |
float | _LastCellProgress |
Public Types |
enum | { MaxOverSamples = 16
} |
Public Methods |
| CInstanceLighter () |
| Constructor. More...
|
virtual | ~CInstanceLighter () |
| Destructor. More...
|
void | init () |
void | light (const CInstanceGroup &igIn, CInstanceGroup &igOut, const CLightDesc &lightDesc, std::vector< CTriangle > &obstacles, CLandscape *landscape=NULL, CIGSurfaceLightBuild *igSurfaceLightBuild=NULL) |
| Light an InstanceGroup igOut has different PointLights than igIn. More...
|
virtual void | progress (const char *message, float progress) |
|
void | addStaticPointLight (const CPointLightNamed &pln) |
| Append a static point light to compute. More...
|
Static Public Methods |
void | lightIgSimple (CInstanceLighter &instLighter, const CInstanceGroup &igIn, CInstanceGroup &igOut, const CLightDesc &lightDesc) |
| Tool method which take a single IG, and do all the god job to light this one, with no other dependencies NB: it uses instLighter passed, init() ing it. More...
|
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, sint instanceId) |
| Add triangles from a transform shape. More...
|
Private Methods |
void | computeSunContribution (const CLightDesc &lightDesc, std::vector< CTriangle > &obstacles, CLandscape *landscape) |
void | dilateLightingOnSurfaceCells () |
void | compilePointLightRT (uint gridSize, float gridCellSize, std::vector< CTriangle > &obstacles, bool doShadow) |
| Fill CubeGrid, and set PointLightRT in _StaticPointLightQuadGrid. More...
|
void | processIGPointLightRT (std::vector< CPointLightNamed > &listPointLight) |
| Process the IG, ie process _InstanceInfos. More...
|
Static Private Methods |
void | addTriangles (const CMeshGeom &meshGeom, const NLMISC::CMatrix &modelMT, std::vector< CTriangle > &triangleArray, sint instanceId) |
void | addTriangles (const CMeshMRMGeom &meshGeom, const NLMISC::CMatrix &modelMT, std::vector< CTriangle > &triangleArray, sint instanceId) |
void | excludeAllPatchFromRefineAll (CLandscape &landscape, std::vector< uint > &listZone, bool exclude) |
Private Attributes |
std::vector< CInstanceGroup::CInstance > | _Instances |
std::vector< CInstanceInfo > | _InstanceInfos |
sint | _CurrentInstanceComputed |
CIGSurfaceLightBuild * | _IGSurfaceLightBuild |
CIGSurfaceLight::TRetrieverGridMap | _IGRetrieverGridMap |
std::vector< CPointLightRT > | _StaticPointLights |
| List of PointLights. More...
|
CQuadGrid< CPointLightRT * > | _StaticPointLightQuadGrid |
| QuadGrid of PointLights. Builded from _StaticPointLights. More...
|
Detailed Description
A class to precompute "StaticSetup" lighting for instances in an InstanceGroup.
Class "inspired" from CZoneLighter :) -
Author:
-
Lionel Berenguier , Nevrax France
-
Date:
-
2001
Definition at line 55 of file instance_lighter.h.
Member Enumeration Documentation
Constructor & Destructor Documentation
NL3D::CInstanceLighter::CInstanceLighter |
( |
|
) |
|
|
virtual NL3D::CInstanceLighter::~CInstanceLighter |
( |
|
) |
[inline, virtual] |
|
Member Function Documentation
void NL3D::CInstanceLighter::addStaticPointLight |
( |
const CPointLightNamed & |
pln |
) |
|
|
|
Append a static point light to compute.
call at setup stage (before light() ). NB: you must append all PointLights of intersets, even ones from the IG to compute.
Definition at line 999 of file instance_lighter.cpp.
References _StaticPointLights. |
|
Add triangles from a transform shape.
Work only for CMesh, CMultiMesh and CMeshMRM all without skinning. Give An instanceId!=-1 only for instances of the IG to compute. This is to avoid auto-shadowing.
Definition at line 129 of file instance_lighter.cpp.
References addTriangles. |
void NL3D::CInstanceLighter::addTriangles |
( |
CLandscape & |
landscape, |
|
|
std::vector< uint > & |
listZone, |
|
|
uint |
order, |
|
|
std::vector< CTriangle > & |
triangleArray |
|
) |
[static] |
|
void NL3D::CInstanceLighter::beginCell |
( |
|
) |
[private] |
|
|
Definition at line 1615 of file instance_lighter.cpp.
References _IGRetrieverGridMap, _IGSurfaceLightBuild, _IsEndCell, _ItCellId, _ItCurrentCellNumber, _ItRetriever, _ItRetrieverInfo, _ItSurfId, _LastCellProgress, and nlassert.
Referenced by computeSunContribution, dilateLightingOnSurfaceCells, and processIGPointLightRT. |
void NL3D::CInstanceLighter::compilePointLightRT |
( |
uint |
gridSize, |
|
|
float |
gridCellSize, |
|
|
std::vector< CTriangle > & |
obstacles, |
|
|
bool |
doShadow |
|
) |
[private] |
|
void NL3D::CInstanceLighter::computeSunContribution |
( |
const CLightDesc & |
lightDesc, |
|
|
std::vector< CTriangle > & |
obstacles, |
|
|
CLandscape * |
landscape |
|
) |
[private] |
|
|
Definition at line 633 of file instance_lighter.cpp.
References _CurrentInstanceComputed, _InstanceInfos, _Instances, beginCell, getCurrentCell, getCurrentCellInfo, isEndCell, NEL3DCalcBase, nextCell, nlassert, progress, and progressCell.
Referenced by light. |
void NL3D::CInstanceLighter::dilateLightingOnSurfaceCells |
( |
|
) |
[private] |
|
void NL3D::CInstanceLighter::excludeAllPatchFromRefineAll |
( |
CLandscape & |
landscape, |
|
|
std::vector< uint > & |
listZone, |
|
|
bool |
exclude |
|
) |
[static, private] |
|
uint NL3D::CInstanceLighter::getCurrentCellNumber |
( |
|
) |
const [inline, private] |
|
uint NL3D::CInstanceLighter::getTotalCellNumber |
( |
|
) |
const [inline, private] |
|
void NL3D::CInstanceLighter::init |
( |
|
) |
|
|
bool NL3D::CInstanceLighter::isCurrentNeighborCellInSurface |
( |
sint |
xnb, |
|
|
sint |
ynb |
|
) |
[private] |
|
bool NL3D::CInstanceLighter::isEndCell |
( |
|
) |
[private] |
|
|
Light an InstanceGroup igOut has different PointLights than igIn.
eg: if a pointLight do not light anything, then it is not present in igOut. NB: shapes are used to retrieve usefull info on them (center of AABBox ...) . They are taken from lightDesc.UserShapeMap, or loaded from lightDesc.ShapePath if not found. -
Parameters:
-
landscape |
if !NULL use this Landscape SunContribution, looking landscape faces under each instance, for faster computing, and to get influence of Sky. NB: this landscape does not have to be tesselated, but all Zones that lies under igIn should be loaded in. |
igSurfaceLightBuild |
if !NULL, light() will compute igOut.IGSurfaceLight, else it is just cleared. |
Definition at line 305 of file instance_lighter.cpp.
References _IGRetrieverGridMap, _IGSurfaceLightBuild, _InstanceInfos, _Instances, _IsEndCell, _TotalCellNumber, compilePointLightRT, computeSunContribution, dilateLightingOnSurfaceCells, MaxOverSamples, nlassert, nlwarning, and processIGPointLightRT. |
|
Tool method which take a single IG, and do all the god job to light this one, with no other dependencies NB: it uses instLighter passed, init() ing it.
It use lightDesc.UserShapeMap or it load Shape in directory lightDesc.ShapePath
Definition at line 1482 of file instance_lighter.cpp.
References nlwarning. |
void NL3D::CInstanceLighter::nextCell |
( |
|
) |
[private] |
|
|
Definition at line 1643 of file instance_lighter.cpp.
References _IGRetrieverGridMap, _IGSurfaceLightBuild, _IsEndCell, _ItCellId, _ItCurrentCellNumber, _ItRetriever, _ItRetrieverInfo, _ItSurfId, isEndCell, and nlassert.
Referenced by computeSunContribution, dilateLightingOnSurfaceCells, and processIGPointLightRT. |
void NL3D::CInstanceLighter::processIGPointLightRT |
( |
std::vector< CPointLightNamed > & |
listPointLight |
) |
[private] |
|
|
Process the IG, ie process _InstanceInfos.
Also process SurfaceLightGrid MultiCPU: not done for now. Be aware of CPointLightRT::RefCount!!!!
Definition at line 1160 of file instance_lighter.cpp.
References _CurrentInstanceComputed, _InstanceInfos, _Instances, _StaticPointLightQuadGrid, _StaticPointLights, beginCell, getCurrentCell, getCurrentCellInfo, isEndCell, min, nextCell, progress, and progressCell.
Referenced by light. |
virtual void NL3D::CInstanceLighter::progress |
( |
const char * |
message, |
|
|
float |
progress |
|
) |
[inline, virtual] |
|
void NL3D::CInstanceLighter::progressCell |
( |
const char * |
message |
) |
[private] |
|
Member Data Documentation
sint NL3D::CInstanceLighter::_CurrentInstanceComputed [private]
|
|
std::vector<CInstanceInfo> NL3D::CInstanceLighter::_InstanceInfos [private]
|
|
bool NL3D::CInstanceLighter::_IsEndCell [private]
|
|
uint NL3D::CInstanceLighter::_ItCellId [private]
|
|
uint NL3D::CInstanceLighter::_ItCurrentCellNumber [private]
|
|
uint NL3D::CInstanceLighter::_ItSurfId [private]
|
|
float NL3D::CInstanceLighter::_LastCellProgress [private]
|
|
std::vector<CPointLightRT> NL3D::CInstanceLighter::_StaticPointLights [private]
|
|
uint NL3D::CInstanceLighter::_TotalCellNumber [private]
|
|
The documentation for this class was generated from the following files:
|
|