#include <render_trav.h>
Inheritance diagram for NL3D::CRenderTrav:

This traversal has no graph of models
USER RULES: Before using traverse() on a render traversal, you should:
NB: see CScene for 3d conventions (orthonormal basis...)
Nevrax France
Definition at line 100 of file render_trav.h.
Render Lighting Setup. FOR MODEL TRAVERSING ONLY. | |
| enum | { MaxVPLight = 4 } |
| void | beginVPLightSetup (uint ctStart, bool supportSpecular, const CMatrix &invObjectWM) |
| void | changeLightSetup (CLightContribution *lightContribution, bool useLocalAttenuation) |
| void | changeVPLightSetupMaterial (const CMaterial &mat, bool excludeStrongest) |
| const CLight & | getDriverLight (sint index) const |
| uint | getNumVPLights () const |
| void | getStrongestLightColors (NLMISC::CRGBA &diffuse, NLMISC::CRGBA &specular) |
| sint | getStrongestLightIndex () const |
| return an index to the current strongest settuped light (or -1 if there's none) | |
| void | resetLightSetup () |
| std::string | getLightVPFragment (uint numActivePointLights, uint ctStart, bool supportSpecular, bool normalize) |
Render Lighting Setup. | |
| const CVector | getSunDirection () const |
| void | setSunDirection (const CVector &dir) |
| NLMISC::CRGBA | AmbientGlobal |
| bool | LightingSystemEnabled |
| NLMISC::CRGBA | SunAmbient |
| NLMISC::CRGBA | SunDiffuse |
| NLMISC::CRGBA | SunSpecular |
Special Landscape RenderList. | |
| The Landscape list is separated from std render List for optimisation purpose. See Doc in traverse() method. | |
| void | clearRenderLandscapeList () |
| void | renderLandscapes () |
| std::vector< CLandscapeModel * > | _LandscapeRenderList |
Public Types | |
Public Member Functions | |
| void | addRenderLandscape (CLandscapeModel *model) |
| CRenderTrav () | |
| Constructor. | |
| IDriver * | getAuxDriver () |
| IDriver * | getDriver () |
| bool | getLayersRenderingOrder () const |
| CVertexStreamManager * | getMeshSkinManager () const |
| get the MeshSkinManager | |
| const CShadowMapManager & | getShadowMapManager () const |
| CShadowMapManager & | getShadowMapManager () |
| get the CShadowMapManager | |
| CVertexStreamManager * | getShadowMeshSkinManager () const |
| CViewport | getViewport () const |
| bool | isCurrentPassOpaque () |
| void | setCamMatrix (const NLMISC::CMatrix &camMatrix) |
| Setup the camera matrix (a translation/rotation matrix). | |
| void | setDriver (IDriver *drv) |
| void | setFrustum (float width, float height, float znear, float zfar, bool perspective=true) |
| Setup the camera mode as a perspective/ortho camera. NB: znear and zfar must be >0 (if perspective). | |
| void | setFrustum (float left, float right, float bottom, float top, float znear, float zfar, bool perspective=true) |
| Setup the camera mode as a perspective/ortho camera. NB: znear and zfar must be >0 (if perspective). | |
| void | setLayersRenderingOrder (bool directOrder=true) |
| void | setMeshSkinManager (CVertexStreamManager *msm) |
| void | setShadowMeshSkinManager (CVertexStreamManager *msm) |
| the MeshSkinManager for Shadow. Same Behaviour than std MeshSkinManager. NB: the Shadow MSM is inited with AuxDriver. | |
| void | setupDriverCamera () |
| void | setViewport (const CViewport &viewport) |
RenderList. | |
| void | addRenderModel (CTransform *m) |
| void | clearRenderList () |
| Clear the list of rendered models. | |
| void | reserveRenderList (uint numModels) |
ITravScene Implementation. | |
| void | traverse () |
Data Fields | |
| CScene * | Scene |
FOR MODEL TRAVERSING ONLY. (Read only) | |
Those variables are valid only in traverse(). | |
| float | Bottom |
| NLMISC::CVector | CamLook |
| NLMISC::CMatrix | CamMatrix |
| NLMISC::CVector | CamPos |
| float | Far |
| float | Left |
| float | Near |
| bool | Perspective |
| float | Right |
| float | Top |
| NLMISC::CMatrix | ViewMatrix |
FOR MODEL TRAVERSING ONLY. (Read only) | |
Those variables are valid only in traverse(). | |
| float | Bottom |
| NLMISC::CVector | CamLook |
| NLMISC::CMatrix | CamMatrix |
| NLMISC::CVector | CamPos |
| float | Far |
| float | Left |
| float | Near |
| bool | Perspective |
| float | Right |
| float | Top |
| NLMISC::CMatrix | ViewMatrix |
FOR MODEL TRAVERSING ONLY. (Read only) | |
Those variables are valid only in traverse(). | |
| float | Bottom |
| NLMISC::CVector | CamLook |
| NLMISC::CMatrix | CamMatrix |
| NLMISC::CVector | CamPos |
| float | Far |
| float | Left |
| float | Near |
| bool | Perspective |
| float | Right |
| float | Top |
| NLMISC::CMatrix | ViewMatrix |
MeshBlock Manager. FOR MODEL TRAVERSING AND MESHS ONLY. | |
| CMeshBlockManager | MeshBlockManager |
| The manager of meshBlock. Used to add instances. | |
FOR MODEL TRAVERSING ONLY. (Read only) | |
Those variables are valid only in traverse(). | |
| float | Bottom |
| NLMISC::CVector | CamLook |
| NLMISC::CMatrix | CamMatrix |
| NLMISC::CVector | CamPos |
| float | Far |
| float | Left |
| float | Near |
| bool | Perspective |
| float | Right |
| float | Top |
| NLMISC::CMatrix | ViewMatrix |
Protected Member Functions | |
| void | update () |
| update the dependent information. | |
Private Attributes | |
| uint32 | _CurrentNumVisibleModels |
| bool | _CurrentPassOpaque |
| bool | _LayersRenderingOrder |
| CVertexStreamManager * | _MeshSkinManager |
| The manager of skin. NULL by default. | |
| CShadowMapManager | _ShadowMapManager |
| The ShadowMap Manager. | |
| CVertexStreamManager * | _ShadowMeshSkinManager |
| The SkinManager, but For Shadow rendering. | |
| CViewport | _Viewport |
| IDriver * | Driver |
| COrderingTable< CTransform > | OrderOpaqueList |
| CLayeredOrderingTable< CTransform > | OrderTransparentList |
| std::vector< CTransform * > | RenderList |
Render Lighting Setup. | |
| CLightContribution * | _CacheLightContribution |
| CLight | _DriverLight [NL3D_MAX_LIGHT_CONTRIBUTION+1] |
| NLMISC::CRGBA | _LastFinalAmbient |
| bool | _LastLocalAttenuation |
| CPointLight * | _LastPointLight [NL3D_MAX_LIGHT_CONTRIBUTION] |
| uint8 | _LastPointLightFactor [NL3D_MAX_LIGHT_CONTRIBUTION] |
| bool | _LastPointLightLocalAttenuation [NL3D_MAX_LIGHT_CONTRIBUTION] |
| uint | _LastSunFactor |
| uint | _NumLightEnabled |
| NLMISC::CRGBA | _StrongestLightDiffuse |
| uint | _StrongestLightIndex |
| NLMISC::CRGBA | _StrongestLightSpecular |
| bool | _StrongestLightTouched |
| CVector | _SunDirection |
| uint | _VPCurrentCtStart |
| NLMISC::CRGBAF | _VPFinalAmbient |
| NLMISC::CRGBAF | _VPLightDiffuse [MaxVPLight] |
| NLMISC::CRGBAF | _VPLightSpecular [MaxVPLight] |
| uint32 | _VPMaterialCacheAmbient |
| uint32 | _VPMaterialCacheDiffuse |
| bool | _VPMaterialCacheDirty |
| uint32 | _VPMaterialCacheEmissive |
| float | _VPMaterialCacheShininess |
| uint32 | _VPMaterialCacheSpecular |
| uint | _VPNumLights |
| bool | _VPSupportSpecular |
|
|
Definition at line 203 of file render_trav.h.
00203 {MaxVPLight= 4};
|
|
|
|
Definition at line 1037 of file render_trav.cpp. References _LandscapeRenderList. Referenced by NL3D::CLandscapeModel::traverseRender().
01038 {
01039 _LandscapeRenderList.push_back(model);
01040 }
|
|
|
Add a model to the list of rendered models. DOESN'T CHECK if already inserted. Definition at line 121 of file render_trav.h. References RenderList. Referenced by NL3D::CParticleSystemModel::traverseAnimDetail(), and NL3D::CTransform::traverseClip().
00122 {
00123 RenderList[_CurrentNumVisibleModels]= m;
00124 _CurrentNumVisibleModels++;
00125 }
|
|
||||||||||||||||
|
setup the driver VP constants to get info from current LightSetup. Only 0..3 Light + SunLights are supported. The VP do NOT support distance/Spot attenuation Also it does not handle World Matrix with non uniform scale correctly since lighting is made in ObjectSpace
Definition at line 557 of file render_trav.cpp. References _DriverLight, _NumLightEnabled, _VPCurrentCtStart, _VPFinalAmbient, _VPLightDiffuse, _VPLightSpecular, _VPMaterialCacheDirty, _VPNumLights, _VPSupportSpecular, AmbientGlobal, NL3D::CLight::getAmbiant(), NL3D::CLight::getDiffuse(), NL3D::CLight::getPosition(), NL3D::CLight::getSpecular(), MaxVPLight, min, NLMISC::CMatrix::mulVector(), nlassert, NLMISC::CVector::normalize(), NL3D::IDriver::setConstant(), and uint. Referenced by NL3D::CMeshVPPerPixelLight::begin(), and NL3D::CMeshVPWindTree::setupLighting().
00558 {
00559 uint i;
00560 nlassert(MaxVPLight==4);
00561 _VPNumLights= min(_NumLightEnabled, (uint)MaxVPLight);
00562 _VPCurrentCtStart= ctStart;
00563 _VPSupportSpecular= supportSpecular;
00564
00565 // Prepare Colors (to be multiplied by material)
00566 //================
00567 // Ambient. _VPCurrentCtStart+0
00568 _VPFinalAmbient= AmbientGlobal;
00569 for(i=0; i<_VPNumLights; i++)
00570 {
00571 _VPFinalAmbient+= _DriverLight[i].getAmbiant();
00572 }
00573 // Diffuse. _VPCurrentCtStart+1 to 4
00574 for(i=0; i<_VPNumLights; i++)
00575 {
00576 _VPLightDiffuse[i]= _DriverLight[i].getDiffuse();
00577 }
00578 // reset other to 0.
00579 for(; i<MaxVPLight; i++)
00580 {
00581 _VPLightDiffuse[i]= CRGBA::Black;
00582 Driver->setConstant(_VPCurrentCtStart+1+i, 0.f, 0.f, 0.f, 0.f);
00583 }
00584 // Specular. _VPCurrentCtStart+5 to 8 (only if supportSpecular)
00585 if(supportSpecular)
00586 {
00587 for(i=0; i<_VPNumLights; i++)
00588 {
00589 _VPLightSpecular[i]= _DriverLight[i].getSpecular();
00590 }
00591 // reset other to 0.
00592 for(; i<MaxVPLight; i++)
00593 {
00594 _VPLightSpecular[i]= CRGBA::Black;
00595 Driver->setConstant(_VPCurrentCtStart+5+i, 0.f, 0.f, 0.f, 0.f);
00596 }
00597 }
00598
00599
00600 // Compute Eye position in Object space.
00601 CVector eye= invObjectWM * CamPos;
00602
00603
00604 // Setup Sun Directionnal light.
00605 //================
00606 CVector lightDir;
00607 // in objectSpace.
00608 lightDir= invObjectWM.mulVector(_DriverLight[0].getDirection());
00609 lightDir.normalize();
00610 lightDir= -lightDir;
00611 if(supportSpecular)
00612 {
00613 // Setup lightDir.
00614 Driver->setConstant(_VPCurrentCtStart+9, lightDir);
00615 }
00616 else
00617 {
00618 // Setup lightDir. NB: no specular color!
00619 Driver->setConstant(_VPCurrentCtStart+5, lightDir);
00620 }
00621
00622
00623 // Setup PointLights
00624 //================
00625 uint startPLPos;
00626 if(supportSpecular)
00627 {
00628 // Setup eye in objectSpace for localViewer
00629 Driver->setConstant(_VPCurrentCtStart+11, eye);
00630 // Start at 12.
00631 startPLPos= 12;
00632 }
00633 else
00634 {
00635 // Start at 6.
00636 startPLPos= 6;
00637 }
00638 // For all pointLight enabled (other are black: don't matter)
00639 for(i=1; i<_VPNumLights; i++)
00640 {
00641 // Setup position of light.
00642 CVector lightPos;
00643 lightPos= invObjectWM * _DriverLight[i].getPosition();
00644 Driver->setConstant(_VPCurrentCtStart+startPLPos+(i-1), lightPos);
00645 }
00646
00647
00648 // Must force real light setup at least the first time, in changeVPLightSetupMaterial()
00649 _VPMaterialCacheDirty= true;
00650 }
|
|
||||||||||||
|
setup the driver to the given lightContribution. if lightContribution==NULL, then all currently enabled lights are disabled. NB: lightContribution is cached, so if same than preceding, no-op. cache cleared at each frame with resetLightSetup(). NB: models which are sticked or skinned on a skeleton have same lightContribution because lightSetup is made on the skeleton only. Hence the interest of this cache.
Definition at line 409 of file render_trav.cpp. References _CacheLightContribution, _DriverLight, _LastFinalAmbient, _LastLocalAttenuation, _LastPointLight, _LastPointLightFactor, _LastPointLightLocalAttenuation, _LastSunFactor, _NumLightEnabled, _StrongestLightTouched, _SunDirection, NLMISC::CRGBA::A, NLMISC::CRGBA::addRGBOnly(), NL3D::CLightContribution::AttFactor, NL3D::CLightContribution::computeCurrentAmbient(), NL3D::IDriver::enableLight(), NL3D::CLightContribution::Factor, NL3D::CLightContribution::MergedPointLight, NLMISC::CRGBA::modulateFromuiRGBOnly(), NL3D_MAX_LIGHT_CONTRIBUTION, NL3D::CLightContribution::PointLight, NL3D::IDriver::setLight(), NL3D::CLight::setupDirectional(), SunAmbient, NL3D::CLightContribution::SunContribution, SunDiffuse, SunSpecular, uint, and NL3D::CLightContribution::UseMergedPointLight. Referenced by NL3D::CTransformShape::changeLightSetup().
00410 {
00411 // If lighting System disabled, skip
00412 if(!LightingSystemEnabled)
00413 return;
00414
00415 uint i;
00416
00417 // if same lightContribution, no-op.
00418 if(_CacheLightContribution == lightContribution && _LastLocalAttenuation == useLocalAttenuation)
00419 return;
00420 // else, must setup the lights into driver.
00421 else
00422 {
00423 _StrongestLightTouched = true;
00424 // if the setup is !NULL
00425 if(lightContribution)
00426 {
00427 // Compute SunAmbient / LocalAmbient
00428 //-----------
00429 // Take the current model ambient
00430 CRGBA finalAmbient= lightContribution->computeCurrentAmbient(SunAmbient);
00431 // If use the mergedPointLight, add it to final Ambient
00432 if(lightContribution->UseMergedPointLight)
00433 finalAmbient.addRGBOnly(finalAmbient, lightContribution->MergedPointLight);
00434 // Force Alpha to 255 for good cache test.
00435 finalAmbient.A= 255;
00436
00437
00438 // Setup the directionnal Sunlight.
00439 //-----------
00440 // expand 0..255 to 0..256, to avoid loss of precision.
00441 uint ufactor= lightContribution->SunContribution;
00442 // different SunLight as in cache ??
00443 // NB: sunSetup can't change during renderPass, so need only to test factor.
00444 if(ufactor != _LastSunFactor || finalAmbient != _LastFinalAmbient)
00445 {
00446 // cache (before expanding!!)
00447 _LastSunFactor= ufactor;
00448 // Cache final ambient light
00449 _LastFinalAmbient= finalAmbient;
00450
00451 // expand to 0..256.
00452 ufactor+= ufactor>>7; // add 0 or 1.
00453 // modulate color with factor of the lightContribution.
00454 CRGBA sunDiffuse, sunSpecular;
00455 sunDiffuse.modulateFromuiRGBOnly(SunDiffuse, ufactor);
00456 sunSpecular.modulateFromuiRGBOnly(SunSpecular, ufactor);
00457 // setup driver light
00458 _DriverLight[0].setupDirectional(finalAmbient, sunDiffuse, sunSpecular, _SunDirection);
00459 Driver->setLight(0, _DriverLight[0]);
00460 }
00461
00462
00463 // Setup other point lights
00464 //-----------
00465 uint plId=0;
00466 // for the list of light.
00467 while(lightContribution->PointLight[plId]!=NULL)
00468 {
00469 CPointLight *pl= lightContribution->PointLight[plId];
00470 uint inf;
00471 if(useLocalAttenuation)
00472 inf= lightContribution->Factor[plId];
00473 else
00474 inf= lightContribution->AttFactor[plId];
00475
00476 // different PointLight setup than in cache??
00477 // NB: pointLight setup can't change during renderPass, so need only to test pointer,
00478 // attenuation mode and factor.
00479 if( pl!=_LastPointLight[plId] ||
00480 inf!=_LastPointLightFactor[plId] ||
00481 useLocalAttenuation!=_LastPointLightLocalAttenuation[plId] )
00482 {
00483 // need to resetup the light. Cache it.
00484 _LastPointLight[plId]= pl;
00485 _LastPointLightFactor[plId]= inf;
00486 _LastPointLightLocalAttenuation[plId]= useLocalAttenuation;
00487
00488 // compute the driver light
00489 if(useLocalAttenuation)
00490 pl->setupDriverLight(_DriverLight[plId+1], inf);
00491 else
00492 // Compute it with user Attenuation
00493 pl->setupDriverLightUserAttenuation(_DriverLight[plId+1], inf);
00494
00495 // setup driver. decal+1 because of sun.
00496 Driver->setLight(plId+1, _DriverLight[plId+1]);
00497 }
00498
00499 // next light?
00500 plId++;
00501 if(plId>=NL3D_MAX_LIGHT_CONTRIBUTION)
00502 break;
00503 }
00504
00505
00506 // Disable olds, enable news, and cache.
00507 //-----------
00508 // count new number of light enabled.
00509 uint newNumLightEnabled;
00510 // number of pointLight + the sun
00511 newNumLightEnabled= plId + 1;
00512
00513 // enable lights which are used now and were not before.
00514 for(i=_NumLightEnabled; i<newNumLightEnabled; i++)
00515 {
00516 Driver->enableLight(i, true);
00517 }
00518
00519 // disable lights which are no more used.
00520 for(i=newNumLightEnabled; i<_NumLightEnabled; i++)
00521 {
00522 Driver->enableLight(i, false);
00523 }
00524
00525 // cache the setup.
00526 _CacheLightContribution = lightContribution;
00527 _NumLightEnabled= newNumLightEnabled;
00528 _LastLocalAttenuation= useLocalAttenuation;
00529 }
00530 else
00531 {
00532 // Disable old lights, and cache.
00533 //-----------
00534 // disable lights which are no more used.
00535 for(i=0; i<_NumLightEnabled; i++)
00536 {
00537 Driver->enableLight(i, false);
00538 }
00539
00540 // cache the setup.
00541 _CacheLightContribution = NULL;
00542 _NumLightEnabled= 0;
00543 }
00544
00545
00546 }
00547 }
|
|
||||||||||||
|
change the driver VP LightSetup constants which depends on material.
Definition at line 653 of file render_trav.cpp. References _StrongestLightDiffuse, _StrongestLightSpecular, _VPCurrentCtStart, _VPFinalAmbient, _VPLightDiffuse, _VPLightSpecular, _VPMaterialCacheAmbient, _VPMaterialCacheDiffuse, _VPMaterialCacheDirty, _VPMaterialCacheEmissive, _VPMaterialCacheShininess, _VPMaterialCacheSpecular, _VPNumLights, _VPSupportSpecular, NLMISC::CRGBAF::A, NLMISC::CRGBAF::B, NLMISC::CRGBAF::G, NL3D::CMaterial::getAmbient(), NL3D::CMaterial::getDiffuse(), NL3D::CMaterial::getEmissive(), NLMISC::CRGBA::getPacked(), NL3D::CMaterial::getShininess(), NL3D::CMaterial::getSpecular(), getStrongestLightIndex(), NLMISC::CRGBAF::R, NLMISC::CRGBA::set(), NL3D::IDriver::setConstant(), uint, and uint8. Referenced by NL3D::CMeshGeom::renderPass(), NL3D::SetupForMaterial(), and NL3D::CMeshVPPerPixelLight::setupForMaterial().
00654 {
00655 // Must test if at least done one time.
00656 if(!_VPMaterialCacheDirty)
00657 {
00658 // Must test if same as in cache
00659 if( _VPMaterialCacheEmissive == mat.getEmissive().getPacked() &&
00660 _VPMaterialCacheAmbient == mat.getAmbient().getPacked() &&
00661 _VPMaterialCacheDiffuse == mat.getDiffuse().getPacked() )
00662 {
00663 // Same Diffuse part, test if same specular if necessary
00664 if( !_VPSupportSpecular ||
00665 ( _VPMaterialCacheSpecular == mat.getSpecular().getPacked() &&
00666 _VPMaterialCacheShininess == mat.getShininess() ) )
00667 {
00668 // Then ok, skip.
00669 return;
00670 }
00671 }
00672 }
00673
00674 // If not skiped, cache now. cache all for simplification
00675 _VPMaterialCacheDirty= false;
00676 _VPMaterialCacheEmissive= mat.getEmissive().getPacked();
00677 _VPMaterialCacheAmbient= mat.getDiffuse().getPacked();
00678 _VPMaterialCacheDiffuse= mat.getDiffuse().getPacked();
00679 _VPMaterialCacheSpecular= mat.getSpecular().getPacked();
00680 _VPMaterialCacheShininess= mat.getShininess();
00681
00682 // Setup constants
00683 CRGBAF color;
00684 uint i;
00685 CRGBAF matDiff= mat.getDiffuse();
00686 CRGBAF matSpec= mat.getSpecular();
00687 float specExp= mat.getShininess();
00688
00689 uint strongestLightIndex = excludeStrongest ? getStrongestLightIndex() : _VPNumLights;
00690
00691 // setup Ambient + Emissive
00692 color= _VPFinalAmbient * mat.getAmbient();
00693 color+= mat.getEmissive();
00694 Driver->setConstant(_VPCurrentCtStart+0, 1, &color.R);
00695
00696
00697 // is the strongest light is not excluded, its index should have been setup to _VPNumLights
00698
00699 // setup Diffuse.
00700 for(i = 0; i < strongestLightIndex; ++i)
00701 {
00702 color= _VPLightDiffuse[i] * matDiff;
00703 Driver->setConstant(_VPCurrentCtStart+1+i, 1, &color.R);
00704 }
00705
00706
00707 if (i != _VPNumLights)
00708 {
00709 color= _VPLightDiffuse[i] * matDiff;
00710 _StrongestLightDiffuse.set((uint8) (255.f * color.R), (uint8) (255.f * color.G), (uint8) (255.f * color.B), (uint8) (255.f * color.A));
00711 // setup strongest light to black for the gouraud part
00712 Driver->setConstant(_VPCurrentCtStart + 1 + i, 0.f, 0.f, 0.f, 0.f);
00713 ++i;
00714 // setup other lights
00715 for(; i < _VPNumLights; i++)
00716 {
00717 color= _VPLightDiffuse[i] * matDiff;
00718 Driver->setConstant(_VPCurrentCtStart + 1 + i, 1, &color.R);
00719 }
00720 }
00721
00722 // setup Specular
00723 if(_VPSupportSpecular)
00724 {
00725 for(i = 0; i < strongestLightIndex; ++i)
00726 {
00727 color= _VPLightSpecular[i] * matSpec;
00728 color.A= specExp;
00729 Driver->setConstant(_VPCurrentCtStart+5+i, 1, &color.R);
00730 }
00731
00732 if (i != _VPNumLights)
00733 {
00734 color= _VPLightSpecular[i] * matSpec;
00735 _StrongestLightSpecular.set((uint8) (255.f * color.R), (uint8) (255.f * color.G), (uint8) (255.f * color.B), (uint8) (255.f * color.A));
00736
00737 // setup strongest light to black (for gouraud part)
00738 Driver->setConstant(_VPCurrentCtStart + 5 + i, 0.f, 0.f, 0.f, 0.f);
00739 ++i;
00740 // setup other lights
00741 for(; i < _VPNumLights; i++)
00742 {
00743 color= _VPLightSpecular[i] * matSpec;
00744 color.A= specExp;
00745 Driver->setConstant(_VPCurrentCtStart + 5 + i, 1, &color.R);
00746 }
00747 }
00748 }
00749
00750 // setup alpha.
00751 static float alphaCte[4]= {0,0,1,0};
00752 alphaCte[3]= matDiff.A;
00753 // setup at good place
00754 if(_VPSupportSpecular)
00755 Driver->setConstant(_VPCurrentCtStart+10, 1, alphaCte);
00756 else
00757 Driver->setConstant(_VPCurrentCtStart+9, 1, alphaCte);
00758 }
|
|
|
Definition at line 1031 of file render_trav.cpp. References _LandscapeRenderList. Referenced by traverse().
01032 {
01033 _LandscapeRenderList.clear();
01034 }
|
|
|
Clear the list of rendered models.
Definition at line 312 of file render_trav.cpp. Referenced by NL3D::CClipTrav::traverse().
00313 {
00314 _CurrentNumVisibleModels= 0;
00315 }
|
|
|
Definition at line 135 of file render_trav.h. Referenced by NL3D::CSkeletonModel::generateShadowMap(), NL3D::CMeshInstance::generateShadowMap(), NL3D::CShadowMapManager::renderGenerate(), NL3D::CSkeletonModel::renderIntoSkeletonShadowMap(), NL3D::CMeshInstance::renderIntoSkeletonShadowMap(), NL3D::CSkeletonModel::renderShadowSkins(), and traverse().
00135 {return Driver;}
|
|
|
|
This returns a reference to a driver light, by its index
Definition at line 283 of file render_trav.h. References _DriverLight, index, NL3D_MAX_LIGHT_CONTRIBUTION, nlassert, and sint. Referenced by NL3D::CMeshVPPerPixelLight::begin().
00284 {
00285 nlassert(index >= 0 && index < NL3D_MAX_LIGHT_CONTRIBUTION+1);
00286 return _DriverLight[index];
00287 }
|
|
|
Definition at line 154 of file render_trav.h. References _LayersRenderingOrder. Referenced by NL3D::CScene::getLayersRenderingOrder().
00154 { return _LayersRenderingOrder; }
|
|
||||||||||||||||||||
|
tool to get a VP fragment which compute lighting with following rules: IN:
For information, constant mapping is (add ctStart): == Strongest light included == if !supportSpecular:
NB: the number of active light does not change the number of constantes used. But the VP code returned is modified accordingly.
Definition at line 964 of file render_trav.cpp. References NL3D::LightingVPFragmentNormalize, NL3D::LightingVPFragmentNoSpecular_Begin, NL3D::LightingVPFragmentNoSpecular_End, NL3D::LightingVPFragmentNoSpecular_PL, NL3D::LightingVPFragmentSpecular_Begin, NL3D::LightingVPFragmentSpecular_End, NL3D::LightingVPFragmentSpecular_PL, MaxVPLight, nlassert, sint, NL3D::strReplaceAll(), and uint.
00965 {
00966 string ret;
00967
00968 // Code frag written for 4 light max.
00969 nlassert(MaxVPLight==4);
00970 nlassert(numActivePointLights<=MaxVPLight-1);
00971
00972 // Add LightingVPFragmentNormalize fragment?
00973 if(normalize)
00974 ret+= LightingVPFragmentNormalize;
00975
00976 // Which fragment to use...
00977 if(supportSpecular)
00978 {
00979 // Add start of VP.
00980 ret+= LightingVPFragmentSpecular_Begin;
00981
00982 // Add needed pointLights.
00983 for(uint i=0;i<numActivePointLights;i++)
00984 {
00985 ret+= LightingVPFragmentSpecular_PL[i];
00986 }
00987
00988 // Add end of VP.
00989 ret+= LightingVPFragmentSpecular_End;
00990 }
00991 else
00992 {
00993 // Add start of VP.
00994 ret+= LightingVPFragmentNoSpecular_Begin;
00995
00996 // Add needed pointLights.
00997 for(uint i=0;i<numActivePointLights;i++)
00998 {
00999 ret+= LightingVPFragmentNoSpecular_PL[i];
01000 }
01001
01002 // Add end of VP.
01003 ret+= LightingVPFragmentNoSpecular_End;
01004 }
01005
01006 // Replace all CTS+x with good index. do it for 15 possible indices: 0 to 14 if specular.
01007 // run from 14 to 0 so CTS+14 will not be taken for a CTS+1 !!
01008 for(sint i=14; i>=0; i--)
01009 {
01010 char tokenSrc[256];
01011 sprintf(tokenSrc, "CTS+%d", i);
01012 char tokenDst[256];
01013 sprintf(tokenDst, "%d", ctStart+i);
01014 // replace all in the string
01015 strReplaceAll(ret, tokenSrc, tokenDst);
01016 }
01017
01018 // verify no CTS+ leaved... (not all ctes parsed!!!)
01019 nlassert( ret.find("CTS+")==string::npos );
01020
01021 return ret;
01022 }
|
|
|
get the MeshSkinManager
Definition at line 182 of file render_trav.h. Referenced by NL3D::CSkeletonModel::renderSkinList().
00182 {return _MeshSkinManager;}
|
|
|
return the number of VP lights currently activated (sunlight included) Value correct after beginVPLightSetup() only Definition at line 301 of file render_trav.h. References _VPNumLights, and uint. Referenced by NL3D::CMeshVPWindTree::begin(), and NL3D::CMeshVPWindTree::beginMBRInstance().
00301 {return _VPNumLights;}
|
|
|
Definition at line 186 of file render_trav.h. References _ShadowMapManager.
00186 {return _ShadowMapManager;}
|
|
|
get the CShadowMapManager
Definition at line 185 of file render_trav.h. References _ShadowMapManager. Referenced by NL3D::CClipTrav::clipSkeletonShadowMaps(), NL3D::CScene::enableShadowPolySmooth(), NL3D::CSkeletonModel::generateShadowMap(), NL3D::CMeshInstance::generateShadowMap(), NL3D::CScene::getEnableShadowPolySmooth(), NL3D::CMeshInstance::traverseRender(), and NL3D::CLandscapeModel::traverseRender().
00185 {return _ShadowMapManager;}
|
|
|
Definition at line 190 of file render_trav.h. Referenced by NL3D::CSkeletonModel::renderShadowSkins().
00190 {return _ShadowMeshSkinManager;}
|
|
||||||||||||
|
Get current color, diffuse and specular of the strongest light in the scene. These values are modulated by the current material color, so these values are valid only after changeVPLightSetupMaterial() has been called Definition at line 778 of file render_trav.cpp. References _StrongestLightDiffuse, _StrongestLightSpecular, getStrongestLightIndex(), and sint. Referenced by NL3D::CMeshVPPerPixelLight::setupForMaterial().
00779 {
00780 sint strongestLightIndex = getStrongestLightIndex();
00781 if (strongestLightIndex == -1)
00782 {
00783 diffuse = specular = NLMISC::CRGBA::Black;
00784 }
00785 else
00786 {
00787 diffuse = _StrongestLightDiffuse;
00788 specular = _StrongestLightSpecular;
00789 }
00790 }
|
|
|
return an index to the current strongest settuped light (or -1 if there's none)
Definition at line 761 of file render_trav.cpp. References _NumLightEnabled, _StrongestLightTouched, _VPLightDiffuse, _VPLightSpecular, NLMISC::CRGBAF::A, NLMISC::CRGBAF::B, NLMISC::CRGBAF::G, MaxVPLight, min, NLMISC::CRGBAF::R, sint, and uint. Referenced by NL3D::CMeshVPPerPixelLight::begin(), changeVPLightSetupMaterial(), and getStrongestLightColors().
00762 {
00763 if (!_StrongestLightTouched) return -1;
00764 uint vpNumLights = min(_NumLightEnabled, (uint)MaxVPLight);
00765 // If there is only a directionnal light, use it
00766 // If there is any point light, use the nearest, or the directionnal light if it is brighter
00767 if (vpNumLights == 0) return -1;
00768 if (vpNumLights == 1) return 0;
00769 // First point light is brightest ?
00770 float lumDir = _VPLightDiffuse[0].R + _VPLightDiffuse[0].G + _VPLightDiffuse[0].B + _VPLightDiffuse[0].A
00771 + _VPLightSpecular[0].R + _VPLightSpecular[0].G + _VPLightSpecular[0].B + _VPLightSpecular[0].A;
00772 float lumOmni = _VPLightDiffuse[1].R + _VPLightDiffuse[1].G + _VPLightDiffuse[1].B + _VPLightDiffuse[1].A
00773 + _VPLightSpecular[1].R + _VPLightSpecular[1].G + _VPLightSpecular[1].B + _VPLightSpecular[1].A;
00774 return lumDir > lumOmni ? 0 : 1;
00775 }
|
|
|
Definition at line 170 of file render_trav.h. References _SunDirection. Referenced by NL3D::CScene::getSunDirection().
00170 {return _SunDirection;}
|
|
|
Definition at line 140 of file render_trav.h.
00141 {
00142 return _Viewport;
00143 }
|
|
|
Definition at line 145 of file render_trav.h. References _CurrentPassOpaque. Referenced by NL3D::CTransformShape::profileRender(), NL3D::CSkeletonModel::renderCLod(), NL3D::CSkeletonModel::renderSkins(), NL3D::CTransformShape::traverseRender(), and NL3D::CFlareModel::traverseRender().
00145 { return _CurrentPassOpaque; }
|
|
|
Definition at line 1043 of file render_trav.cpp. References _LandscapeRenderList, and uint. Referenced by traverse().
01044 {
01045 // Render Each Landscapes.
01046 for(uint i=0;i<_LandscapeRenderList.size();i++)
01047 {
01048 _LandscapeRenderList[i]->clipAndRenderLandscape();
01049 }
01050 }
|
|
|
Add a model to the list of rendered models. DOESN'T CHECK if already inserted. Definition at line 339 of file render_trav.cpp. References RenderList, and uint. Referenced by NL3D::CScene::createModel().
00340 {
00341 // enlarge only.
00342 if(numModels>RenderList.size())
00343 RenderList.resize(numModels);
00344 }
|
|
|
reset the lighting setup in the driver (all lights are disabled). called at begining of traverse(). Must be called by any model (before and after rendering) that wish to use CDriver::setLight() instead of the standard behavior with changeLightSetup() Definition at line 355 of file render_trav.cpp. References _CacheLightContribution, _DriverLight, _LastFinalAmbient, _LastPointLight, _LastSunFactor, _NumLightEnabled, _StrongestLightTouched, _SunDirection, AmbientGlobal, NL3D::IDriver::enableLight(), NL3D::IDriver::getMaxLight(), NL3D_MAX_LIGHT_CONTRIBUTION, NLMISC::CVector::normalize(), NLMISC::CRGBA::set(), NL3D::IDriver::setAmbientColor(), NL3D::IDriver::setLight(), NL3D::CLight::setupDirectional(), and uint. Referenced by traverse().
00356 {
00357 // If lighting System disabled, skip
00358 if(!LightingSystemEnabled)
00359 {
00360 // Dont modify Driver lights, but setup default lighting For VertexProgram Lighting.
00361 _NumLightEnabled= 1;
00362 // Setup A default directionnal.
00363 CVector defDir(-0.5f, 0.0, -0.85f);
00364 defDir.normalize();
00365 CRGBA aday= CRGBA(130, 105, 119);
00366 CRGBA dday= CRGBA(238, 225, 204);
00367 _DriverLight[0].setupDirectional(aday, dday, dday, defDir);
00368
00369 return;
00370 }
00371 else
00372 {
00373 uint i;
00374
00375 // Disable all lights.
00376 for(i=0; i<Driver->getMaxLight(); i++)
00377 {
00378 Driver->enableLight(i, false);
00379 }
00380
00381
00382 // setup the precise cache, and setup lights according to this cache?
00383 // setup blackSun (factor==0).
00384 _LastSunFactor= 0;
00385 _LastFinalAmbient.set(0,0,0,255);
00386 _DriverLight[0].setupDirectional(CRGBA::Black, CRGBA::Black, CRGBA::Black, _SunDirection);
00387 Driver->setLight(0, _DriverLight[0]);
00388 // setup NULL point lights (=> cache will fail), so no need to setup other lights in Driver.
00389 for(i=0; i<NL3D_MAX_LIGHT_CONTRIBUTION; i++)
00390 {
00391 _LastPointLight[i]= NULL;
00392 }
00393
00394
00395 // Set the global ambientColor
00396 Driver->setAmbientColor(AmbientGlobal);
00397
00398
00399 // clear the cache.
00400 _CacheLightContribution= NULL;
00401 _NumLightEnabled= 0;
00402
00403 _StrongestLightTouched = true;
00404 }
00405 }
|
|
|
Setup the camera matrix (a translation/rotation matrix).
Definition at line 102 of file trav_scene.h. References NL3D::CTravCameraScene::CamMatrix. Referenced by NL3D::CScene::render().
00103 {
00104 CamMatrix= camMatrix;
00105 }
|
|
|
Definition at line 132 of file render_trav.h. Referenced by NL3D::CScene::setDriver().
00132 {Driver= drv;}
|
|
||||||||||||||||||||||||
|
Setup the camera mode as a perspective/ortho camera. NB: znear and zfar must be >0 (if perspective).
Definition at line 97 of file trav_scene.h. References height, NL3D::CTravCameraScene::setFrustum(), and width.
00098 {
00099 setFrustum(-width/2, width/2, -height/2, height/2, znear, zfar, perspective);
00100 }
|
|
||||||||||||||||||||||||||||||||
|
Setup the camera mode as a perspective/ortho camera. NB: znear and zfar must be >0 (if perspective).
Definition at line 86 of file trav_scene.h. References NL3D::CTravCameraScene::Bottom, NL3D::CTravCameraScene::Far, NL3D::CTravCameraScene::Near, NL3D::CTravCameraScene::Perspective, and NL3D::CTravCameraScene::Right. Referenced by NL3D::CTravCameraScene::CTravCameraScene(), NL3D::CScene::render(), and NL3D::CTravCameraScene::setFrustum().
|
|
|
Set the order or rendering for transparent objects. In real case, with direct order, we have:
Definition at line 153 of file render_trav.h. References _LayersRenderingOrder. Referenced by NL3D::CScene::setLayersRenderingOrder().
00153 { _LayersRenderingOrder = directOrder; }
|
|
|
Set/Replace the MeshSkinManager. NULL by default => skinning is slower. The ptr is handled but not deleted. There should be one MeshSkinManager per driver. Definition at line 327 of file render_trav.cpp.
00328 {
00329 _MeshSkinManager= msm;
00330 }
|
|
|
the MeshSkinManager for Shadow. Same Behaviour than std MeshSkinManager. NB: the Shadow MSM is inited with AuxDriver.
Definition at line 333 of file render_trav.cpp.
00334 {
00335 _ShadowMeshSkinManager= msm;
00336 }
|
|
|
Definition at line 319 of file render_trav.cpp. References _SunDirection, and NLMISC::CVector::normalize(). Referenced by NL3D::CScene::setSunDirection().
00320 {
00321 _SunDirection= dir;
00322 _SunDirection.normalize();
00323 }
|
|
|
Definition at line 304 of file render_trav.cpp. References getDriver(), NL3D::IDriver::setFrustum(), and NL3D::IDriver::setupViewMatrixEx(). Referenced by NL3D::CShadowMapManager::renderGenerate(), and traverse().
|
|
|
Definition at line 136 of file render_trav.h. Referenced by NL3D::CScene::render().
00137 {
00138 _Viewport = viewport;
00139 }
|
|
|
First traverse the root (if any), then render the render list. NB: no Driver clear buffers (color or ZBuffer) are done.... Definition at line 89 of file render_trav.cpp. References _CurrentPassOpaque, _LayersRenderingOrder, _ShadowMapManager, NL3D::CLayeredOrderingTable< CTransform >::begin(), NL3D::COrderingTable< CTransform >::begin(), NL3D::CLodCharacterManager::beginRender(), clearRenderLandscapeList(), NL3D::CLodCharacterManager::endRender(), NL3D::CMeshBlockManager::flush(), NL3D::CCoarseMeshManager::flushRender(), NL3D::CLayeredOrderingTable< CTransform >::get(), NL3D::COrderingTable< CTransform >::get(), getAuxDriver(), NL3D::CScene::getCoarseMeshManager(), NL3D::CVertexStreamManager::getDriver(), getDriver(), NL3D::CScene::getLodCharacterManager(), NL3D::CTransform::getOrderingLayer(), NLMISC::CMatrix::getPos(), NL3D::CLayeredOrderingTable< CTransform >::getSize(), NL3D::COrderingTable< CTransform >::getSize(), NL3D::CTransform::getWorldMatrix(), H_AUTO, NL3D::CVertexStreamManager::init(), NL3D::CLayeredOrderingTable< CTransform >::insert(), NL3D::COrderingTable< CTransform >::insert(), NL3D::CScene::isNextRenderProfile(), NL3D::CTransform::isOpaque(), NL3D::CTransform::isTransparent(), MeshBlockManager, min, NL3D::CLayeredOrderingTable< CTransform >::next(), NL3D::COrderingTable< CTransform >::next(), NL3D_MESH_SKIN_MANAGER_MAXVERTICES, NL3D_MESH_SKIN_MANAGER_NUMVB, NL3D_MESH_SKIN_MANAGER_VERTEXFORMAT, NL3D_SHADOW_MESH_SKIN_MANAGER_MAXVERTICES, NL3D_SHADOW_MESH_SKIN_MANAGER_NUMVB, NL3D_SHADOW_MESH_SKIN_MANAGER_VERTEXFORMAT, NLMISC::OptFastFloor(), NLMISC::OptFastFloorBegin(), NLMISC::OptFastFloorEnd(), OrderOpaqueList, OrderTransparentList, NL3D::CTransform::profileRender(), NL3D::CVertexStreamManager::release(), NL3D::CShadowMapManager::renderGenerate(), renderLandscapes(), RenderList, NL3D::CShadowMapManager::renderProject(), NL3D::CLayeredOrderingTable< CTransform >::reset(), NL3D::COrderingTable< CTransform >::reset(), resetLightSetup(), setupDriverCamera(), NL3D::IDriver::setupViewport(), NL3D::CTransform::traverseRender(), and uint32. Referenced by NL3D::CScene::render().
00090 {
00091 H_AUTO( NL3D_TravRender );
00092
00093 CTravCameraScene::update();
00094
00095 // Bind to Driver.
00096 setupDriverCamera();
00097 getDriver()->setupViewport(_Viewport);
00098
00099 // reset the light setup, and set global ambient.
00100 resetLightSetup();
00101
00102
00103 // reset the Skin manager, if needed
00104 if(_MeshSkinManager)
00105 {
00106 if(Driver!=_MeshSkinManager->getDriver())
00107 {
00108 _MeshSkinManager->release();
00109 _MeshSkinManager->init(Driver,
00110 NL3D_MESH_SKIN_MANAGER_VERTEXFORMAT,
00111 NL3D_MESH_SKIN_MANAGER_MAXVERTICES,
00112 NL3D_MESH_SKIN_MANAGER_NUMVB,
00113 "MRMSkinVB");
00114 }
00115 }
00116
00117 // Same For Shadow ones. NB: use AuxDriver here!!!
00118 if(_ShadowMeshSkinManager)
00119 {
00120 if(getAuxDriver()!=_ShadowMeshSkinManager->getDriver())
00121 {
00122 _ShadowMeshSkinManager->release();
00123 _ShadowMeshSkinManager->init(getAuxDriver(),
00124 NL3D_SHADOW_MESH_SKIN_MANAGER_VERTEXFORMAT,
00125 NL3D_SHADOW_MESH_SKIN_MANAGER_MAXVERTICES,
00126 NL3D_SHADOW_MESH_SKIN_MANAGER_NUMVB,
00127 "ShadowSkinVB");
00128 }
00129 }
00130
00131
00132 // Fill OT with models, for both Opaque and transparent pass
00133 // =============================
00134
00135 // Sort the models by distance from camera
00136 // This is done here and not in the addRenderModel because of the LoadBalancing traversal which can modify
00137 // the transparency flag (multi lod for instance)
00138
00139 // clear the OTs, and prepare to allocate max element space
00140 OrderOpaqueList.reset(_CurrentNumVisibleModels);
00141 OrderTransparentList.reset(_CurrentNumVisibleModels);
00142
00143 // fill the OTs.
00144 CTransform **itRdrModel= NULL;
00145 uint32 nNbModels = _CurrentNumVisibleModels;
00146 if(nNbModels)
00147 itRdrModel= &RenderList[0];
00148 float rPseudoZ, rPseudoZ2;
00149
00150 // Some precalc
00151 float OOFar= 1.0f / this->Far;
00152 uint32 opaqueOtSize= OrderOpaqueList.getSize();
00153 uint32 opaqueOtMax= OrderOpaqueList.getSize()-1;
00154 uint32 transparentOtSize= OrderTransparentList.getSize();
00155 uint32 transparentOtMax= OrderTransparentList.getSize()-1;
00156 uint32 otId;
00157 // fast floor
00158 NLMISC::OptFastFloorBegin();
00159 // For all rdr models
00160 for( ; nNbModels>0; itRdrModel++, nNbModels-- )
00161 {
00162 CTransform *pTransform = *itRdrModel;
00163
00164 // Yoyo: skins are rendered through skeletons, so models WorldMatrix are all good here (even sticked objects)
00165 rPseudoZ = (pTransform->getWorldMatrix().getPos() - CamPos).norm();
00166
00167 // rPseudoZ from 0.0 -> 1.0
00168 rPseudoZ = sqrtf( rPseudoZ * OOFar );
00169
00170 if( pTransform->isOpaque() )
00171 {
00172 // since norm, we are sure that rPseudoZ>=0
00173 rPseudoZ2 = rPseudoZ * opaqueOtSize;
00174 otId= NLMISC::OptFastFloor(rPseudoZ2);
00175 otId= min(otId, opaqueOtMax);
00176 OrderOpaqueList.insert( otId, pTransform );
00177 }
00178 if( pTransform->isTransparent() )
00179 {
00180 // since norm, we are sure that rPseudoZ>=0
00181 rPseudoZ2 = rPseudoZ * transparentOtSize;
00182 otId= NLMISC::OptFastFloor(rPseudoZ2);
00183 otId= min(otId, transparentOtMax);
00184 // must invert id, because transparent, sort from back to front
00185 OrderTransparentList.insert( pTransform->getOrderingLayer(), pTransform, transparentOtMax-otId );
00186 }
00187
00188 }
00189 // fast floor
00190 NLMISC::OptFastFloorEnd();
00191
00192
00193 // Render Opaque stuff.
00194 // =============================
00195
00196 // TestYoyo
00197 //OrderOpaqueList.reset(0);
00198 //OrderTransparentList.reset(0);
00199
00200 // Clear any landscape
00201 clearRenderLandscapeList();
00202
00203 // Start LodCharacter Manager render.
00204 CLodCharacterManager *clodMngr= Scene->getLodCharacterManager();
00205 if(clodMngr)
00206 clodMngr->beginRender(getDriver(), CamPos);
00207
00208 // Render the opaque materials
00209 _CurrentPassOpaque = true;
00210 OrderOpaqueList.begin();
00211 while( OrderOpaqueList.get() != NULL )
00212 {
00213 CTransform *tr= OrderOpaqueList.get();
00214 tr->traverseRender();
00215 OrderOpaqueList.next();
00216 }
00217
00218 /* Render MeshBlock Manager.
00219 Some Meshs may be render per block. Interesting to remove VertexBuffer and Material setup overhead.
00220 Faster if rendered before lods, for ZBuffer optimisation: render first near objects then far.
00221 Lods are usually far objects.
00222 */
00223 MeshBlockManager.flush(Driver, Scene, this);
00224
00225
00226 // End LodCharacter Manager render.
00227 if(clodMngr)
00228 clodMngr->endRender();
00229
00230
00231 /* Render Scene CoarseMeshManager.
00232 Important to render them at end of Opaque rendering, because coarses instances are created/removed during
00233 this model opaque rendering pass.
00234 */
00235 if( Scene->getCoarseMeshManager() )
00236 Scene->getCoarseMeshManager()->flushRender(Driver);
00237
00238 /* Render ShadowMaps.
00239 Important to render them at end of Opaque rendering, because alphaBlended objects must blend with opaque
00240 objects shadowed.
00241 Therefore, transparent objects neither can't cast or receive shadows...
00242
00243 NB: Split in 2 calls and interleave Landscape Rendering between the 2. WHY???
00244 Because it is far more efficient for VBLock (but not for ZBuffer optim...) because in renderGenerate()
00245 the ShadowMeshSkinManager do lot of VBLocks that really stall (because only 2 VBHard with swap scheme).
00246
00247 Therefore the first Lock that stall will wait not only for the first MeshSkin to finish but also for the
00248 preceding landscape render to finish too! => big STALL.
00249 */
00250
00251 // Generate ShadowMaps
00252 _ShadowMapManager.renderGenerate(Scene);
00253
00254 // Render the Landscape
00255 renderLandscapes();
00256
00257 // Project ShadowMaps.
00258 _ShadowMapManager.renderProject(Scene);
00259
00260
00261 // Profile this frame?
00262 if(Scene->isNextRenderProfile())
00263 {
00264 OrderOpaqueList.begin();
00265 while( OrderOpaqueList.get() != NULL )
00266 {
00267 OrderOpaqueList.get()->profileRender();
00268 OrderOpaqueList.next();
00269 }
00270 }
00271
00272 // Render Transparent stuff.
00273 // =============================
00274
00275 // Render transparent materials
00276 _CurrentPassOpaque = false;
00277 OrderTransparentList.begin(_LayersRenderingOrder);
00278 while( OrderTransparentList.get() != NULL )
00279 {
00280 OrderTransparentList.get()->traverseRender();
00281 OrderTransparentList.next();
00282 }
00283
00284 // Profile this frame?
00285 if(Scene->isNextRenderProfile())
00286 {
00287 OrderTransparentList.begin();
00288 while( OrderTransparentList.get() != NULL )
00289 {
00290 OrderTransparentList.get()->profileRender();
00291 OrderTransparentList.next();
00292 }
00293 }
00294
00295 // END!
00296 // =============================
00297
00298 // clean: reset the light setup
00299 resetLightSetup();
00300
00301 }
|
|
|
update the dependent information.
Definition at line 122 of file trav_scene.h. References NL3D::CTravCameraScene::CamLook, NL3D::CTravCameraScene::CamMatrix, NL3D::CTravCameraScene::CamPos, NLMISC::CMatrix::getPos(), NLMISC::CMatrix::inverted(), and NLMISC::CMatrix::mulVector().
|
|
|
Definition at line 338 of file render_trav.h. Referenced by changeLightSetup(), CRenderTrav(), and resetLightSetup(). |
|
|
Definition at line 321 of file render_trav.h. |
|
|
Definition at line 331 of file render_trav.h. Referenced by CRenderTrav(), isCurrentPassOpaque(), and traverse(). |
|
|
Definition at line 353 of file render_trav.h. Referenced by beginVPLightSetup(), changeLightSetup(), getDriverLight(), and resetLightSetup(). |
|
|
Definition at line 406 of file render_trav.h. Referenced by addRenderLandscape(), clearRenderLandscapeList(), and renderLandscapes(). |
|
|
Definition at line 345 of file render_trav.h. Referenced by changeLightSetup(), and resetLightSetup(). |
|
|
Definition at line 339 of file render_trav.h. Referenced by changeLightSetup(). |
|
|
Definition at line 346 of file render_trav.h. Referenced by changeLightSetup(), and resetLightSetup(). |
|
|
Definition at line 347 of file render_trav.h. Referenced by changeLightSetup(). |
|
|
Definition at line 348 of file render_trav.h. Referenced by changeLightSetup(). |
|
|
Definition at line 344 of file render_trav.h. Referenced by changeLightSetup(), and resetLightSetup(). |
|
|
Definition at line 332 of file render_trav.h. Referenced by CRenderTrav(), getLayersRenderingOrder(), setLayersRenderingOrder(), and traverse(). |
|
|
The manager of skin. NULL by default.
Definition at line 386 of file render_trav.h. |
|
|
Definition at line 341 of file render_trav.h. Referenced by beginVPLightSetup(), changeLightSetup(), getStrongestLightIndex(), and resetLightSetup(). |
|
|
The ShadowMap Manager.
Definition at line 390 of file render_trav.h. Referenced by getShadowMapManager(), and traverse(). |
|
|
The SkinManager, but For Shadow rendering.
Definition at line 392 of file render_trav.h. |
|
|
Definition at line 371 of file render_trav.h. Referenced by changeVPLightSetupMaterial(), and getStrongestLightColors(). |
|
|
Definition at line 356 of file render_trav.h. |
|
|
Definition at line 372 of file render_trav.h. Referenced by changeVPLightSetupMaterial(), and getStrongestLightColors(). |
|
|
Definition at line 357 of file render_trav.h. Referenced by changeLightSetup(), CRenderTrav(), getStrongestLightIndex(), and resetLightSetup(). |
|
|
Definition at line 350 of file render_trav.h. Referenced by changeLightSetup(), CRenderTrav(), getSunDirection(), resetLightSetup(), and setSunDirection(). |
|
|
Definition at line 328 of file render_trav.h. |
|
|
Definition at line 360 of file render_trav.h. Referenced by beginVPLightSetup(), and changeVPLightSetupMaterial(). |
|
|
Definition at line 366 of file render_trav.h. Referenced by beginVPLightSetup(), and changeVPLightSetupMaterial(). |
|
|
Definition at line 368 of file render_trav.h. Referenced by beginVPLightSetup(), changeVPLightSetupMaterial(), and getStrongestLightIndex(). |
|
|
Definition at line 369 of file render_trav.h. Referenced by beginVPLightSetup(), changeVPLightSetupMaterial(), and getStrongestLightIndex(). |
|
|
Definition at line 377 of file render_trav.h. Referenced by changeVPLightSetupMaterial(). |
|
|
Definition at line 378 of file render_trav.h. Referenced by changeVPLightSetupMaterial(). |
|
|
Definition at line 375 of file render_trav.h. Referenced by beginVPLightSetup(), and changeVPLightSetupMaterial(). |
|
|
Definition at line 376 of file render_trav.h. Referenced by changeVPLightSetupMaterial(). |
|
|
Definition at line 380 of file render_trav.h. Referenced by changeVPLightSetupMaterial(). |
|
|
Definition at line 379 of file render_trav.h. Referenced by changeVPLightSetupMaterial(). |
|
|
Definition at line 362 of file render_trav.h. Referenced by beginVPLightSetup(), changeVPLightSetupMaterial(), and getNumVPLights(). |
|
|
Definition at line 364 of file render_trav.h. Referenced by beginVPLightSetup(), and changeVPLightSetupMaterial(). |
|
|
Definition at line 165 of file render_trav.h. Referenced by beginVPLightSetup(), CRenderTrav(), NL3D::CScene::getAmbientGlobal(), resetLightSetup(), and NL3D::CScene::setAmbientGlobal(). |
|
|
Definition at line 75 of file trav_scene.h. Referenced by NL3D::CTravCameraScene::setFrustum(), NL3D::CWaterModel::traverseRender(), and NL3D::CFlareModel::traverseRender(). |
|
|
Definition at line 80 of file trav_scene.h. Referenced by NL3D::CLandscapeModel::clipAndRenderLandscape(), NL3D::CTravCameraScene::CTravCameraScene(), and NL3D::CTravCameraScene::update(). |
|
|
Definition at line 77 of file trav_scene.h. Referenced by NL3D::CTravCameraScene::CTravCameraScene(), NL3D::CTravCameraScene::setCamMatrix(), NL3D::CWaterModel::traverseRender(), NL3D::CFlareModel::traverseRender(), and NL3D::CTravCameraScene::update(). |
|
|
|
Definition at line 327 of file render_trav.h. |
|
|
Definition at line 75 of file trav_scene.h. Referenced by NL3D::CWaterModel::computeClippedPoly(), NL3D::CTravCameraScene::setFrustum(), NL3D::CWaterModel::traverseRender(), and NL3D::CFlareModel::traverseRender(). |
|
|
Definition at line 75 of file trav_scene.h. Referenced by NL3D::CWaterModel::traverseRender(), and NL3D::CFlareModel::traverseRender(). |
|
|
Definition at line 162 of file render_trav.h. Referenced by NL3D::CScene::enableLightingSystem(). |
|
|
The manager of meshBlock. Used to add instances.
Definition at line 310 of file render_trav.h. Referenced by traverse(), and NL3D::CTransformShape::traverseRender(). |
|
|
Definition at line 75 of file trav_scene.h. Referenced by NL3D::CWaterModel::computeClippedPoly(), NL3D::CTravCameraScene::setFrustum(), NL3D::CWaterModel::traverseRender(), and NL3D::CFlareModel::traverseRender(). |
|
|
Definition at line 324 of file render_trav.h. Referenced by CRenderTrav(), and traverse(). |
|
|
Definition at line 325 of file render_trav.h. Referenced by CRenderTrav(), and traverse(). |
|
|
Definition at line 76 of file trav_scene.h. Referenced by NL3D::CTravCameraScene::setFrustum(). |
|
|
Definition at line 320 of file render_trav.h. Referenced by addRenderModel(), CRenderTrav(), reserveRenderList(), and traverse(). |
|
|
Definition at line 75 of file trav_scene.h. Referenced by NL3D::CWaterModel::computeClippedPoly(), NL3D::CTravCameraScene::setFrustum(), NL3D::CWaterModel::traverseRender(), and NL3D::CFlareModel::traverseRender(). |
|
|
Definition at line 55 of file trav_scene.h. Referenced by NL3D::CScene::CScene(), NL3D::CMeshMRMSkinnedGeom::profileSceneRender(), NL3D::CMeshMRMGeom::profileSceneRender(), and NL3D::CMeshGeom::profileSceneRender(). |
|
|
Definition at line 167 of file render_trav.h. Referenced by changeLightSetup(), CRenderTrav(), NL3D::CScene::getSunAmbient(), and NL3D::CScene::setSunAmbient(). |
|
|
Definition at line 167 of file render_trav.h. Referenced by changeLightSetup(), CRenderTrav(), NL3D::CScene::getSunDiffuse(), and NL3D::CScene::setSunDiffuse(). |
|
|
Definition at line 167 of file render_trav.h. Referenced by changeLightSetup(), CRenderTrav(), NL3D::CScene::getSunSpecular(), and NL3D::CScene::setSunSpecular(). |
|
|
Definition at line 75 of file trav_scene.h. Referenced by NL3D::CWaterModel::computeClippedPoly(), NL3D::CWaterModel::traverseRender(), and NL3D::CFlareModel::traverseRender(). |
|
|
Definition at line 78 of file trav_scene.h. Referenced by NL3D::CWaterModel::computeClippedPoly(), NL3D::CParticleSystemModel::doAnimate(), NL3D::CWaterModel::traverseRender(), and NL3D::CFlareModel::traverseRender(). |
1.3.6