# 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  

landscape.h

Go to the documentation of this file.
00001 
00007 /* Copyright, 2000 Nevrax Ltd.
00008  *
00009  * This file is part of NEVRAX NEL.
00010  * NEVRAX NEL is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2, or (at your option)
00013  * any later version.
00014 
00015  * NEVRAX NEL is distributed in the hope that it will be useful, but
00016  * WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00018  * General Public License for more details.
00019 
00020  * You should have received a copy of the GNU General Public License
00021  * along with NEVRAX NEL; see the file COPYING. If not, write to the
00022  * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00023  * MA 02111-1307, USA.
00024  */
00025 
00026 #ifndef NL_LANDSCAPE_H
00027 #define NL_LANDSCAPE_H
00028 
00029 
00030 #include "nel/misc/types_nl.h"
00031 #include "nel/misc/class_id.h"
00032 #include "nel/misc/smart_ptr.h"
00033 #include "nel/misc/triangle.h"
00034 #include "3d/zone.h"
00035 #include "3d/tile_bank.h"
00036 #include "3d/patch_rdr_pass.h"
00037 #include "3d/vertex_buffer.h"
00038 #include "3d/primitive_block.h"
00039 #include "3d/material.h"
00040 #include "3d/tile_far_bank.h"
00041 #include "3d/texture_near.h"
00042 #include "3d/quad_grid.h"
00043 #include "nel/misc/block_memory.h"
00044 #include "3d/landscapevb_allocator.h"
00045 #include "3d/landscape_face_vector_manager.h"
00046 #include "3d/tess_face_priority_list.h"
00047 #include "nel/3d/point_light_influence.h"
00048 
00049 #include <map>
00050 
00051 #define NL_MAX_SIZE_OF_TEXTURE_EDGE_SHIFT (NL_MAX_TILES_BY_PATCH_EDGE_SHIFT+NL_NUM_PIXELS_ON_FAR_TILE_EDGE_SHIFT)
00052 #define NL_MAX_SIZE_OF_TEXTURE_EDGE (1<<NL_MAX_SIZE_OF_TEXTURE_EDGE_SHIFT)              // Size max of a far texture edge in pixel
00053 
00054 
00055 namespace NL3D 
00056 {
00057 
00058 
00059 class   CHeightMap;
00060 class   CTileNoiseMap;
00061 class   CVegetableManager;
00062 class   CVegetable;
00063 class   CTileVegetableDesc;
00064 class   CScene;
00065 class   CTextureFar;
00066 class   CTextureDLM;
00067 class   CPatchDLMContextList;
00068 
00069 using NLMISC::Exception;
00070 using NLMISC::CTriangle;
00071 using NLMISC::CBlockMemory;
00072 
00073 // ***************************************************************************
00074 // The maximum amount of different tiles in world.
00075 const   sint    NbTilesMax= 65536;
00076 // Size of a CTextureNear. 256 by default (works everywhere).
00077 // Texures must be square, because of uvscalebias...
00078 const   sint    TextureNearSize= 512;
00079 const   sint    NbTileLightMapByLine= TextureNearSize/NL_TILE_LIGHTMAP_SIZE;
00080 const   sint    NbTileLightMapByTexture= NbTileLightMapByLine*NbTileLightMapByLine;
00081 
00082 
00083 
00084 // ***************************************************************************
00091 struct EBadBind : public Exception
00092 {
00093 private:
00094         mutable std::string             _Output;
00095 
00096 public:
00097         struct  CBindError
00098         {
00099                 CBindError(sint z, sint p) {ZoneId= z; PatchId= p;}
00100                 sint    ZoneId;
00101                 sint    PatchId;
00102         };
00103 
00104 
00105         // The result list of bind errors.
00106         std::list<CBindError>   BindErrors;
00107 
00108 public:
00109         EBadBind() {}
00110         ~EBadBind() throw () {}
00111         virtual const char      *what() const throw();
00112 
00113 };
00114 
00115 
00116 
00117 // ***************************************************************************
00138 class CLandscape : public NLMISC::CRefCount
00139 {
00140 public:
00141         // The bank of tiles information.
00142         CTileBank               TileBank;
00143         CTileFarBank    TileFarBank;
00144 
00145 public:
00146 
00148         CLandscape();
00150         ~CLandscape();
00151 
00152 
00154         // @{
00156         void                    init();
00157 
00163         bool                    addZone(const CZone     &newZone);
00164         
00170         bool                    removeZone(uint16 zoneId);
00171         
00173         void                    clear();
00174 
00176         void                    checkBinds() throw(EBadBind);
00178         void                    checkBinds(uint16 zoneId) throw(EBadBind);
00179 
00185         bool                    initTileBanks ();
00186         // @}
00187 
00188         
00190         // @{
00192         void                    setTileNear (float tileNear);
00194         float                   getTileNear () const    {return _TileDistNear;}
00196         void                    setThreshold (float thre);
00198         float                   getThreshold () const   {return _Threshold;}
00199         void                    setRefineMode(bool enabled) {_RefineMode= enabled;}
00200         bool                    getRefineMode() const {return _RefineMode;}
00202         void                    setTileMaxSubdivision (uint tileDiv);
00204         uint                    getTileMaxSubdivision ();
00205 
00207         void                    setNoiseMode(bool enabled);
00208         bool                    getNoiseMode() const;
00209 
00210         // \todo yoyo: other landscape param setup (Transition etc...).
00211         // Store it by landscape, and not only globally in CLandscapeGlobals statics.
00212         // @}
00213 
00214 
00216         // @{
00222         void                    setDriver(IDriver *drv);
00226         void                    clip(const CVector &refineCenter, const std::vector<CPlane>     &pyramid);
00229         void                    refine(const CVector &refineCenter);
00236         void                    render(const CVector &refineCenter, const CVector &frontVector, const CPlane pyramid[NL3D_TESSBLOCK_NUM_CLIP_PLANE], bool doTileAddPass=false);
00237 
00239         void                    refineAll(const CVector &refineCenter);
00241         void                    excludePatchFromRefineAll(sint zoneId, uint patch, bool exclude);
00242 
00243 
00248         void                    averageTesselationVertices();
00249 
00250 
00251         // @}
00252 
00253 
00255         // @{
00263         void                    buildCollideFaces(const CAABBoxExt &bbox, std::vector<CTriangle> &faces, bool faceSplit);
00267         void                    buildCollideFaces(sint zoneId, sint patch, std::vector<CTriangle> &faces);
00268 
00276         void                    buildTrianglesInBBox(const CAABBox &bbox, std::vector<CTrianglePatch> &triangles, uint8 tileTessLevel);
00277 
00278 
00285         void                    buildPatchBlocksInBBox(const CAABBox &bbox, std::vector<CPatchBlockIdent> &paBlockIds);
00289         void                    fillPatchQuadBlock(CPatchQuadBlock &quadBlock) const;
00290 
00291 
00295         CVector                 getTesselatedPos(const CPatchIdent &patchId, const CUV &uv) const;
00296 
00297 
00301         void                    getTessellationLeaves(std::vector<const CTessFace*>  &leaves) const;
00302 
00303         // @}
00304 
00305 
00306 
00308         // @{
00314         CZone*                  getZone (sint zoneId);
00320         const CZone*    getZone (sint zoneId) const;
00323         void                    getZoneList(std::vector<uint16> &zoneIds) const;
00325         static void             buildZoneName(sint zoneId, std::string &zoneName);
00326         // @}
00327 
00328 
00330         // @{
00332         void                    flushTiles(IDriver *drv, uint16 tileStart, uint16 nbTiles);
00334         void                    releaseTiles(uint16 tileStart, uint16 nbTiles);
00335 
00337         NLMISC::CSmartPtr<ITexture>             getTileTexture(uint16 tileId, CTile::TBitmap bitmapType, CVector &uvScaleBias);
00338 
00340         CTileElement                                    *getTileElement(const CPatchIdent &patchId, const CUV &uv);
00341         // @}
00342 
00344         // @{
00352         void setupStaticLight (const CRGBA &diffuse, const CRGBA &ambiant, float multiply);
00358         const CRGBA* getStaticLight () const
00359         {
00360                 return _LightValue;
00361         }
00362 
00363 
00368         void    setPointLightDiffuseMaterial(CRGBA diffuse);
00372         CRGBA   getPointLightDiffuseMaterial () const
00373         {
00374                 return _PointLightDiffuseMaterial;
00375         }
00376 
00377 
00383         void    enableAutomaticLighting(bool enable);
00389         void    setupAutomaticLightDir(const CVector &lightDir);
00391         bool    getAutomaticLighting() const {return _AutomaticLighting;}
00393         const CVector &getAutomaticLightDir() const {return _AutomaticLightDir;}
00394 
00395 
00398         void    removeAllPointLights();
00399 
00400 
00406         void    setPointLightFactor(const std::string &lightGroupName, NLMISC::CRGBA nFactor);
00407 
00408 
00409         // @}
00410 
00411 
00413         // @{
00415         CVector         getHeightFieldDeltaZ(float x, float y) const;
00421         void            setHeightField(const CHeightMap &hf);
00422         // @}
00423 
00424 
00426         // @{
00427 
00431         void            createVegetableBlendLayersModels(CScene *scene);
00432 
00436         void            setVegetableTime(double time);
00437 
00441         void            setVegetableUpdateLightingTime(double time);
00442 
00443 
00447         void            enableVegetable(bool enable);
00448 
00452         bool            isVegetableActive() const;
00453 
00456         void            loadVegetableTexture(const std::string &textureFileName);
00457 
00460         void            setupVegetableLighting(const CRGBA &ambient, const CRGBA &diffuse, const CVector &directionalLight);
00461 
00471         void            setVegetableWind(const CVector &windDir, float windFreq, float windPower, float windBendMin);
00472 
00473 
00477         uint            getNumVegetableFaceRendered() const;
00478 
00479 
00484         void            setVegetableUpdateLightingFrequency(float freq);
00485 
00486 
00495         void            setupColorsFromTileFlags(const NLMISC::CRGBA colors[4]);
00496 
00497         // @}
00498 
00499 
00501         // @{
00502 
00504         uint8           getLumel(const CPatchIdent &patchId, const CUV &uv) const;
00505 
00507         void            appendTileLightInfluences(const CPatchIdent &patchId, const CUV &uv, 
00508                 std::vector<CPointLightInfluence> &pointLightList) const;
00509 
00510         // @}
00511 
00512 
00514         // @{
00515 
00523         void                    setPZBModelPosition(const CVector &pos);
00524 
00526         const CVector   &getPZBModelPosition() const {return _PZBModelPosition;}
00527 
00528         // @}
00529 
00530 
00532         // @{
00533 
00537         void                    updateLighting(double time);
00538 
00543         void                    setUpdateLightingFrequency(float freq);
00544 
00548         void                    updateLightingAll();
00549 
00550 
00551         // @}
00552 
00553 
00555         // @{
00556 
00560         void                    computeDynamicLighting(const std::vector<CPointLight*>  &pls);
00561 
00566         uint                    getDynamicLightingMemoryLoad() const;
00567 
00571         void                    setDynamicLightingMaxAttEnd(float maxAttEnd);
00572 
00575         float                   getDynamicLightingMaxAttEnd() const {return _DLMMaxAttEnd;}
00576 
00580         void                    setDLMGlobalVegetableColor(CRGBA gvc);
00581 
00584         CRGBA                   getDLMGlobalVegetableColor() const {return _DLMGlobalVegetableColor;}
00585 
00586         // @}
00587 
00588 
00589 
00590 // ********************************
00591 private:
00592         // Private part used by CTessFace / CPatch / CZone.
00593         friend class    CTessFace;
00594         friend class    CPatch;
00595         friend class    CZone;
00596 
00597 
00599         // @{
00600 
00601         CBlockMemory<CTessFace>                 TessFaceAllocator;
00602         CBlockMemory<CTessVertex>               TessVertexAllocator;
00603         CBlockMemory<CTessNearVertex>   TessNearVertexAllocator;
00604         CBlockMemory<CTessFarVertex>    TessFarVertexAllocator;
00605         CBlockMemory<CTileMaterial>             TileMaterialAllocator;
00606         CBlockMemory<CTileFace>                 TileFaceAllocator;
00607 
00608         CTessFace                       *newTessFace();
00609         CTessVertex                     *newTessVertex();
00610         CTessNearVertex         *newTessNearVertex();
00611         CTessFarVertex          *newTessFarVertex();
00612         CTileMaterial           *newTileMaterial();
00613         CTileFace                       *newTileFace();
00614 
00615         void                            deleteTessFace(CTessFace *f);
00616         void                            deleteTessVertex(CTessVertex *v);
00617         void                            deleteTessNearVertex(CTessNearVertex *v);
00618         void                            deleteTessFarVertex(CTessFarVertex *v);
00619         void                            deleteTileMaterial(CTileMaterial *tm);
00620         void                            deleteTileFace(CTileFace *tf);
00621 
00622         // Allocator of FaceVector for allocation of packed triangles indices.
00623         CLandscapeFaceVectorManager             _FaceVectorManager;
00624         // This is not a valid TessBlock. But it is used as a Root for modification list.
00625         // Can't use a ptr, because of ~CTessBlock().
00626         CTessBlock                                              _TessBlockModificationRoot;
00627         // @}
00628 
00629 
00630         // Return the render pass for a far texture here.
00631         CPatchRdrPass   *getFarRenderPass(CPatch* pPatch, uint farIndex, float& far1UScale, float& far1VScale, float& far1UBias, float& far1VBias, bool& bRot);
00632         // Free the render pass for a far texture here.
00633         void                    freeFarRenderPass (CPatch* pPatch, CPatchRdrPass* pass, uint farIndex);
00634         // Return the render pass for a tile Id, and a patch Lightmap.
00635         CPatchRdrPass   *getTileRenderPass(uint16 tileId, bool additiveRdrPass);
00636         // Return the UvScaleBias for a tile Id. uv.z has the scale info. uv.x has the BiasU, and uv.y has the BiasV.
00637         // if bitmap type is CTile::alpha, Return also the additionla rot for alpha (else 0).
00638         void                    getTileUvScaleBiasRot(uint16 tileId, CTile::TBitmap bitmapType, CVector &uvScaleBias, uint8 &rotAlpha);
00639 
00640         // release Far render pass/reset Tile/Far render. Delete also VB, and FaceVectors
00641         void                    resetRenderFarAndDeleteVBFV();
00643         void                    forceMergeAtTileLevel();
00644 
00645         // Update globals value to CTessFace, and lock Buffers if possible.
00646         void updateGlobalsAndLockBuffers (const CVector &refineCenter);
00647         // lockBuffers(), called by updateGlobalsAndLockBuffers().
00648         void lockBuffers ();
00649         // unlockBuffers. This is the END call for updateGlobalsAndLockBuffers().
00650         void unlockBuffers ();
00651         // special for ATI. called in render()
00652         void synchronizeATIVBHards();
00653         // update TheFaceVector for which the faces may have been modified during refine(), refineAll() etc....
00654         void updateTessBlocksFaceVector();
00655 
00656 
00657         // System: update UL links, and call _FarRdrPassSet.erase()
00658         void eraseFarRenderPassFromSet (CPatchRdrPass* pass);
00659 
00660 
00661 
00662 private:
00663         TZoneMap                Zones;
00664 
00665         // Parameters.
00666         float                   _TileDistNear;
00667         float                   _Threshold;
00668         bool                    _RefineMode;
00669         float                   _FarTransition;
00670         uint                    _TileMaxSubdivision;
00671         // For VertexProgram. true if change has occured in threshold since the last render().
00672         float                   _VPThresholdChange;
00673 
00675         // @{
00676         CRefPtr<IDriver>                        _Driver;
00677         CLandscapeVBAllocator           _Far0VB;
00678         CLandscapeVBAllocator           _Far1VB;
00679         CLandscapeVBAllocator           _TileVB;
00680         // True if we can compute Geomorph and Alpha with VertexShader.
00681         bool                                            _VertexShaderOk;
00682         // For CZone::refreshTesselationGeometry().
00683         bool                                            _RenderMustRefillVB;
00684         // @}
00685 
00686 
00687         // Tiles Types.
00688         //=============
00689         // Texture Map. Use a RefPtr because TileTextureMap must not reference the object, but the ptr.
00690         typedef NLMISC::CRefPtr<ITexture>                       RPTexture;
00691         typedef std::map<std::string, RPTexture>        TTileTextureMap;
00692         typedef TTileTextureMap::iterator                       ItTileTextureMap;
00693         // RdrPass Set.
00694         typedef std::set<CPatchRdrPass>                         TTileRdrPassSet;
00695         typedef TTileRdrPassSet::iterator                       ItTileRdrPassSet;
00696         typedef NLMISC::CSmartPtr<CPatchRdrPass>        TSPRenderPass;
00697 
00698         // The additional realtime structure for a tile.
00699         struct  CTileInfo
00700         {
00701                 // NB: CSmartPtr are not used for simplicity, and because of TTileRdrPassSet...
00702                 // CPatchRdrPass::RefCount are excplictly incremented/decremented...
00703                 // The rdrpass for diffuse+Alpha material.
00704                 CPatchRdrPass   *DiffuseRdrPass;
00705                 // The rdrpass for additive material (may be NULL if no additive part).
00706                 CPatchRdrPass   *AdditiveRdrPass;
00707                 // The scale/Bias to access those tiles in the big texture.
00708                 // uv.z has the scale info. uv.x has the BiasU, and uv.y has the BiasV.
00709                 // Manages the demi-texel on tile border too.
00710                 CVector                 DiffuseUvScaleBias;
00711                 CVector                 AlphaUvScaleBias;
00712                 CVector                 AdditiveUvScaleBias;
00713                 // The additional rotation for this tile, in alpha.
00714                 uint8                   RotAlpha;
00715         };
00716 
00717 
00718         // Tiles Data.
00719         //=============
00720         // The map of tile texture loaded.
00721         TTileTextureMap                         TileTextureMap;
00722         // The set of tile Rdr Pass.
00723         TTileRdrPassSet                         TileRdrPassSet;
00724         // The parrallel array of tile of those existing in TileBank. size of NbTilesMax.
00725         std::vector<CTileInfo*>         TileInfos;
00726         // The Lightmap rdrpass for tiles.
00727         // must have a vector of pointer, because of vector reallocation.
00728         std::vector<TSPRenderPass>              _TextureNears;
00729         uint                                                    _NFreeLightMaps;
00730 
00731 
00732         // The Tile material.
00733         CMaterial               TileMaterial;
00734 
00735         // The Far material.
00736         CMaterial               FarMaterial;
00737 
00738 
00739         // *** Far texture      
00740 
00741         // ** Some types
00742 
00743         // The vector of set of far render pass
00744         typedef std::set<TSPRenderPass>                         TSPRenderPassSet;
00745         typedef TSPRenderPassSet::iterator                      ItSPRenderPassSet;
00746         typedef std::vector<TSPRenderPassSet>           TSPRdrPassSetVector;
00747         TSPRenderPassSet                                                        _FarRdrPassSet;                                 // Contain all the render pass not empty for pass0 and pass1
00748         TSPRdrPassSetVector                                                     _FarRdrPassSetVectorFree;               // Contain the render pass not filled yet sorted by size for pass0 and pass1
00749         bool                                                                            _FarInitialized;
00750 
00751         // Used internaly by initTileBanks
00752         bool                                                                            eraseTileFarIfNotGood (uint tileNumber, uint sizeOrder0, uint sizeOrder1, uint sizeOrder2);
00753 
00754         // ** Some private methods
00755         static uint                                                                     getRdrPassIndexWithSize (uint width, uint height);
00756         void                                                                            addPatch ();
00757         void                                                                            removePatch ();
00758 
00759 
00760         // *** Lighting
00761         CRGBA                   _LightValue[256];
00762 
00763         bool                    _AutomaticLighting;
00764         CVector                 _AutomaticLightDir;
00765 
00766         // The map LightGroupName -> Color.
00767         typedef std::map<std::string, NLMISC::CRGBA>    TLightGroupColorMap;
00768         typedef TLightGroupColorMap::iterator                   ItLightGroupColorMap;
00769         TLightGroupColorMap             _LightGroupColorMap;
00770 
00771 
00772 private:
00773         // Internal only. Force load of the tile (with TileBank).
00774         void                    loadTile(uint16 tileId);
00775         void                    releaseTile(uint16 tileId);
00776         ITexture                *findTileTexture(const std::string &textName);
00777         CPatchRdrPass   *findTileRdrPass(const CPatchRdrPass &pass);
00778 
00779         // Tile LightMap mgt. NB: a lightmap is now a 2x2 tiles lightmap (10x10 pixels).
00780         // @{
00781         // Compute and get a lightmapId/lightmap renderpass.
00782         // lightmap returned is to be uses with getTileRenderPass(). The id returned must be stored.
00783         uint            getTileLightMap(CRGBA  map[NL_TILE_LIGHTMAP_SIZE*NL_TILE_LIGHTMAP_SIZE], CPatchRdrPass *&lightmapRdrPass);
00784         // tileLightMapId must be the id returned  by getTileLightMap().
00785         void            getTileLightMapUvInfo(uint tileLightMapId, CVector &uvScaleBias);
00786         // tileLightMapId must be the id returned  by getTileLightMap().
00787         void            releaseTileLightMap(uint tileLightMapId);
00788 
00789         // refill a lightmap already computed. tileLightMapId must be the id returned  by getTileLightMap().
00790         void            refillTileLightMap(uint tileLightMapId, CRGBA  map[NL_TILE_LIGHTMAP_SIZE*NL_TILE_LIGHTMAP_SIZE]);
00791 
00792         // @}
00793 
00794 
00795         // check a zone, adding error to exception.
00796         void                    checkZoneBinds(CZone &curZone, EBadBind &bindError);
00797 
00798 
00802         struct  CBezierPatchZ
00803         {
00805                 float           Vertices[4];            
00807                 float           Tangents[8];            
00809                 float           Interiors[4];           
00810 
00812                 void            makeInteriors();
00814                 float           eval(float s, float t) const;                   // s,t coordinates for quad.
00815         };
00816 
00817 
00818         // HeightFields.
00819         struct  CHeightField
00820         {
00821                 std::vector<CBezierPatchZ>              ZPatchs;
00822 
00824                 float                   OriginX, OriginY;
00826                 float                   SizeX, SizeY;
00827                 float                   OOSizeX, OOSizeY;
00829                 uint                    Width, Height;
00830         };
00831         CHeightField    _HeightField;
00832 
00833 
00835         // @{
00836 
00837         // A CPatchIdent, with a ptr to the compiled CPatch 
00838         struct  CPatchIdentEx : public CPatchIdent
00839         {
00840                 const CPatch    *Patch;
00841         };
00842 
00844         CQuadGrid<CPatchIdentEx>        _PatchQuadGrid;
00845         static  const uint                      _PatchQuadGridSize;
00846         static  const float                     _PatchQuadGridEltSize;
00847 
00854         void                    addTrianglesInBBox(const CPatchIdentEx &paIdEx, const CAABBox &bbox, std::vector<CTrianglePatch> &triangles, uint8 tileTessLevel) const;
00855 
00858         void                    addPatchBlocksInBBox(const CPatchIdentEx &paIdEx, const CAABBox &bbox, std::vector<CPatchBlockIdent> &paBlockIds);
00859         // @}
00860 
00861 
00863         // @{
00864         // guess.
00865         bool                    _NoiseEnabled;
00866         // @}
00867 
00868 
00870         // @{
00872         CTessFacePriorityList           _SplitPriorityList;
00874         CTessFacePriorityList           _MergePriorityList;
00876         CVector                                         _OldRefineCenter;
00877         bool                                            _OldRefineCenterSetuped;
00879         CTessFacePListNode                      _RootNewLeaves;
00880         // @}
00881 
00882 
00884         // @{
00886         CVegetableManager                       *_VegetableManager;
00887 
00889         bool                                            _VegetableManagerEnabled;
00891         bool                                            _DriverOkForVegetable;
00892 
00894         CTessList<CLandscapeVegetableBlock>             _VegetableBlockList;
00895 
00899         const CTileVegetableDesc        &getTileVegetableDesc(uint16 tileId);
00900 
00901         // @}
00902 
00903 
00905         // @{
00907         CVector                                         _PZBModelPosition;
00908         // @}
00909 
00910 
00912         // @{
00913         // Last update time.
00914         double                                          _ULPrecTime;
00915         bool                                            _ULPrecTimeInit;
00916         double                                          _ULTime;
00918         float                                           _ULFrequency;
00919 
00920 
00922         sint                                            _ULTotalFarPixels;
00924         float                                           _ULFarPixelsToUpdate;
00926         CTextureFar                                     *_ULRootTextureFar;
00928         uint                                            _ULFarCurrentPatchId;
00929 
00930 
00932         sint                                            _ULTotalNearPixels;
00934         float                                           _ULNearPixelsToUpdate;
00936         CPatch                                          *_ULRootNearPatch;
00938         uint                                            _ULNearCurrentTessBlockId;
00939 
00941         void                    linkPatchToNearUL(CPatch *patch);
00942         void                    unlinkPatchFromNearUL(CPatch *patch);
00943 
00944 
00946         void                    updateLightingTextureFar(float ratio);
00948         void                    updateLightingTextureNear(float ratio);
00949 
00950 
00951         // @}
00952 
00953 
00955         // @{
00957         NLMISC::CSmartPtr<ITexture>     _TextureDLM;
00959         CTextureDLM                                     *getTextureDLM() const {return (CTextureDLM*)(ITexture*)_TextureDLM;}
00961         CPatchDLMContextList            *_PatchDLMContextList;
00963         CPatchDLMContextList            *getPatchDLMContextList() const {return _PatchDLMContextList;}
00965         float                                           _DLMMaxAttEnd;
00966 
00968         CRGBA                                           _DLMGlobalVegetableColor;
00969 
00971         CRGBA                                           _PointLightDiffuseMaterial;
00972 
00973         // @}
00974 
00975 };
00976 
00977 
00978 
00979 } // NL3D
00980 
00981 
00982 #endif // NL_LANDSCAPE_H
00983 
00984 /* End of landscape.h */