• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            的筆記

            隨時隨地編輯

            PagedGeometry筆記

            PagedGeometry版本:1.1

            ONE.靜態樹
            a).創建PagedGeometry對象,用于管理草體的細節
            PagedGeometry *trees = new PagedGeometry();
            1    trees->setCamera(camera);    //Set the camera so PagedGeometry knows how to calculate LODs
            2    trees->setPageSize(80);    //Set the size of each page of geometry
            3    trees->setInfinite();        //Use infinite paging mode
            4    trees->addDetailLevel<BatchPage>(15050);        //Use batches up to 150 units away, and fade for 30 more units
            5    trees->addDetailLevel<ImpostorPage>(50050);    //Use impostors up to 400 units, and for for 50 more units


            b).創建草體加載器,用于加載加載草體,鋪草
            TreeLoader3D *treeLoader = new TreeLoader3D(trees, TBounds(0, 0, 1500,1500));

            c).幀循環中進行更新
            trees->update();

            其內部有3個動作:
            1.更新loader
            2.更新內部對象:GeometryPageManager
            3. Update misc. subsystems

            StaticBillboardSet::updateAll(_convertToLocal(getCamera()->getDerivedDirection()));


            d).退出時清理內存



            TWO.動態草體

            動態草和靜態樹的創建如出一轍,只是將植物加載器換從“TreeLoader3D”換成了“GrassLoader”而已,順利成章的,如果要家長其他不同類的植物,只需使用一個該植物的“XXXLoader”即可。其實整個PagedGeometry中的加載器只有三個,PageLoader派生了3個加載器:
             - Forests::GrassLoader
             - Forests::TreeLoader2D
             - Forests::TreeLoader3D

            GrassLoader創建如下:
            GrassLoader借助一個GrassLayer對象來“植樹”:

            a).源碼中隊GrassLayer的說明

            A data structure giving you full control over grass properties.Grass is added to the scene through GrassLoader::addLayer(). Through this class you can configure your grass layer any way you like - size, density, render technique,animation, etc. Simply call the appropriate "set" member function to set the desired property.Remember that you cannot create or delete layers directly. Layers can only be created with GrassLoader::addLayer(), and may not be deleted manually (they will be deleted when the associated GrassLoader is deleted).
             - GrassLayer只能通過GrassLoader::addLayer()來創建
             - GrassLoader不能直接創建或刪除
             - GrassLoader不能進行手動刪除

                addlayer傳給GrassLayer的參數是一個字符串,這個字符串是一個material的名字,以便渲染手動創建的草體mesh時使用。


            b).草實體的創建
            草體是在GrassLoader::loadPage中創建的

                                mesh = generateGrass_QUAD(page, layer, position, grassCount);

            而loadPage是在幀循環調用“GeometryPageManager::update”時調用的,通過GeometryPageManager::update的“cacheInterval”技術實現渲染前調用一次,好比在幀循環中設置一個標志位,如果發現草實體沒有創建,則創建之。這里的generateGrass_QUAD實現了一個手動創建mesh的方法。

            THREE.靜態樹和動態草一起

            創建2個PagedGeometry對象,分別互不干涉的各管各即可。當然需要在幀循環中分別更新了。


            FOUR.2D樹和3D樹的區別

            If the inability to supply a vertical coordinate to addTree() is too limiting, or you are unable to implement
            a fast enough height function, please refer to TreeLoader3D. TreeLoader3D allows you to provide full 3D x/y/z
            coordinates, although 40% more memory is required per tree.
            更多說明見<pagedGeometry-1.1.0\include\TreeLoader2D.h>
             - 2D樹非常省內存
             - 2D樹對放置的3D坐標有限制
             - 3D樹可以設置完全的3D坐標
             - 3D樹的每一顆樹都比2D樹多占用40%的內存

            posted on 2011-05-23 16:27 的筆記 閱讀(376) 評論(0)  編輯 收藏 引用

            青青草国产97免久久费观看| 久久精品一区二区三区中文字幕| 人妻少妇精品久久| 亚洲国产精品成人AV无码久久综合影院 | 国产午夜福利精品久久| 无码任你躁久久久久久| 久久精品国产亚洲av水果派 | 怡红院日本一道日本久久| 久久久精品国产亚洲成人满18免费网站| 久久99精品久久久久久齐齐| 久久久久亚洲AV无码专区首JN| 国产精品美女久久久久| 国产精品久久久久久久app| 久久久久免费看成人影片| 久久中文精品无码中文字幕| 久久久久亚洲av综合波多野结衣| 国产69精品久久久久99| 久久久久久久久久久久中文字幕 | 波多野结衣久久一区二区| 久久久久久久综合日本亚洲| 久久婷婷五月综合成人D啪 | 久久久亚洲欧洲日产国码二区 | 久久国产香蕉一区精品| 国产成人久久AV免费| 久久人人爽人人人人片av| 国产一区二区精品久久岳| 99久久99这里只有免费的精品| 久久亚洲精品无码aⅴ大香 | 亚洲国产精品无码久久久蜜芽| 久久久无码精品午夜| 天天爽天天爽天天片a久久网| 久久综合给合久久狠狠狠97色69| 色天使久久综合网天天| 欧美与黑人午夜性猛交久久久| 国产高潮国产高潮久久久91 | 色综合久久天天综线观看| 精品国产婷婷久久久| 国产亚州精品女人久久久久久| 97久久精品人人做人人爽| 国产精品成人99久久久久| 久久人人爽人人爽人人片AV麻豆 |