﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>博客园-Antsam</title><link>http://www.cnblogs.com/Antsam/</link><description /><language>zh-cn</language><lastBuildDate>Sun, 06 Jul 2008 22:42:24 GMT</lastBuildDate><pubDate>Sun, 06 Jul 2008 22:42:24 GMT</pubDate><ttl>60</ttl><item><title>Occlusion System</title><link>http://www.cnblogs.com/Antsam/archive/2005/03/15/119002.html</link><dc:creator>Antsam</dc:creator><author>Antsam</author><pubDate>Tue, 15 Mar 2005 04:21:00 GMT</pubDate><guid>http://www.cnblogs.com/Antsam/archive/2005/03/15/119002.html</guid><wfw:comment>http://www.cnblogs.com/Antsam/comments/119002.html</wfw:comment><comments>http://www.cnblogs.com/Antsam/archive/2005/03/15/119002.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.cnblogs.com/Antsam/comments/commentRss/119002.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/Antsam/services/trackbacks/119002.html</trackback:ping><description><![CDATA[Occlusion&#160;Culling&#160;System
<br/>
<br/>Occlusion方面三篇比较经典的文章：
<br/>Hierarchical&#160;Z-Buffer&#160;Visibility
<br/>Visibility&#160;Culling&#160;Using&#160;Hierarchical&#160;Occlusion&#160;Map&#160;
<br/>Lazy&#160;Occlusion&#160;Grid&#160;Culling
<br/>
<br/>dPVS是一个大集成的算法，综合了很多Visibility方面的算法，算是一种把
<br/>Occlusion&#160;Culling达到实用的算法吧。
<br/>
<br/>dPVS中主要使用了Spatial&#160;Database、Portal和Occlusion&#160;System三种算法，
<br/>Occlusion&#160;System方面基本上集成了上面三篇比较经典的文章的算法。随着硬件
<br/>的发展，很多显卡都支持Hierarchical&#160;Z-Buffer&#160;和Occlusion&#160;Query，虽然现
<br/>在可能还没有达到实用，但是也算是一个发展方向吧。
<br/>
<br/>
<br/><img onclick="window.open(&#39;http://images.blogcn.com/2005/3/15/7/antsam,2005031512645.jpg&#39;,&#39;_blank&#39;);" height="170" hspace="2" src="http://images.blogcn.com/2005/3/15/7/antsam,2005031512645.jpg" width="400" onload="if(this.width&gt;screen.width/2)this.width=screen.width/2" vspace="2" border="0" />
<br/>
<br/>
<br/><A href="http://www.cnblogs.com/liker/archive/2005/03/13/118053.html" target="_blank"><font color="#800080">http://www.cnblogs.com/liker/archive/2005/03/13/118053.html</font></a> 
<br/>中提到的问题：
<br/>
<br/>PVS的好处就是数据为静态，渲染的时候不需要计算，但它对动态物体
<br/>的判断不够好，假如有一个需要3pass+perpixel&#160;light渲染的怪物（我
<br/>说的就是doom3。。。）在某leaf中移动，如果用原始的view&#160;frustum做
<br/>culling无法达到真正的剔除。&#160;
<br/>
<br/>HL2中有中解决方法就是用了Occlusion&#160;System来剔除动态的物体。
<br/>
<br/>//-----------------------------------
<br/>//&#160;Occluders&#160;are&#160;simply&#160;polygons
<br/>//-----------------------------------
<br/>//&#160;Flags&#160;field&#160;of&#160;doccluderdata_t
<br/>enum
<br/>{
<br/>OCCLUDER_FLAGS_INACTIVE&#160;=&#160;0x1,
<br/>};
<br/>
<br/>struct&#160;doccluderdata_t
<br/>{
<br/>//&#160;index&#160;into&#160;doccluderpolys
<br/>int flags;
<br/>int firstpoly; 
<br/>int polycount;
<br/>Vector mins;
<br/>Vector maxs;
<br/>};
<br/>
<br/>struct&#160;doccluderpolydata_t
<br/>{
<br/>//&#160;index&#160;into&#160;doccludervertindices
<br/>int firstvertexindex; 
<br/>int vertexcount;
<br/>int planenum;
<br/>};
<br/>
<br/>HL2中Occluder&#160;和Occludee都是定的，Occluder在地图文件的brush中，而
<br/>Occludee则是模型文件，后者的原因主要是PVS计算出来的Cell还是很多，
<br/>而任务模型的顶点数据比较多，那么绘制代价会比较高，所以BSP地图文件
<br/>中有Occluder&#160;Polygon的信息（通过预计算得到），然后把人物模型的的BV
<br/>投影到Space&#160;Coordinate，判断是否被OccluderPolygon遮挡。
<br/>
<br/>[snapshot&#160;from&#160;HL2&#160;SourceCode]
<br/>Prevents&#160;this&#160;occluder&#160;from&#160;being&#160;used&#160;if&#160;it&#160;takes&#160;up&#160;less&#160;than&#160;X%&#160;
<br/>of&#160;the&#160;screen.Prevents&#160;occlusion&#160;testing&#160;for&#160;entities&#160;that&#160;take&#160;up&#160;
<br/>more&#160;than&#160;X%&#160;of&#160;the&#160;screen.
<br/><img src ="http://www.cnblogs.com/Antsam/aggbug/119002.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/37549/" target="_blank">[新闻]阿里巴巴确立未来十年战略规划 修改自身定位</a>]]></description></item><item><title>Open Standards for Real-Time 3D Communication</title><link>http://www.cnblogs.com/Antsam/archive/2005/03/11/117079.html</link><dc:creator>Antsam</dc:creator><author>Antsam</author><pubDate>Fri, 11 Mar 2005 11:33:00 GMT</pubDate><guid>http://www.cnblogs.com/Antsam/archive/2005/03/11/117079.html</guid><wfw:comment>http://www.cnblogs.com/Antsam/comments/117079.html</wfw:comment><comments>http://www.cnblogs.com/Antsam/archive/2005/03/11/117079.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnblogs.com/Antsam/comments/commentRss/117079.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/Antsam/services/trackbacks/117079.html</trackback:ping><description><![CDATA[<br/>
<br/><img onclick="window.open(&#39;http://images.blogcn.com/2005/3/10/11/antsam,20050310211954.gif&#39;,&#39;_blank&#39;);" height="70" hspace="2" src="http://images.blogcn.com/2005/3/10/11/antsam,20050310211954.gif" width="87" onload="if(this.width&gt;screen.width/2)this.width=screen.width/2" vspace="2" border="0" /> 
<br/>
<br/>X3D&#160;is&#160;a&#160;powerful&#160;and&#160;extensible&#160;open&#160;file&#160;format&#160;standard&#160;for&#160;3D&#160;visual&#160;effects,&#160; 
<br/>behavioral&#160;modelling&#160;and&#160;interaction.&#160;It&#160;provides&#160;an&#160;XML-encoded&#160;scene&#160;graph&#160; 
<br/>and&#160;a&#160;language-neutral&#160;Scene&#160;Authoring&#160;Interface&#160;(SAI).&#160;The&#160;XML&#160;encoding&#160;enables&#160; 
<br/>3D&#160;to&#160;be&#160;incorporated&#160;into&#160;web&#160;services&#160;architectures&#160;and&#160;distributed&#160;environments,&#160; 
<br/>and&#160;facilitates&#160;moving&#160;3D&#160;data&#160;between&#160;applications.&#160;The&#160;Scene&#160;Authoring&#160;Interface&#160; 
<br/>allows&#160;real&#160;time&#160;3D&#160;content&#160;and&#160;controls&#160;to&#160;be&#160;easily&#160;integrated&#160;into&#160;a&#160;broad&#160;range&#160; 
<br/>of&#160;web&#160;and&#160;non-web&#160;applications.&#160; 
<br/>
<br/>平时的很多工作都是同X3D打交道，今天算写点想法吧。 
<br/>
<br/>X3D是一套三维交互应用方面的解决方案，而且是一种标准。为什么会 
<br/>出现X3D呢？大家可以看看sourceforge中很多的开源实时3D渲染库，大都 
<br/>又很多文件格式的插件，例如：mdl、md2、md3、BSP等。为什么？数 
<br/>据来源，我们写绘制引擎，没有数据来源，什么都是白搭。但是如果有自 
<br/>己的文件格式，为什么还会需要这么多吗？但是设计一个成熟的文件格式 
<br/>其实非常有难度的，那么X3D帮你做到了，X3D支持三种编码：classic&#160;vrml、 
<br/>xml和二进制编码。第一种主要是为了同就版本兼容，后两种为X3D提供了 
<br/>很多的优势和方便。 
<br/>
<br/>有了数据以后，你可以自己来写绘制引擎，但是怎么来管理这些数据？ 
<br/>X3D给你提供了一套场景管理的构架（scene&#160;graph），其实这里包含了 
<br/>很多中对于不同的场景的管理，比如为地形提供了elevate&#160;grid等。 
<br/>
<br/>你觉得你的程序需要支持脚本。 
<br/>X3D给你提供了一套language&#160;binding的方案和构架。 
<br/>
<br/>那支不支持人物动画（IK）和编辑？ 
<br/>X3D包含了一块Human-Anim的结构，专门解决这个问题。 
<br/>
<br/>那支不支持现在流行的Shader？ 
<br/>X3D现在正在制定这个标准，而且已经除了一部分结果：支持GLSL、CG 
<br/>和HLSL。 
<br/>
<br/>那它什么都做了，我们还需要作什么？ 
<br/>你自己写了绘制，那么怎么把上面X3D提供的东西结合到你的绘制里面 
<br/>去，是你的程序支持上面X3D提供的功能。 
<br/>
<br/>那现在我们该做什么？ 
<br/>我们数据有了，并且能绘制它们，现在我们可以用它来做产品了^_^。 
<br/>
<br/>那还能作甚么？ 
<br/>不管mdl、md2、md3还是X3D提供的文件都是一样的，一到内存，就 
<br/>只有点线面的结构了（当然还有纹理和材质）。那么你想对 
<br/>点线面做什么就能做什么了，可以用来做空间剖分（BSP、QuadTree等）。 
<br/>
<br/>X3D的整个构架非常通用，包含的东西也很广泛，但是根据不同的需要 
<br/>可以进行剪切，X3D制定了六个标准剪切： 
<br/>A&#160;&#160;Core&#160;profile&#160; 
<br/>B&#160;&#160;Interchange&#160;profile&#160; 
<br/>C&#160;&#160;Interactive&#160;profile&#160; 
<br/>D&#160;&#160;MPEG-4&#160;interactive&#160;profile&#160; 
<br/>E&#160;&#160;Immersive&#160;profile&#160; 
<br/>F&#160;&#160;Full&#160;profile&#160; 
<br/>
<br/>X3D本来的目的可能是用于基于Web的多媒体，但是后来很多时候都看作一种 
<br/>多媒体三维交互程序的通用构架和解决方案。 
<br/>
<br/>为什么说构架和解决方案？ 
<br/>因为X3D中定义了类的结构和类之间的相互关系，上面有什么用词不当，请见谅^_^。 
<br/>
<br/><a href="http://www.web3d.org/" target="_blank"><font color="#800080">http://www.web3d.org/</font></a> <img src ="http://www.cnblogs.com/Antsam/aggbug/117079.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/37548/" target="_blank">[新闻]微软高管：Wii用户最终会成为Xbox 360用户</a>]]></description></item><item><title>dPVS - Visibility Optimization</title><link>http://www.cnblogs.com/Antsam/archive/2005/03/11/117077.html</link><dc:creator>Antsam</dc:creator><author>Antsam</author><pubDate>Fri, 11 Mar 2005 11:30:00 GMT</pubDate><guid>http://www.cnblogs.com/Antsam/archive/2005/03/11/117077.html</guid><wfw:comment>http://www.cnblogs.com/Antsam/comments/117077.html</wfw:comment><comments>http://www.cnblogs.com/Antsam/archive/2005/03/11/117077.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/Antsam/comments/commentRss/117077.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/Antsam/services/trackbacks/117077.html</trackback:ping><description><![CDATA[dPVS&#160;is&#160;the&#160;first&#160;efficient&#160;general&#160;purpose&#160;visibility&#160;optimizer&#160; 
<br/>that&#160;requires&#160;no&#160;scene&#160;pre-processing&#160;and&#160;works&#160;with&#160;massive&#160;dynamic&#160; 
<br/>environments&#160;of&#160;any&#160;topological&#160;structure.&#160;The&#160;visibility&#160;queries&#160; 
<br/>are&#160;output-sensitive.&#160;This&#160;means&#160;that&#160;the&#160;amount&#160;of&#160;time&#160;dPVS&#160;spends&#160; 
<br/>in&#160;finding&#160;the&#160;solution&#160;is&#160;dependent&#160;on&#160;the&#160;number&#160;of&#160;visible&#160;objects&#160; 
<br/>rather&#160;than&#160;the&#160;number&#160;of&#160;objects&#160;in&#160;the&#160;scene.&#160; 
<br/>
<br/>
<br/><img onclick="window.open(&#39;http://images.blogcn.com/2005/2/26/9/antsam,2005022616241.jpg&#39;,&#39;_blank&#39;);" height="236" hspace="2" src="http://images.blogcn.com/2005/2/26/9/antsam,2005022616241.jpg" width="317" onload="if(this.width&gt;screen.width/2)this.width=screen.width/2" vspace="2" border="0" />&#160;
<br/>
<br/><a href="http://www.hybrid.fi/main/dpvs/download.php" target="_blank"><font color="#800080">http://www.hybrid.fi/main/dpvs/download.php</font></a> <img src ="http://www.cnblogs.com/Antsam/aggbug/117077.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/37548/" target="_blank">[新闻]微软高管：Wii用户最终会成为Xbox 360用户</a>]]></description></item><item><title>State Transition</title><link>http://www.cnblogs.com/Antsam/archive/2005/01/15/92408.html</link><dc:creator>Antsam</dc:creator><author>Antsam</author><pubDate>Sat, 15 Jan 2005 09:52:00 GMT</pubDate><guid>http://www.cnblogs.com/Antsam/archive/2005/01/15/92408.html</guid><wfw:comment>http://www.cnblogs.com/Antsam/comments/92408.html</wfw:comment><comments>http://www.cnblogs.com/Antsam/archive/2005/01/15/92408.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/Antsam/comments/commentRss/92408.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/Antsam/services/trackbacks/92408.html</trackback:ping><description><![CDATA[<p>State Transition 
<br/>
</p>
<p>
<br/>Why we must use State Transition? 
<br/>(From OpenSceneGraph) 
<br/>Without state sorting, the the buses and GPU will 
<br/>thrash between states, stalling the graphics 
<br/>pipeline and destroying graphics throughput. As 
<br/>GPU&#39;s get faster and faster, the cost of stalling 
<br/>the graphics pipeline is also going up, so scene 
<br/>graphs are becoming ever more important. 
</p>
<p>
<br/>Ogre 
<br/>Ogre通过Render Queue来实现state transition，ogre中 
<br/>定义的Material类包含了渲染管道的状态（包括纹理等）， 
<br/>然后把用到相同Material的Renderable Object组织在一起。 
</p>
<p>这样渲染的时候减小了一些渲染状态的转化。 
<br/>
</p>
<p>
<br/>OpenSceneGraph 
<br/>OpenSceneGraph中定义了一个StateSet类，用来包含渲染管道 
<br/>的状态信息。OpenSceneGraph的设计思想是把渲染的物体和对 
<br/>渲染物体的操作分开，或者说把场景树和对场景书的操作分开 
<br/>（注意这里不仅是渲染的操作，可能是cull的操作，更新操作 
<br/>等等）。 
</p>
<p>然后在里边的过程中生成一棵State Set Tree: 
<br/><img height="360" src="http://www.cnblogs.com/images/cnblogs_com/antsam/State%20Transition.jpg" width="500" />
</p>
<p>通过收集把有相同渲染状态的物体一起渲染。 
<br/>当然在两个材质之间的转化也只会重新设置不同的状态。 
<br/>
</p>
<p>
<br/>HL2 
<br/>Half life 2则是采用TransitionTable的方式来实现，HL2也是 
<br/>通过Material来包含渲染状态的，如果有n个需渲染的物体，通 
<br/>过计算一张TransitionTable，把各个物体之间的状态转化计算 
<br/>出来。然后渲染的时候通过两个索引来产生转化的操作。这个 
<br/>优化也是比较底层的，没有设计到如何安排材质之间的渲染顺序。 
</p>
<p>不过必须注意的是：State Transition的优化效果是有限的， 
<br/>最好的优化应该在算法本身上。 
</p><img src ="http://www.cnblogs.com/Antsam/aggbug/92408.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/37547/" target="_blank">[新闻]遵守YouTube案裁定 谷歌将陷入隐私指控深渊</a>]]></description></item><item><title>Particle System</title><link>http://www.cnblogs.com/Antsam/archive/2004/12/29/83769.html</link><dc:creator>Antsam</dc:creator><author>Antsam</author><pubDate>Wed, 29 Dec 2004 07:43:00 GMT</pubDate><guid>http://www.cnblogs.com/Antsam/archive/2004/12/29/83769.html</guid><wfw:comment>http://www.cnblogs.com/Antsam/comments/83769.html</wfw:comment><comments>http://www.cnblogs.com/Antsam/archive/2004/12/29/83769.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/Antsam/comments/commentRss/83769.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/Antsam/services/trackbacks/83769.html</trackback:ping><description><![CDATA[Particle&#160;System
<br/>
<br/>关于粒子系统比较权威的文章，现在的粒子系统差不多都参考了这片文章吧。
<br/>Particle&#160;System&#160;A&#160;Technique&#160;for&#160;Modeling&#160;a&#160;Class&#160;of&#160;Fuzzy&#160;Objects
<br/>
<br/>其他一些文章：
<br/>Particle&#160;Animation&#160;and&#160;Rendering&#160;Using&#160;Data&#160;Parallel&#160;Computation
<br/>The&#160;design&#160;of&#160;the&#160;Particle&#160;System&#160;API
<br/>Building&#160;an&#160;Advanced&#160;Particle&#160;System
<br/>Physical&#160;based&#160;modeling<img src ="http://www.cnblogs.com/Antsam/aggbug/83769.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/37546/" target="_blank">[新闻]iPhone入华在即 中国手机产业生存面临考验</a>]]></description></item><item><title>Materail 脚本的设计（JavaScript 3）</title><link>http://www.cnblogs.com/Antsam/archive/2004/12/29/83767.html</link><dc:creator>Antsam</dc:creator><author>Antsam</author><pubDate>Wed, 29 Dec 2004 07:38:00 GMT</pubDate><guid>http://www.cnblogs.com/Antsam/archive/2004/12/29/83767.html</guid><wfw:comment>http://www.cnblogs.com/Antsam/comments/83767.html</wfw:comment><comments>http://www.cnblogs.com/Antsam/archive/2004/12/29/83767.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/Antsam/comments/commentRss/83767.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/Antsam/services/trackbacks/83767.html</trackback:ping><description><![CDATA[[img]<a href="http://www.blogcn.com/User12/antsam/Upload/20041217142710.jpg">http://www.blogcn.com/User12/antsam/Upload/20041217142710.jpg</a> [/img] 
<br/>
<br/>这是一幅关于JavaScript中四个重要组成的关系： 
<br/>Runtime、Script、Context和Object 
<br/>
<br/>其中有一点必须注意的是：object可以在不同的context之间共享。 
<br/>在使用JS的过程中你肯定会想到，怎么样在一个JS文件中调用另外 
<br/>一个JS文件中定义的函数或变量？ 
<br/>
<br/>这个旧需要通过共享一个Object来实现，context使之脚本执行的 
<br/>堆栈空间（fixed&#160;me），那本脚本中定义的变量（全局）和函数的 
<br/>信息则是保存在一个Gloabal&#160;Object中的，这样我们只要把两个脚 
<br/>本共享一个Object，就可以实现上面的问题了。 
<br/>
<br/>例如： 
<br/>test.js: 
<br/>
<br/>var&#160;m&#160;=&#160;0; 
<br/>function&#160;addValues1(a,b) 
<br/>{ 
<br/>&#160;&#160;&#160;result&#160;=&#160;a&#160;+&#160;b&#160;+&#160;m+n; 
<br/>&#160;&#160;&#160;m&#160;=&#160;m&#160;+&#160;10; 
<br/>&#160;&#160;&#160;return&#160;result; 
<br/>} 
<br/>
<br/>test2.js: 
<br/>var&#160;n&#160;=100; 
<br/>function&#160;addValues2(a,b) 
<br/>{ 
<br/>&#160;&#160;&#160;result&#160;=&#160;a&#160;+&#160;b&#160;+&#160;n; 
<br/>&#160;&#160;&#160;n&#160;=&#160;n&#160;+&#160;10; 
<br/>
<br/>&#160;&#160;&#160;result&#160;+=&#160;addValues1(a,b); 
<br/>&#160;&#160;&#160;return&#160;result; 
<br/>} 
<br/>代码中： 
<br/>&#8230;&#8230; 
<br/>jsp1&#160;=&#160;JS_CompileFile(ct1,&#160;globalObj,&#160;&quot;test.js&quot;<img onclick="window.open(&#39;/images/wink.gif&#39;,&#39;_blank&#39;);" height="15" hspace="2" src="http://www.blogcn.com/images/wink.gif" width="15" onload="if(this.width&gt;screen.width/2)this.width=screen.width/2" vspace="2" border="0" />; 
<br/>JS_ExecuteScript(ct1,&#160;globalObj,&#160;jsp1,&#160;&amp;rval);&#160; 
<br/>jsp2&#160;=&#160;JS_CompileFile(ct2,&#160;globalObj,&#160;&quot;test2.js&quot;<img onclick="window.open(&#39;/images/wink.gif&#39;,&#39;_blank&#39;);" height="15" hspace="2" src="http://www.blogcn.com/images/wink.gif" width="15" onload="if(this.width&gt;screen.width/2)this.width=screen.width/2" vspace="2" border="0" />; 
<br/>JS_ExecuteScript(ct2,&#160;globalObj,&#160;jsp2,&#160;&amp;rval);&#160; 
<br/>&#8230;&#8230; 
<br/>JS_CallFunctionName(ct1,&#160;globalObj,&#160;&quot;addValues1&quot;,&#160;2,&#160;args,&#160;&amp;rval); 
<br/>&#8230;&#8230; 
<br/>JS_CallFunctionName(ct2,&#160;globalObj,&#160;&quot;addValues2&quot;,&#160;2,&#160;args,&#160;&amp;rval); 
<br/>
<br/>利用这个特性我们可以定义我们脚本的语法： 
<br/>在sytax.js文件中我们定义一些接口(DOM)： 
<br/>BeginMaterial()、EndMaterial() 
<br/>BeginPass()、EndPass() 
<br/>
<br/>然后既可以写Material的脚本并执行了： 
<br/>BeginMaterial() 
<br/>{ 
<br/>&#160;&#160;&#160;&#160;BeginPass() 
<br/>&#160;&#160;&#160;&#160;{ 
<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#8230;&#8230; 
<br/>&#160;&#160;&#160;&#160;} 
<br/>&#160;&#160;&#160;&#160;EndPass() 
<br/>
<br/>&#160;&#160;&#160;&#160;BeginPass() 
<br/>&#160;&#160;&#160;&#160;{ 
<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#8230;&#8230; 
<br/>&#160;&#160;&#160;&#160;} 
<br/>&#160;&#160;&#160;&#160;EndPass() 
<br/>} 
<br/>EndMaterial() 
<br/><img src ="http://www.cnblogs.com/Antsam/aggbug/83767.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/37546/" target="_blank">[新闻]iPhone入华在即 中国手机产业生存面临考验</a>]]></description></item><item><title>引擎设计杂谈</title><link>http://www.cnblogs.com/Antsam/archive/2004/12/29/83765.html</link><dc:creator>Antsam</dc:creator><author>Antsam</author><pubDate>Wed, 29 Dec 2004 07:37:00 GMT</pubDate><guid>http://www.cnblogs.com/Antsam/archive/2004/12/29/83765.html</guid><wfw:comment>http://www.cnblogs.com/Antsam/comments/83765.html</wfw:comment><comments>http://www.cnblogs.com/Antsam/archive/2004/12/29/83765.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/Antsam/comments/commentRss/83765.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/Antsam/services/trackbacks/83765.html</trackback:ping><description><![CDATA[引擎设计杂谈 
<br/>
<br/>好久没有去碰Ogre了，最近别人推荐了一个网站: 
<br/><img height="15" alt="::URL::" hspace="2" src="http://www.blogcn.com/images/aurl.gif" width="15" align="absBottom" border="0" /><a href="http://gd.91.com/zt/ogre/" target="_blank"><font color="#800080">http://gd.91.com/zt/ogre/</font></a> 
<br/>
<br/>前段时间又分析了OpenSceneGraph的结构，对于模块的划分已经很清楚，但是对 
<br/>于这些模块间的交互还是需要时间搞清楚。 
<br/>
<br/>在你自己去写一个引擎的时候是否需要去用几个引擎？因为有很多东西在你没有 
<br/>去用之前时没办法搞清楚的，或者在单纯的分析代码过程中时没有办法搞清楚的。 
<br/>在用的过程中你才会去想用起来方不方便？才会知道为什么要这样去设计一个 
<br/>模块等等。 
<br/>
<br/>对于场景树中物体的动态更新问题，Ogre和OpenScene&#160;Graph采用的方法是不同的， 
<br/>Ogre采用的是Listener和Target的方式，Listener又分好几种，每帧必须更新的是 
<br/>Framelistener，其他的则是只有在触发的时候才会调用，所以像例子系统啊， 
<br/>EventProcessor等都是直接继承了Framelistener，每帧都会通过frameStarted进行 
<br/>必要的更新，所以如果用户定义的有些信息必须每帧更新，则需要继承Framelistener 
<br/>类，更新的过程在framestart或frameend实现。 
<br/>
<br/>而OpenSceneGraph则采用的是遍历场景树，然后调用场景树中的Travers函数，而在 
<br/>Travers中会调用一些更新函数。OpenSceneGraph有些东西还是值得借鉴的，下次找 
<br/>几个地方写点文章吧。 
<br/>
<br/>这两者的实现方式各有利弊吧，这段时间的任务还需要搞清楚几个问题： 
<br/>
<br/>1、场景的动态更新方式 
<br/>2、Collision如何结合到Engine 
<br/>3、Physic&#160;Lib如何结合到Engine中去 
<br/>4、Shadow&#160;manger管理receive和caster的方法，以及 
<br/>&#160;&#160;&#160;阴影不同的实现方式的切换。 
<br/>
<br/>在具体实现代码前，再去全面分析一个Torque&#160;Engine吧，其他的到时候看看相应 
<br/>的代码也就可以了。 
<br/>
<br/><img height="15" alt="::URL::" hspace="2" src="http://www.blogcn.com/images/aurl.gif" width="15" align="absBottom" border="0" /><a href="http://www.sourceforge.net/" target="_blank"><font color="#0000ff">http://www.Sourceforge.net</font></a> 
<br/>可以经常去看看。 
<br/>
<br/>再推荐一个网站,摘自<img height="15" alt="::URL::" hspace="2" src="http://www.blogcn.com/images/aurl.gif" width="15" align="absBottom" border="0" /><a href="http://blender.blogone.net/" target="_blank"><font color="#0000ff">http://blender.blogone.net</font></a> 
<br/><img height="15" alt="::URL::" hspace="2" src="http://www.blogcn.com/images/aurl.gif" width="15" align="absBottom" border="0" /><a href="http://scholar.google.com/" target="_blank"><font color="#800080">http://scholar.google.com/</font></a> 
<br/>上去看看就知道干嘛的了。 
<br/><img src ="http://www.cnblogs.com/Antsam/aggbug/83765.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/37546/" target="_blank">[新闻]iPhone入华在即 中国手机产业生存面临考验</a>]]></description></item></channel></rss>