⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fixed function pipeline.htm

📁 此文件是微软MSDN中d3d部分资料的翻译文件
💻 HTM
📖 第 1 页 / 共 4 页
字号:
  style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN"><o:p></o:p></SPAN> 

  <LI class=MsoNormal 
  style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; tab-stops: list 36.0pt; mso-list: l1 level1 lfo1"><U><SPAN 
  style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">视区和裁剪</SPAN></U><SPAN 
  lang=EN-US 
  style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN"><o:p></o:p></SPAN> 

  <LI class=MsoNormal 
  style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; tab-stops: list 36.0pt; mso-list: l1 level1 lfo1"><U><SPAN 
  style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">光照和材质</SPAN></U><SPAN 
  lang=EN-US 
  style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN"><o:p></o:p></SPAN> 

  <LI class=MsoNormal 
  style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; tab-stops: list 36.0pt; mso-list: l1 level1 lfo1"><U><SPAN 
  style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">纹理</SPAN></U><SPAN 
  lang=EN-US 
  style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN"><o:p></o:p></SPAN> 
  </LI></UL>
<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; 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 lang=EN-US 
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">Microsoft&reg; 
Direct3D&reg;中把几何体送经固定功能几何流水线进行处理的那部分是变换引擎。它取得三维模型和观察者在世界空间中的位置,把顶点投影到屏幕上,并根据视区对顶点进行裁剪。变换引擎也对每个顶点执行光照计算,得到漫反射色和镜面反射色。<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">几何流水线接收顶点作为输入。变换引擎将三个变换——世界、观察和投影变换——应用于顶点,对结果进行裁剪,将所有数据传递给光栅化器。下图描绘了这些步骤的顺序。<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_i1037 
style="WIDTH: 414.75pt; HEIGHT: 196.5pt" type = "#_x0000_t75" coordsize = 
"21600,21600"><v:imagedata o:title="pipeline" src = 
"VnPP_files/image001.gif"></v:imagedata></v:shape><![endif]--><![if !vml]><img border=0 width=553 height=262
src="VnPP_files/image001.gif" v:shapes="_x0000_i1037"><![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">在流水线的开始处,没有进行任何变换,因此所有建模的顶点是相对于局部坐标系——这是一个局部原点和方向——声明的。这个坐标系通常被称为建模空间,单个的坐标被称为建模坐标。<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><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 
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">下一步是投影变换。在流水线的这一部分,为了营造场景的立体感,通常要根据物体与观察者之间的距离对它们进行缩放,使得近的物体显得比远处的物体大一些,等等。为了简单,本文档将经过变换的顶点所在的空间称为投影空间。一些图形学书籍可能将投影空间称为后透视齐次空间(<SPAN 
lang=EN-US>post-perspective homogeneous 
space)。并不是所有的投影变换都会对场景中物体的大小进行缩放,这样的投影有时被称为仿射或正交投影。<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>
<UL type=disc>
  <LI class=MsoNormal 
  style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; tab-stops: list 36.0pt; mso-list: l2 level1 lfo2"><U><SPAN 
  lang=EN-US 
  style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN"><A 
  href="http://www.gesoftfactory.com/developer/VnPP.htm#传统FVF格式">传统FVF格式</A></SPAN></U><SPAN 
  lang=EN-US 
  style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN"><o:p></o:p></SPAN> 
  </LI></UL>
<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; mso-outline-level: 1"><A 
name=传统FVF格式><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>FVF格式</SPAN></SPAN></B></A><B><SPAN lang=EN-US 
style="FONT-SIZE: 24pt; FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-font-kerning: 18.0pt; mso-fareast-language: ZH-CN"><o:p></o:p></SPAN></B></P>
<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)的格式,应该在调用<U>IDirect3DDevice9::SetFVF</U>方法时用一个FVF码作为参数,如以下示例代码所示。<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal 
style="tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN 
lang=EN-US 
style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">g_d3dDevice-&gt;SetFVF( 
CUSTOM_FVF );<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">以下主题涵盖了传统<SPAN 
lang=EN-US>FVF格式的类型。<o:p></o:p></SPAN></SPAN></P>
<UL type=disc>
  <LI class=MsoNormal 
  style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; tab-stops: list 36.0pt; mso-list: l0 level1 lfo3"><U><SPAN 
  lang=EN-US 
  style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN"><A 
  href="http://www.gesoftfactory.com/developer/VnPP.htm#Vertex传统类型">Vertex传统类型</A></SPAN></U><SPAN 
  lang=EN-US 
  style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN"><o:p></o:p></SPAN> 

  <LI class=MsoNormal 
  style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; tab-stops: list 36.0pt; mso-list: l0 level1 lfo3"><U><SPAN 
  lang=EN-US 
  style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN"><A 
  href="http://www.gesoftfactory.com/developer/VnPP.htm#LVertex传统类型">LVertex传统类型</A></SPAN></U><SPAN 
  lang=EN-US 
  style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN"><o:p></o:p></SPAN> 

  <LI class=MsoNormal 
  style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; tab-stops: list 36.0pt; mso-list: l0 level1 lfo3"><U><SPAN 
  lang=EN-US 
  style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN"><A 
  href="http://www.gesoftfactory.com/developer/VnPP.htm#TLVertex传统类型">TLVertex传统类型</A></SPAN></U><SPAN 
  lang=EN-US 
  style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN"><o:p></o:p></SPAN> 
  </LI></UL>
<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; mso-outline-level: 1"><A 
name=Vertex传统类型><B><SPAN lang=EN-US 
style="FONT-SIZE: 24pt; FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-font-kerning: 18.0pt; mso-fareast-language: ZH-CN">Vertex传统类型</SPAN></B></A><B><SPAN 
lang=EN-US 
style="FONT-SIZE: 24pt; FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-font-kerning: 18.0pt; mso-fareast-language: ZH-CN"><o:p></o:p></SPAN></B></P>
<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><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>FVF码,如以下示例代码所示。<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -