NL3D::CRenderZBuffer Class Reference

Inheritance diagram for NL3D::CRenderZBuffer:

NLMISC::IRunnable

Public Member Functions

 CRenderZBuffer (uint process, CZoneLighter *zoneLighter, const CZoneLighter::CLightDesc *description, uint firstTriangle, uint numTriangle, const vector< CZoneLighter::CTriangle > *triangles)
virtual void getName (std::string &result) const
virtual void run ()

Data Fields

IThreadThread

Private Attributes

const CZoneLighter::CLightDesc_Description
uint _FirstTriangle
uint _NumTriangle
uint _Process
const vector< CZoneLighter::CTriangle > * _Triangles
CZoneLighter_ZoneLighter

Constructor & Destructor Documentation

NL3D::CRenderZBuffer::CRenderZBuffer uint  process,
CZoneLighter zoneLighter,
const CZoneLighter::CLightDesc description,
uint  firstTriangle,
uint  numTriangle,
const vector< CZoneLighter::CTriangle > *  triangles
[inline]
 

Definition at line 422 of file zone_lighter.cpp.

References uint.

00423         {
00424                 _ZoneLighter = zoneLighter;
00425                 _Description = description;
00426                 _Process = process;
00427                 _FirstTriangle = firstTriangle;
00428                 _NumTriangle = numTriangle;
00429                 _Triangles = triangles;
00430         }


Member Function Documentation

virtual void NLMISC::IRunnable::getName std::string &  result  )  const [inline, virtual, inherited]
 

Reimplemented in NL3D::CAsyncFileManager3D::CMeshLoad, NL3D::CAsyncFileManager3D::CIGLoad, NL3D::CAsyncFileManager3D::CIGLoadUser, NL3D::CAsyncFileManager3D::CTextureLoad, NL3D::CZoneLoadingTask, NLPACS::CGlobalRetriever::CLrLoader, NLMISC::CAsyncFileManager::CFileLoad, NLMISC::CAsyncFileManager::CMultipleFileLoad, and NLMISC::CAsyncFileManager::CSignal.

Definition at line 74 of file thread.h.

Referenced by NLMISC::CTaskManager::run().

00075         {
00076                 result = "NoName";
00077         }

void NL3D::CRenderZBuffer::run  )  [virtual]
 

Implements NLMISC::IRunnable.

Definition at line 633 of file zone_lighter.cpp.

References _FirstTriangle, NL3D::CZoneLighter::_Mutex, NL3D::CZoneLighter::_NumberOfPatchComputed, _NumTriangle, NL3D::CZoneLighter::_ProcessExited, NL3D::CZoneLighter::_SunDirection, NL3D::CZoneLighter::_ZBufferLandscape, NL3D::CZoneLighter::_ZBufferObject, NL3D::CZoneLighter::CTriangle::Flags, NLMISC::CPlane::getNormal(), NL3D::CZoneLighter::CTriangle::getPlane(), RenderTriangle(), setCPUMask(), NL3D::CZoneLighter::CLightDesc::SoftShadowSamplesSqrt, NLMISC::CPolygon2D::TRasterVect, and uint.

00634 {
00635         // Set the CPU mask
00636         setCPUMask (Thread, _Process);
00637 
00638         // Span array
00639         CPolygon2D::TRasterVect borders;
00640 
00641         // For each triangles
00642         uint i;
00643         for (i=_FirstTriangle; i<_FirstTriangle+_NumTriangle; i++)
00644         {
00645                 // Triangle reference
00646                 const CZoneLighter::CTriangle &triangle = (*_Triangles)[i];
00647 
00648                 // Keep backface and doublesided polygons
00649                 if ((triangle.Flags & CZoneLighter::CTriangle::DoubleSided) || ((triangle.getPlane ().getNormal() * _ZoneLighter->_SunDirection) > 0))
00650                 {
00651                         // Landscape triangle ?
00652                         if (triangle.Flags & CZoneLighter::CTriangle::Landscape)
00653                         {
00654                                 // For each landscape zbuffer
00655                                 uint sample;
00656                                 const uint samples = _Description->SoftShadowSamplesSqrt*_Description->SoftShadowSamplesSqrt;
00657                                 for (sample=0; sample<samples; sample++)
00658                                 {
00659                                         RenderTriangle (triangle, *_Description, borders, _ZoneLighter->_Mutex, _ZoneLighter->_ZBufferLandscape[sample], 9);
00660                                 }
00661                         }
00662                         else
00663                         {
00664                                 // Render in a high resolution zbuffer
00665                                 RenderTriangle (triangle, *_Description, borders, _ZoneLighter->_Mutex, _ZoneLighter->_ZBufferObject, 1);
00666                         }
00667                 }
00668                 _ZoneLighter->_NumberOfPatchComputed++;
00669         }
00670 
00671         // Exit
00672         _ZoneLighter->_ProcessExited++;
00673 }


Field Documentation

const CZoneLighter::CLightDesc* NL3D::CRenderZBuffer::_Description [private]
 

Definition at line 410 of file zone_lighter.cpp.

uint NL3D::CRenderZBuffer::_FirstTriangle [private]
 

Definition at line 413 of file zone_lighter.cpp.

Referenced by run().

uint NL3D::CRenderZBuffer::_NumTriangle [private]
 

Definition at line 414 of file zone_lighter.cpp.

Referenced by run().

uint NL3D::CRenderZBuffer::_Process [private]
 

Definition at line 406 of file zone_lighter.cpp.

const vector<CZoneLighter::CTriangle>* NL3D::CRenderZBuffer::_Triangles [private]
 

Definition at line 415 of file zone_lighter.cpp.

CZoneLighter* NL3D::CRenderZBuffer::_ZoneLighter [private]
 

Definition at line 407 of file zone_lighter.cpp.

IThread* NL3D::CRenderZBuffer::Thread
 

Definition at line 418 of file zone_lighter.cpp.

Referenced by NL3D::CZoneLighter::light().


The documentation for this class was generated from the following file:
Generated on Tue Mar 16 07:37:25 2004 for NeL by doxygen 1.3.6