📄 顶点格式.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0045)http://www.gesoftfactory.com/developer/VF.htm -->
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word"><HEAD><TITLE>顶点格式</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content=Word.Document name=ProgId>
<META content="MSHTML 6.00.2900.3314" name=GENERATOR>
<META content="Microsoft Word 10" name=Originator><LINK
href="VF_files/filelist.xml" rel=File-List><LINK href="VF_files/editdata.mso"
rel=Edit-Time-Data><!--[if !mso]>
<STYLE>v\:* {
BEHAVIOR: url(#default#VML)
}
o\:* {
BEHAVIOR: url(#default#VML)
}
w\:* {
BEHAVIOR: url(#default#VML)
}
.shape {
BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]--><!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author>SGuy</o:Author>
<o:LastAuthor>SGuy</o:LastAuthor>
<o:Revision>1</o:Revision>
<o:TotalTime>2</o:TotalTime>
<o:Created>2003-06-01T14:22:00Z</o:Created>
<o:LastSaved>2003-06-01T14:24:00Z</o:LastSaved>
<o:Pages>1</o:Pages>
<o:Words>322</o:Words>
<o:Characters>1838</o:Characters>
<o:Company>G.E.Studio</o:Company>
<o:Lines>15</o:Lines>
<o:Paragraphs>4</o:Paragraphs>
<o:CharactersWithSpaces>2156</o:CharactersWithSpaces>
<o:Version>10.2625</o:Version>
</o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:SpellingState>Clean</w:SpellingState>
<w:GrammarState>Clean</w:GrammarState>
<w:PunctuationKerning/>
<w:DrawingGridVerticalSpacing>7.8 pt</w:DrawingGridVerticalSpacing>
<w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
<w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
<w:Compatibility>
<w:SpaceForUL/>
<w:BalanceSingleByteDoubleByteWidth/>
<w:DoNotLeaveBackslashAlone/>
<w:ULTrailSpace/>
<w:DoNotExpandShiftReturn/>
<w:AdjustLineHeightInTable/>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:UseFELayout/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->
<STYLE>@font-face {
font-family: 宋体;
}
@font-face {
font-family: @宋体;
}
@page {mso-page-border-surround-header: no; mso-page-border-surround-footer: no; }
@page Section1 {size: 595.3pt 841.9pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin: 36.0pt; mso-footer-margin: 36.0pt; mso-paper-source: 0; layout-grid: 15.6pt; }
P.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; mso-fareast-language: EN-US; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font-family: 宋体
}
LI.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; mso-fareast-language: EN-US; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font-family: 宋体
}
DIV.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; mso-fareast-language: EN-US; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font-family: 宋体
}
SPAN.SpellE {
mso-style-name: ""; mso-spl-e: yes
}
SPAN.GramE {
mso-style-name: ""; mso-gram-e: yes
}
DIV.Section1 {
page: Section1
}
</STYLE>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";}
</style>
<![endif]--></HEAD>
<BODY lang=ZH-CN style="TEXT-JUSTIFY-TRIM: punctuation; tab-interval: 21.0pt">
<DIV class=Section1 style="LAYOUT-GRID: 15.6pt none">
<P class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-outline-level: 1"><A
name=顶点格式><B><SPAN
style="FONT-SIZE: 24pt; FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-font-kerning: 18.0pt; mso-fareast-language: ZH-CN">顶点格式<SPAN
lang=EN-US><o:p></o:p></SPAN></SPAN></B></A></P><SPAN
style="mso-bookmark: 顶点格式"></SPAN>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><SPAN lang=EN-US
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">
<HR align=center width="100%" SIZE=1>
</SPAN></DIV>
<P class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">弹性顶点格式(<SPAN
lang=EN-US>FVF)码描述了交叉存储在单个数据流中顶点的内容。它通常说明了要被固定功能顶点处理流水线处理的数据。<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN lang=EN-US
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">Microsoft®
Direct3D®应用程序能以几种不同的方式定义建模的顶点。对弹性顶点定义(也叫弹性顶点格式或弹性顶点格式码)的支持使用应用程序只使用必需的顶点成员成为可能,这样就消除了无用的成员。通过只使用必需的顶点成员,应用程序可以节省内存并最小化渲染建模需要的处理带宽。应用程序通过使用<U>D3DFVF</U>的组合来定义顶点格式。<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN lang=EN-US
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">FVF规范包含了点的大小的格式,由D3DFVF_PSIZE指定。对非TL顶点而言,这个大小表示的是摄像机空间中的单位,对TL顶点而言,则是设备空间中的单位。<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><U><SPAN
lang=EN-US
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">IDirect3DDevice9</SPAN></U><SPAN
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">接口给<SPAN
lang=EN-US>C++应用程序提供了一些方法,可以接收这些标志的组合,并使用它们决定如何渲染图元。基本上,这些标志告诉系统应用程序使用哪些顶点成员——位置,顶点混合加权值,法向,颜色,纹理坐标的数量和格式——并且间接地说明要使用渲染流水线中的哪些部分。另外,某个特定顶点格式标志的存在与否会通知系统哪些顶点成员域存在于内存中,而哪些被省略了。<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">要测定设备的限制,可以查询设备是否具有<SPAN
lang=EN-US>D3DFVFCAPS_DONOTSTRIPLELEMENTS和D3DVFVCAPS_TEXCOORDCOUNTMASK弹性顶点格式标志。更多信息,请参阅<U>D3DCAPS9</U>结构的<SPAN
class=SpellE><B
style="mso-bidi-font-weight: normal">FVFCaps</B></SPAN>成员<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">系统对如何安排顶点有一个重要规定,那就是数据出现的顺序。下图描绘了所有可能的顶点成员在内存中规定的顺序,以及它们相应的数据类型。<SPAN
lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN lang=EN-US
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN"><!--[if gte vml 1]><v:shapetype
id=_x0000_t75 coordsize = "21600,21600" o:preferrelative = "t" o:spt = "75"
filled = "f" stroked = "f" path = " m@4@5 l@4@11@9@11@9@5 xe"><v:stroke
joinstyle = "miter"></v:stroke><v:formulas><v:f eqn =
"if lineDrawn pixelLineWidth 0 "></v:f><v:f eqn = "sum @0 1 0 "></v:f><v:f eqn =
"sum 0 0 @1 "></v:f><v:f eqn = "prod @2 1 2 "></v:f><v:f eqn =
"prod @3 21600 pixelWidth "></v:f><v:f eqn =
"prod @3 21600 pixelHeight "></v:f><v:f eqn = "sum @0 0 1 "></v:f><v:f eqn =
"prod @6 1 2 "></v:f><v:f eqn = "prod @7 21600 pixelWidth "></v:f><v:f eqn =
"sum @8 21600 0 "></v:f><v:f eqn = "prod @7 21600 pixelHeight "></v:f><v:f eqn =
"sum @10 21600 0 "></v:f></v:formulas><v:path o:extrusionok = "f"
gradientshapeok = "t" o:connecttype = "rect"></v:path><o:lock aspectratio="t"
v:ext="edit"></o:lock></v:shapetype><v:shape id=_x0000_i1027
style="WIDTH: 362.25pt; HEIGHT: 312.75pt" type = "#_x0000_t75" coordsize =
"21600,21600"><v:imagedata o:title="fvfmem" src =
"VF_files/image001.gif"></v:imagedata></v:shape><![endif]--><![if !vml]><img width=483 height=417
src="VF_files/image001.gif" v:shapes="_x0000_i1027"><![endif]><o:p></o:p></SPAN></P>
<P class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">纹理坐标可以被声明为不同的格式,这使纹理可以用最少一个坐标或最多四个坐标(二维投影纹理坐标)进行寻址。更多信息,请参阅<U>纹理坐标格式</U>。应该用<U><SPAN
lang=EN-US>D3DFVF_TEXCOORDSIZEn</SPAN></U>系列宏创建应用程序使用的顶点格式中的纹理坐标格式。<SPAN
lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">没有哪个应用程序会使用每个成员——齐次坐标<SPAN
lang=EN-US>W的倒数(RHW)和顶点法向这两个域是互斥的。大多数应用程序也不会使用所有八组纹理坐标,但Direct3D具有这种能力。对于应用程序如何使用标志有一些限制。例如,不能同时使用D3DFVF_XYZ和D3DFVF_XYZRHW标志,同时使用意味着应用程序描述的是一个既未经变换又经过变换的顶点位置。<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">要使用索引顶点混合,<SPAN
lang=EN-US>D3DFVF_LASTBETA_UBYTE4标志应该出现在FVF的最后。这个标志的出现表示第五个混合加权值将被解释为<B
style="mso-bidi-font-weight: normal">DWORD</B>类型而非浮点数。更多信息,请参阅<U>索引顶点混合</U>。<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">以下示例代码显示了使用和不使用<SPAN
lang=EN-US>D3DFVF_LASTBETA_UBYTE4标志的FVF码之间的区别。下面定义的FVF码没有使用D3DFVF_LASTBETA_UBYTE4标志。当使用四个混合索引值时,会用到D3DFVF_XYZB3标志,这是因为应用程序使用的第四个值总是等于(1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -