• <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>
            隨筆 - 505  文章 - 1034  trackbacks - 0
            <2006年12月>
            262728293012
            3456789
            10111213141516
            17181920212223
            24252627282930
            31123456


            子曾經曰過:編程無他,唯手熟爾!

            常用鏈接

            留言簿(94)

            隨筆分類(649)

            隨筆檔案(505)

            相冊

            BCB

            Crytek

            • crymod
            • Crytek's Offical Modding Portal

            Game Industry

            OGRE

            other

            Programmers

            Qt

            WOW Stuff

            搜索

            •  

            積分與排名

            • 積分 - 914453
            • 排名 - 14

            最新隨筆

            最新評論

            閱讀排行榜

            評論排行榜

            Vertex Formats


            A flexible vertex format (FVF) code describes the contents of vertices stored interleaved in a single data stream. It generally specifies data to be processed by the fixed function vertex processing pipeline.

            Microsoft® Direct3D® applications can define model vertices in several different ways. Support for flexible vertex definitions, also known as flexible vertex formats or flexible vertex format codes, makes it possible for your application to use only the vertex components it needs, eliminating those components that aren't used. By using only the needed vertex components, your application can conserve memory and minimize the processing bandwidth required to render models. You describe how your vertices are formatted by using a combination of D3DFVF.

            The FVF specification includes formats for point size, specified by D3DFVF_PSIZE. This size is expressed in camera space units for non-TL vertices, and in device-space units for TL vertices.

            The rendering methods of the IDirect3DDevice9 interface provides C++ applications with methods that accept a combination of these flags, and uses them to determine how to render primitives. Basically, these flags tell the system which vertex components - position, vertex blending weights, normal, colors, the number and format of texture coordinates - your application uses and, indirectly, which parts of the rendering pipeline you want Direct3D to apply to them. In addition, the presence or absence of a particular vertex format flag communicates to the system which vertex component fields are present in memory and which you've omitted.

            To determine device limitations, you can query a device for the D3DFVFCAPS_DONOTSTRIPELEMENTS and D3DFVFCAPS_TEXCOORDCOUNTMASK flexible vertex format flags. For more information, see the FVFCaps member of the D3DCAPS9 structure.

            One significant requirement that the system places on how you format your vertices is on the order in which the data appears. The following illustration depicts the required order for all possible vertex components in memory, and their associated data types.


            Texture coordinates can be declared in different formats, allowing textures to be addressed using as few as one coordinate or as many as four texture coordinates (for 2-D projected texture coordinates). For more information, see Texture Coordinate Formats. Use the D3DFVF_TEXCOORDSIZEn set of macros to create bit patterns that identify the texture coordinate formats that your vertex format uses.

            No application will use every component - the reciprocal homogeneous W (RHW) and vertex normal fields are mutually exclusive. Nor will most applications try to use all eight sets of texture coordinates, but Direct3D has this capacity. There are several restrictions on which flags you can use with other flags. For example, you cannot use the D3DFVF_XYZ and D3DFVF_XYZRHW flags together, as this would indicate that your application is describing a vertex's position with both untransformed and transformed vertices.

            To use indexed vertex blending, the D3DFVF_LASTBETA_UBYTE4 flag should appear at the end of the FVF. The presence of this flag indicates that the fifth blending weight will be treated as a DWORD instead of float. For more information, see Indexed Vertex Blending.

            The following code samples shows the difference between an FVF code that uses the D3DFVF_LASTBETA_UBYTE4 flag and one that doesn't. The FVF defined below does not use the D3DFVF_LASTBETA_UBYTE4 flag. The flag D3DFVF_XYZ3 is present when four blending indices are used because you always use (1 - the sum of the first three) for the fourth.

            #define D3DFVF_BLENDVERTEX (D3DFVF_XYZB3|D3DFVF_NORMAL|D3DFVF_TEX1)

            struct BLENDVERTEX
            {
                D3DXVECTOR3 v;       
            // Referenced as v0 in the vertex shader
                FLOAT       blend1;  // Referenced as v1.x in the vertex shader
                FLOAT       blend2;  // Referenced as v1.y in the vertex shader
                FLOAT       blend3;  // Referenced as v1.z in the vertex shader
                                     
            // v1.w = 1.0 - (v1.x + v1.y + v1.z)
                D3DXVECTOR3 n;       // Referenced as v3 in the vertex shader
                FLOAT       tu, tv;  // Referenced as v7 in the vertex shader
            };

            The FVF defined below uses the D3DFVF_LAST_UBYTE4 flag.

            #define D3DFVF_BLENDVERTEX (D3DFVF_XYZB4 | D3DFVF_LASTBETA_UBYTE4 |D3DFVF_NORMAL|D3DFVF_TEX1)

            struct BLENDVERTEX
            {
                D3DXVECTOR3 v;       
            // Referenced as v0 in the vertex shader
                FLOAT       blend1;  // Referenced as v1.x in the vertex shader
                FLOAT       blend2;  // Referenced as v1.y in the vertex shader
                FLOAT       blend3;  // Referenced as v1.z in the vertex shader
                                     
            // v1.w = 1.0 - (v1.x + v1.y + v1.z)
                DWORD       indices; // Referenced as v2.xyzw in the vertex shader 
                D3DXVECTOR3 n;       // Referenced as v3 in the vertex shader
                FLOAT       tu, tv;  // Referenced as v7 in the vertex shader
            };

             

            posted on 2009-09-05 01:58 七星重劍 閱讀(2668) 評論(0)  編輯 收藏 引用 所屬分類: Game Graphics
            91精品国产色综合久久| 狠狠色婷婷久久综合频道日韩| 久久国产欧美日韩精品免费| 亚洲人成网站999久久久综合| 99久久国产主播综合精品| 久久99精品国产麻豆蜜芽| 久久丝袜精品中文字幕| 久久国产精品77777| 狠狠人妻久久久久久综合蜜桃 | 久久久久久毛片免费看| 久久天天躁狠狠躁夜夜躁2014| 国内精品久久久久影院优| 久久综合九色综合欧美就去吻 | 日本精品一区二区久久久| 亚洲国产精品无码久久一线 | 免费一级做a爰片久久毛片潮| 久久九九久精品国产免费直播| 亚洲国产成人久久精品动漫| 国产亚洲精品久久久久秋霞| 国产精品99久久久久久宅男 | 一级a性色生活片久久无少妇一级婬片免费放 | 久久久国产乱子伦精品作者| 天天做夜夜做久久做狠狠| 精品乱码久久久久久久| 亚洲欧美国产精品专区久久| 精品综合久久久久久97超人| 亚洲精品无码久久久久| 少妇熟女久久综合网色欲| 欧美日韩精品久久久久| 天天久久狠狠色综合| 国产美女久久精品香蕉69| 伊人久久综合精品无码AV专区| 天天综合久久一二三区| 久久亚洲天堂| 久久亚洲精品无码播放| 久久精品国产亚洲Aⅴ香蕉| 国产精品久久久久一区二区三区| 久久青青草原国产精品免费| 久久青青草原综合伊人| 久久伊人精品青青草原高清| 国产精品美女久久久久av爽|