• <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>

            清源游民 gameogre@gmail.com

            材質復制
            如果新的腳本只是對某個已經存在的腳本進行小部分的變化,那么可進行從舊腳本復制,而不是C&P。新材質可以修改特定technique,pass,texture,或是添加新項。
            格式: material <NewUniqueChildName> : <ReferanceParentMaterial>
            當材質腳本被加載到ogre中,這種繼承關系不再維系,假如父材質在運行時被修改,不會影響到子材質。如果在一個technique中有5個pass,而我們只想修改第5個pass,我們可以用pass指定或是它的索引(從0計)
            meterial test2: test1
            {
            ? technique 0
            ??? {
            ????? pass 4
            ??????? {
            ????????? ambient 0.5 0.7 0.3 1.0
            ??????? }
            ??? }
            }
            加入一個新的technique或pass到material中,可以通過賦于它們新的名稱來實現,新名稱必須在父材質中沒有出現過。指定新索引也一樣。新technique或pass會被加載到父材質相應technique或pass末尾.
            material BumpMap2 : BumpMap1
            {
            ? technique ati8500
            ? {
            ??? pass 0
            ??? {
            ????? texture_unit NormalMap
            ????? {
            ??????? texture BumpyMetalNM.png
            ????? }
            ??? }
            ? }
            }
            在上面的例子中,如果texture_unit的名稱NormalMap在父材質中指定過,那么現在的行為表示override,如果它是一個新的名字,那么表示在pass的最后新加一個texture unit。 

            紋理別名

            在源材質被clone時,每個texture unit可以被賦于一個Texture alias(別名)。可以用這個別名來指定使用什么紋理。格式: texture_alias <name> 缺省: texutre_unit <name>( 紋理單元的名字)
            texture_unit DiffuseTex
            {
            ? texture diffuse.jpg
            }
            在這種情況下,texture_alias為DiffuseTex.
            material TSNormalSpecMapping
            {
            ? technique GLSL
            ? {
            ??? pass
            ??? {?
            ????? texture_unit NormalMap
            ????? {
            ??????? texture defaultNM.png
            ??????? tex_coord_set 0
            ??????? filtering trilinear
            ????? }

            ?????? texture_unit DiffuseMap
            ????? {
            ??????? texture defaultDiff.png
            ??????? filtering trilinear
            ??????? tex_coord_set 1
            ????? }

            ??????? texture_unit SpecMap
            ????? {
            ??????? texture defaultSpec.png
            ??????? filtering trilinear
            ??????? tex_coord_set 2
            ????? }
            ??? }?
            ? }

            ? technique HLSL_DX9
            ? {
            ??? pass
            ??? {?
            ??????? texture_unit
            ????? {
            ??????? texture_alias NormalMap
            ??????? texture defaultNM.png
            ??????? tex_coord_set 0
            ??????? filtering trilinear
            ????? }

            ????? texture_unit
            ????? {
            ??????? texture_alias DiffuseMap
            ??????? texture defaultDiff.png
            ??????? filtering trilinear
            ??????? tex_coord_set 1
            ????? }

            ????? texture_unit
            ????? {
            ??????? texture_alias SpecMap
            ??????? texture defaultSpec.png
            ??????? filtering trilinear
            ??????? tex_coord_set 2
            ????? }
            ??? }?
            ? }
            }
            例子中有兩個技術,都使用相同的紋理,第一個技術使用缺省的方式定義了紋理別名,第二個技術顯式地指定紋理別名。兩者都有相對應的同樣的紋理別名。如果想定義一個材質只是想使用不同的紋理,那么copy父材質時可以使用set_texture_alias來重新指定新紋理。
            material fxTest : TSNormalSpecMapping
            {
            ? set_texture_alias NormalMap fxTestNMap.png
            ? set_texture_alias DiffuseMap fxTestDiff.png
            ? set_texture_alias SpecMap fxTestMap.png
            }
            上面代碼就對擁有指定別名的texture unit所使用的紋理圖片進行了重新指定。

            posted on 2007-03-13 15:57 清源游民 閱讀(1526) 評論(0)  編輯 收藏 引用 所屬分類: OGRE
            <2007年3月>
            25262728123
            45678910
            11121314151617
            18192021222324
            25262728293031
            1234567

            留言簿(35)

            隨筆分類(78)

            隨筆檔案(74)

            文章檔案(5)

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            成人精品一区二区久久久| 国产精品久久久亚洲| 精品久久久久久成人AV| 久久综合噜噜激激的五月天| 狠狠色婷婷久久一区二区三区| 久久精品人人做人人爽97| 精品国产热久久久福利| 久久人人爽人人爽人人av东京热 | 久久男人Av资源网站无码软件 | 色狠狠久久AV五月综合| 久久精品国产99国产精品澳门 | 77777亚洲午夜久久多人| 久久美女人爽女人爽| 国产成人精品综合久久久久 | 亚洲中文久久精品无码ww16| 久久综合综合久久狠狠狠97色88 | 久久国产色av免费看| 久久99国产精品久久99果冻传媒| 国内精品免费久久影院| 亚洲午夜久久久久妓女影院 | 亚洲精品成人久久久| 四虎国产精品免费久久5151| 97香蕉久久夜色精品国产| 国产精品永久久久久久久久久| 精品国产乱码久久久久久呢| 香港aa三级久久三级| 999久久久无码国产精品| 亚洲精品乱码久久久久久按摩 | 亚洲精品99久久久久中文字幕| 麻豆成人久久精品二区三区免费| 久久夜色撩人精品国产小说| 久久只有这精品99| 久久青青国产| 亚洲中文久久精品无码ww16| 久久亚洲电影| 久久国产三级无码一区二区| 国产精品无码久久久久| 久久免费视频观看| 久久精品草草草| 四虎国产精品免费久久久| 青青草原综合久久大伊人精品|