﻿<?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>博客园-SigEric' Blog</title><link>http://www.cnblogs.com/eric720/</link><description>Dig into the 3D world to build up a Magi Engine</description><language>zh-cn</language><lastBuildDate>Tue, 14 Oct 2008 00:42:49 GMT</lastBuildDate><pubDate>Tue, 14 Oct 2008 00:42:49 GMT</pubDate><ttl>60</ttl><item><title>Create objects inside DLL and delete outside will crash?!</title><link>http://www.cnblogs.com/eric720/archive/2008/09/18/1293437.html</link><dc:creator>SigEric</dc:creator><author>SigEric</author><pubDate>Thu, 18 Sep 2008 08:17:00 GMT</pubDate><guid>http://www.cnblogs.com/eric720/archive/2008/09/18/1293437.html</guid><wfw:comment>http://www.cnblogs.com/eric720/comments/1293437.html</wfw:comment><comments>http://www.cnblogs.com/eric720/archive/2008/09/18/1293437.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/eric720/comments/commentRss/1293437.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/eric720/services/trackbacks/1293437.html</trackback:ping><description><![CDATA[<p>Sometimes, when we try to delete some objects which are created inside a dll, and the deletion will cause an access violation.</p>
<p>Yep, but just sometimes.</p>
<p>I tried and tested the idea with my colleages this afternoon. And we found out that</p>
<p>The key to this problem is the Runtime library to compile with the dll and your caller application. If they use different Runtime library, you will have problem in clearing the memory outside the dll.</p>
<p>So, for the sake of safe coding, we should handling all the creation and deletion inside the dll.</p>
<p><img style="width: 480px; height: 332px" height="332" alt="" src="http://www.cnblogs.com/images/cnblogs_com/eric720/Runtimelibrary.png" width="480" border="0" /></p>
<img src ="http://www.cnblogs.com/eric720/aggbug/1293437.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42977/" target="_blank">[新闻]微软首次打破先例 Windows 7不再改名</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>Presentation of XNA</title><link>http://www.cnblogs.com/eric720/archive/2008/08/31/1280450.html</link><dc:creator>SigEric</dc:creator><author>SigEric</author><pubDate>Sun, 31 Aug 2008 01:17:00 GMT</pubDate><guid>http://www.cnblogs.com/eric720/archive/2008/08/31/1280450.html</guid><wfw:comment>http://www.cnblogs.com/eric720/comments/1280450.html</wfw:comment><comments>http://www.cnblogs.com/eric720/archive/2008/08/31/1280450.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/eric720/comments/commentRss/1280450.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/eric720/services/trackbacks/1280450.html</trackback:ping><description><![CDATA[I made a presentation of XNA this friday, which I felt ok. So, here is the presentation <a title="slides" href="http://files.cnblogs.com/eric720/Presentation.pdf">slides</a>
<img src ="http://www.cnblogs.com/eric720/aggbug/1280450.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42976/" target="_blank">[新闻]亚马逊EC2云计算计划支持Windows操作系统</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>Shader Engine</title><link>http://www.cnblogs.com/eric720/archive/2008/08/05/1261261.html</link><dc:creator>SigEric</dc:creator><author>SigEric</author><pubDate>Tue, 05 Aug 2008 09:38:00 GMT</pubDate><guid>http://www.cnblogs.com/eric720/archive/2008/08/05/1261261.html</guid><wfw:comment>http://www.cnblogs.com/eric720/comments/1261261.html</wfw:comment><comments>http://www.cnblogs.com/eric720/archive/2008/08/05/1261261.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnblogs.com/eric720/comments/commentRss/1261261.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/eric720/services/trackbacks/1261261.html</trackback:ping><description><![CDATA[<p>Okay, okay, I update my blog finally. It is because my production's development stage is closed last week<img alt="" src="http://www.cnblogs.com/Emoticons/tusiji/202939796.gif" /></p>
<p>&nbsp;</p>
<p>And I spent two days on my Shader Engine developement and finally there is something to show!</p>
<p>&nbsp;</p>
<p>I promise I will explain the details later but first I will brief you the basic idea behide this engine.</p>
<p>&nbsp;</p>
<p>The most significant difference between this shader engine and the others is mine does not reqirement any naming convention, not one single line of code to set parameter for shader. The work flow is make your model in max/maya/xsi (assign some shaders in your material (also support sub-material in max), export them to FBX. Load them in the engine. And that's it! Simple and Stupid.</p>
<p>&nbsp;</p>
<p>Here is the screenshot</p>
<p>&nbsp;</p>
<p><img height="375" alt="" src="http://www.cnblogs.com/images/cnblogs_com/eric720/MultiShaderSupport.png" width="500" border="0" /></p>
<p>&nbsp;</p>
<p>Like I said, I will explain the whole damn thing later after adding some&nbsp;comments, modifying the CodeSmith templates, etc.<img alt="" src="http://www.cnblogs.com/Emoticons/yoyocici/224024437.gif" /></p>
<img src ="http://www.cnblogs.com/eric720/aggbug/1261261.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42975/" target="_blank">[新闻]鲍尔默失望变希望 幸亏当初未收购雅虎</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>Octree sample code for XNA</title><link>http://www.cnblogs.com/eric720/archive/2008/06/11/1217633.html</link><dc:creator>SigEric</dc:creator><author>SigEric</author><pubDate>Wed, 11 Jun 2008 14:44:00 GMT</pubDate><guid>http://www.cnblogs.com/eric720/archive/2008/06/11/1217633.html</guid><wfw:comment>http://www.cnblogs.com/eric720/comments/1217633.html</wfw:comment><comments>http://www.cnblogs.com/eric720/archive/2008/06/11/1217633.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.cnblogs.com/eric720/comments/commentRss/1217633.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/eric720/services/trackbacks/1217633.html</trackback:ping><description><![CDATA[摘要: In 3D world, many enthusiastic specialists and PhD are giving their life-time effort to rendering photorealistic objects like milk, skin, water, feather, shadow, etc. No doubt that it is good to have all these physical models about the rendering. When it comes to practical application, we, however, have to made a tradeoff between quality and performance and most of the time, the result yield at the later choice.&nbsp;&nbsp;<a href='http://www.cnblogs.com/eric720/archive/2008/06/11/1217633.html'>阅读全文</a><img src ="http://www.cnblogs.com/eric720/aggbug/1217633.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42974/" target="_blank">[新闻]微软12月举办硬件工程大会 Windows7将首次亮相</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>Dynamic Vertex Buffer / Index Buffer in XNA</title><link>http://www.cnblogs.com/eric720/archive/2008/04/30/1178046.html</link><dc:creator>SigEric</dc:creator><author>SigEric</author><pubDate>Wed, 30 Apr 2008 09:40:00 GMT</pubDate><guid>http://www.cnblogs.com/eric720/archive/2008/04/30/1178046.html</guid><wfw:comment>http://www.cnblogs.com/eric720/comments/1178046.html</wfw:comment><comments>http://www.cnblogs.com/eric720/archive/2008/04/30/1178046.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/eric720/comments/commentRss/1178046.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/eric720/services/trackbacks/1178046.html</trackback:ping><description><![CDATA[<p>&nbsp; </p>
<p>Vertex Buffer and Index Buffer are two vital &#8220;components&#8221; in XNA rendering. In another word, if you managed to figure out how it works and how it works faster, you will get a faster rendering engine in XNA.</p>
<p>As you may notice, there is no Draw Box, sphere, etc functions in XNA framework and it is very inconvenient for rendering and collision detection. So I decide to program my own game component to render the bounding box, bounding sphere and bounding volume(still developing).</p>
<p>Here are the&nbsp;<a href="/Files/eric720/BoundingVolumeRender.rar">sample</a> and the <a href="/Files/eric720/TestBoundingVolumeRenderer.rar">source code</a></p>
<p>P.S.</p>
<p>&nbsp;For the vertex buffer updating, I strongly suggest you check <a href="http://blogs.msdn.com/shawnhar/default.aspx">Shawn Hargreaves&#8217; Blog</a>, which describe the stalling between CPU and GPU when rendering. And it is a very good blog for XNA developing. Updating the VBO in my source code is taking the advice of using a double buffers from <a href="http://blogs.msdn.com/shawnhar/archive/2008/04/15/stalls-part-two-beware-of-setdata.aspx">Stalls part two: beware of SetData</a><br />
<br />
Here is the screen shoot:<br />
<img height="372" alt="" src="http://www.cnblogs.com/images/cnblogs_com/eric720/boundingvolume2.jpg" width="480" vspace="10" border="0" /><br />
<img height="372" alt="" src="http://www.cnblogs.com/images/cnblogs_com/eric720/boundingvolume1.jpg" width="480" border="0" /></p>
 <img src ="http://www.cnblogs.com/eric720/aggbug/1178046.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42973/" target="_blank">[新闻]电脑程序与12位真人聊天 “艾尔博特”骗过3人</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>Converting a GIS Shp File to FBX format</title><link>http://www.cnblogs.com/eric720/archive/2008/03/20/1115179.html</link><dc:creator>SigEric</dc:creator><author>SigEric</author><pubDate>Thu, 20 Mar 2008 10:03:00 GMT</pubDate><guid>http://www.cnblogs.com/eric720/archive/2008/03/20/1115179.html</guid><wfw:comment>http://www.cnblogs.com/eric720/comments/1115179.html</wfw:comment><comments>http://www.cnblogs.com/eric720/archive/2008/03/20/1115179.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/eric720/comments/commentRss/1115179.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/eric720/services/trackbacks/1115179.html</trackback:ping><description><![CDATA[<blockquote dir="ltr" style="margin-right: 0px">
<p>&nbsp; </p>
<p class="MsoNormal">It has been 2 years since I started my work in *.shp format. In the same time, I produced couples of tools to convert them for different software and format. </p>
<p class="MsoListParagraphCxSpFirst" style="text-indent: -0.25in; mso-list: l1 level1 lfo1"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore">1.<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>Converting the building top view in shp file to a graphic engine format so that we can load it directly from engine. </p>
<p class="MsoListParagraphCxSpLast" style="text-indent: -0.25in; mso-list: l1 level1 lfo1"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore">2.<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>A plugin for 3Ds Max to import Shp file to max model.</p>
<p class="MsoNormal">Since I am new comer to FBX team, I decided to make a converter to turn shp file to FBX format.</p>
<p class="MsoNormal">First, we have to know FBX is more for animation propose because it is the original format of Motion Builder.<span style="mso-spacerun: yes">&nbsp; </span>So, building meshes through FBX SDK is a tough job for new users.</p>
<p class="MsoNormal">In this passage, I want to talk about the difficulty I was encountered when programming my tools. Hope this will help you out a little bit.</p>
<p class="MsoListParagraphCxSpFirst" style="text-indent: -0.25in; mso-list: l0 level1 lfo2"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore">1.<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>There is no predefined and custom vertex format. If you want have position, uv, normal, binormal, tangent, vertex color, etc in FBX mesh, well, you need to build them layer element <span style="mso-spacerun: yes">&nbsp;</span>by layer element. (Layer Element is a key concept in FBX which means a component of sth, e.g. A mesh can have normal layer element , vertex color layer element <span style="mso-spacerun: yes">&nbsp;</span>, diffuse channel layer element <span style="mso-spacerun: yes">&nbsp;</span>, etc.). After the gathering of all elements, u can put them in a layer and element between layers can &#8220;mixed&#8221; or &#8220;blend&#8221; together somehow. E.g. Texture element in different layers can blend with each other.<br style="mso-special-character: line-break" />
<br style="mso-special-character: line-break" />
</p>
<p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in; mso-list: l0 level1 lfo2"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore">2.<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>The Concept of Textures, materials and mesh. In most DCC and 3D rendering Engine, textures belong to materials, which can be applied to multiple meshes. However, <span style="mso-spacerun: yes">&nbsp;</span>textures are applied to polygons on meshes directly with ID or Value(By IndexArray or DirectArray) and materials only have the properties like colors, shinness.<span style="mso-spacerun: yes">&nbsp; </span>In the current version (2006.11.1) of SDK, there is not shader in file. But I am pretty sure even you have shaders in material.<br style="mso-special-character: line-break" />
<br style="mso-special-character: line-break" />
</p>
<p class="MsoListParagraphCxSpLast" style="text-indent: -0.25in; mso-list: l0 level1 lfo2"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore">3.<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>How to share materials and textures? For material, you can setup couples of material layer elements. Then call the <strong style="mso-bidi-font-weight: normal">SetMaterials </strong>of Layer. For textures, well, it is a little bit complicated. You need to setup an array to hold your textures, create texture layer element in each mesh, add necessary textures to layer element, calculate back the index of texture in the layer element, Set the texture index for each polygon.</p>
<p class="MsoNormal">Here is the screen shoot, take a coffee and enjoy&#8230;<br />
<br />
<img style="width: 521px; height: 297px" height="297" alt="" src="http://www.cnblogs.com/images/cnblogs_com/eric720/overview.jpg" width="521" border="0" /></p>
</blockquote>
<img src ="http://www.cnblogs.com/eric720/aggbug/1115179.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42971/" target="_blank">[新闻]Mozilla发布网页开发工具实验室</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>Vertex Buffer Object Manager</title><link>http://www.cnblogs.com/eric720/archive/2008/02/27/1084038.html</link><dc:creator>SigEric</dc:creator><author>SigEric</author><pubDate>Wed, 27 Feb 2008 10:32:00 GMT</pubDate><guid>http://www.cnblogs.com/eric720/archive/2008/02/27/1084038.html</guid><wfw:comment>http://www.cnblogs.com/eric720/comments/1084038.html</wfw:comment><comments>http://www.cnblogs.com/eric720/archive/2008/02/27/1084038.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/eric720/comments/commentRss/1084038.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/eric720/services/trackbacks/1084038.html</trackback:ping><description><![CDATA[<p>It has been a long time that no update shows up here. Sorry....<br />
I have been working on the requirement on a new Demo Engine, which is small and flexible.<br />
After doing&nbsp;some survey all these days, I found that it is very necessary to support both GL and D3D to my engine.<br />
<br />
For GL, it is state machine based so that an encapsulation for VBO is very vital for the rendering pipe line.<br />
<br />
Here are the diagrams to show the class relationships:<br />
<br />
<img alt="Buffer diagram" src="http://www.cnblogs.com/images/cnblogs_com/eric720/Buffer.jpg" border="0" /><br />
<br />
Both vertex buffer and index buffer are inheritant from the buffer object class.<br />
They provide&nbsp; both reading and writing to the buffer object, bind/unbind, size calculation, etc.<br />
<a href="/Files/eric720/VertexDeclaration.jpg" target="_blank"><img style="width: 528px; height: 227px" height="227" alt="" src="http://www.cnblogs.com/images/cnblogs_com/eric720/VertexDeclaration.jpg" width="528" border="0" /></a></p>
<p>VertexElement and VertexDeclaration are util class that helps to utilize the format of the rendering vertices. The user(programmer) can declare attribute of vertex, like position, normal, diffuse color, specular color, tangent, etc.</p>
<p>&nbsp;</p>
<p><img height="452" alt="" src="http://www.cnblogs.com/images/cnblogs_com/eric720/Manager.jpg" width="547" border="0" /><br />
<br />
All the operation including creation, modification and deletion of buffer objects are calling from the BufferManager, which is a singelton class.<br />
<br />
Here is the source code: <a title="VBO Manager" href="/Files/eric720/VBO_Manager.rar">VBO Manager</a></p>
<img src ="http://www.cnblogs.com/eric720/aggbug/1084038.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42970/" target="_blank">[新闻]经典软件十五年深情回眸</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>Weekly report</title><link>http://www.cnblogs.com/eric720/archive/2008/01/26/1054128.html</link><dc:creator>SigEric</dc:creator><author>SigEric</author><pubDate>Sat, 26 Jan 2008 03:19:00 GMT</pubDate><guid>http://www.cnblogs.com/eric720/archive/2008/01/26/1054128.html</guid><wfw:comment>http://www.cnblogs.com/eric720/comments/1054128.html</wfw:comment><comments>http://www.cnblogs.com/eric720/archive/2008/01/26/1054128.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/eric720/comments/commentRss/1054128.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/eric720/services/trackbacks/1054128.html</trackback:ping><description><![CDATA[<p>&nbsp; </p>
<p class="MsoNormal"><span lang="EN-US">Last week is a long week because lots of stuff happened which made the development process even harder, in another more tough and interesting.</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">1, The Frame buffer object. Also, we can call it render target. This technology can really speed up the rendering by using a texture or render buffer as an offline, which allow us to add some post effect on it, for example, glow effect, HDR tone mapping, DOF, etc. Therefore, this is the key component in the current rendering engine. Most of the time, we need to deal with Multiple Render Targets (MRTs), which is pretty tricky and require you to be clear which render target you are deal with, how and when to &#8220;activate and &#8220;restore&#8221; it. There are many sample codes online which are pretty good: <a href="http://www.g-truc.net/sample-ogl2.html">http://www.g-truc.net/sample-ogl2.html</a>, <a href="http://www.feedsfarm.com/article/ad25941ddd7038b6a25c3ab76a6144603487ee24.html">http://www.feedsfarm.com/article/ad25941ddd7038b6a25c3ab76a6144603487ee24.html</a></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">2, CgFx Material. No matter you are dealing with CgFx, GLSL, or HLSL, you need to have you own class to manage the shader framework and also, you need to take care of the performance issue or you scene will run extremely slow after integrating couples of shaders. You may ask why. Why? It is pretty common as you may know each pass in a shader need to setup its own rendering state, which cause lots of processing time for your GPU to switch between states. Here is the common solution: 1, sort your object by rendering state(material, effect, etc). 2, Set or Reset the state only when the same state group is finished rendering. 3, Optimize you framework to make sure the parameter setting call number is minimum. Because whenever you set a parameter of certain shader, you need to pass some variable from system memory to GPU memory, which is slow. In a word, cut the shader calls as less as you can.</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">3, Make sure you know what you are doing when coding. People are very careless these days when programming. I met a legacy bug from the system, which states in pixel shader of Shader Model 3.0, you can loop through an indexed array only when it is texture coordinate semantic and indexed by the loop variable. Like this kind of bug is not easy to fix because the algorithm is<span style="mso-spacerun: yes">&nbsp; </span>already fxied and the calculation need to be done in pixel shader, how can you avoid the looping? I didn&#8217;t come up with the perfect answer but we can unfold the looping and limit the maximum boundary of the loop, which means we limit the function of the shader if we have to fix this. Let&#8217;s think about the cause, why a bug like this will exist. If we can always pay attention to what you are writing rightnow, let say I am writing a PS 2.0 program and I need to stick with the profile spec of it. Also, after you program seems to work, we need to put some log or error checking when calling it to make sure there is no warning or error. I know, I know this will cost some time but it will save lots of people time and money to just find the bug, let alone to fix it.</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">4, Check the module related with what you have modified before hastily submitting your code. Make a fully test the corresponding module before telling others you just fixed a bug or create a new wonderful feature because this may be the beginning of a new regression. This situation happens a lot in new developers, even for some experienced programmers. People are easily ignore to testing all the related codes, instead, to submit the new changed code just because they think they spend some or a lot time on the development and finally it comes up with a nice result. However, the last path to success is always full of mines. If you don&#8217;t take care them, you may cause some serious trouble for yourself, even the entire development and QA team.</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Above, it is my feeling during last week.</span></p>
<img src ="http://www.cnblogs.com/eric720/aggbug/1054128.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42969/" target="_blank">[新闻]MySpace推自助广告平台MyAds</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>Antialiasing with post processing ( view port filter )</title><link>http://www.cnblogs.com/eric720/archive/2008/01/12/1036480.html</link><dc:creator>SigEric</dc:creator><author>SigEric</author><pubDate>Sat, 12 Jan 2008 13:30:00 GMT</pubDate><guid>http://www.cnblogs.com/eric720/archive/2008/01/12/1036480.html</guid><wfw:comment>http://www.cnblogs.com/eric720/comments/1036480.html</wfw:comment><comments>http://www.cnblogs.com/eric720/archive/2008/01/12/1036480.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/eric720/comments/commentRss/1036480.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/eric720/services/trackbacks/1036480.html</trackback:ping><description><![CDATA[摘要: Antialiasing (AA) is old topic for computer graphic since the structure of PC screen is measure by pixel and there is no way to create a unit samller than that, we have no choice but using a way named antialiasing to avoid the jaggy on the edge of the objects.Now, the way of applying the aa effect as the post processing to RT and FBO is described here.&nbsp;&nbsp;<a href='http://www.cnblogs.com/eric720/archive/2008/01/12/1036480.html'>阅读全文</a><img src ="http://www.cnblogs.com/eric720/aggbug/1036480.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42960/" target="_blank">[新闻]Facebook创始人:信息共享或存摩尔定律</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>新环境 新机遇</title><link>http://www.cnblogs.com/eric720/archive/2008/01/06/1027776.html</link><dc:creator>SigEric</dc:creator><author>SigEric</author><pubDate>Sun, 06 Jan 2008 05:45:00 GMT</pubDate><guid>http://www.cnblogs.com/eric720/archive/2008/01/06/1027776.html</guid><wfw:comment>http://www.cnblogs.com/eric720/comments/1027776.html</wfw:comment><comments>http://www.cnblogs.com/eric720/archive/2008/01/06/1027776.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/eric720/comments/commentRss/1027776.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/eric720/services/trackbacks/1027776.html</trackback:ping><description><![CDATA[过了一年才发觉好久没有更新博客了，最近琐事特别多，所以时间感觉是在不够用。<br />
新公司在浦东，四号线环线通车后上班还是挺方便的。Mudbox的开发刚刚开始，新的挑战还在前面！！<br />
欢迎各位和我讨论图形相关的技术。<img src="http://www.cnblogs.com/Emoticons/yoyocici/224025817.gif"  alt="" /> 
<img src ="http://www.cnblogs.com/eric720/aggbug/1027776.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42959/" target="_blank">[新闻]微软承认Vista用户账户控制功能有问题</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item></channel></rss>