2009年4月23日

I partially inegrated ESM with my current engine, the effect is working well without color render target now.

Will blend with color target after more tweak on the effects.

 

They look pretty ok for me, just take some time to tweak the effect's parameters.

posted @ 2009-04-23 22:02 SigEric 阅读(983) | 评论 (1)编辑

2009年4月19日

Try to find a suitable SM algorithm to intergrate to my engine, just come across an new SM named Exponential Shadow Maps.

The result is pretty good and avoid the light bleeding in VSM.

Here is the FX composer rendering result:

 

 

 

The performance of ESM is a lot better than PCF softshadow and consume less video memory compared to VSM.

Of course, the result looks pretty decent to me.

posted @ 2009-04-19 16:52 SigEric 阅读(56) | 评论 (0)编辑

2009年4月4日

Happy Qing-ming day~~~

After one day trip in my univeristy, I continued my work on MagiEngine.

I finished the framework of post effect system last week and did presentation to some of VP of my company.

It is kinda success but there are still some limitation of my implemenation:

1, all the post effect must be in a single chain.

2, blending between different render target is not supported.

To overcome these two limitations, I started to dig into my code and start to mark down which render target is for back buffer and which is for the chain render target. Also, remove the duplicate setting for each render targets in each pass.

Here is some screenshots of my work tonight (basically 2.5 hours), special thanks to James who remind me the changes of my code and keep discussing the idea of my engine with me.

 

Glow Effect:

 

Edge detection:

Corona effect:

 

 

 

Post godrays and tiles

 

 

posted @ 2009-04-04 23:24 SigEric 阅读(84) | 评论 (1)编辑

2009年3月21日

Yo, what's up~~

Well, I have say sorry about my absent about half of a year. And I have to say it is quite a busy days.

In return, the up-comming Autodesk FBX SDK 2010will include lots of new features which are "Made in China".

For MagiEngine development, I refactored my previous XNAShader code to the following structure.

SceneManager --- currently there a Octree structure to manage all the scene objects

Render --- Material Shader Effect and Post screen effect.

This is my favorite package will manager everything which is renderable. All shader effects that come with FBX scene will generate with a cooresponding class to represent the shader by CodeSmith, so that NO EXTRA CODE need to add to render any shader effect~~~.

TheGame --- The main application entry

ContentPipeline --- Where I perform attaching extra information I need in the scene, like AABB, Shader Info, etc.

Common --- All helpers classes will be packaged here, which are ready and handy to use.

 

Here are some screenshots:

Depth of Field

Noisy Huaihai Road :)

 

 After three hours work on the tweaking of the rendering pipeline, MagiEngine now support most the Shaders directly from NVidia's Shader libarary.

Basically, all the post effects and material effects are supported and compatible. Yep, yep, I have not start the shadow rendering integration yet.

If I make it with shadow support, it will be 100% compatible with FX composer 2's shader standard, which means I can use most of the .fx shader without modification and without one line code in my engine, OMG~~~~~

 

posted @ 2009-03-21 22:11 SigEric 阅读(676) | 评论 (0)编辑

2008年9月18日

Sometimes, when we try to delete some objects which are created inside a dll, and the deletion will cause an access violation.

Yep, but just sometimes.

I tried and tested the idea with my colleages this afternoon. And we found out that

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.

So, for the sake of safe coding, we should handling all the creation and deletion inside the dll.

posted @ 2008-09-18 16:17 SigEric 阅读(252) | 评论 (0)编辑

2008年8月31日

I made a presentation of XNA this friday, which I felt ok. So, here is the presentation slides

posted @ 2008-08-31 09:17 SigEric 阅读(108) | 评论 (0)编辑

2008年8月5日

Okay, okay, I update my blog finally. It is because my production's development stage is closed last week

 

And I spent two days on my Shader Engine developement and finally there is something to show!

 

I promise I will explain the details later but first I will brief you the basic idea behide this engine.

 

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.

 

Here is the screenshot

 

 

Like I said, I will explain the whole damn thing later after adding some comments, modifying the CodeSmith templates, etc.

posted @ 2008-08-05 17:38 SigEric 阅读(400) | 评论 (3)编辑

2008年6月11日

     摘要: 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.  阅读全文

posted @ 2008-06-11 22:44 SigEric 阅读(504) | 评论 (7)编辑

2008年4月30日

 

Vertex Buffer and Index Buffer are two vital “components” 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.

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).

Here are the sample and the source code

P.S.

 For the vertex buffer updating, I strongly suggest you check Shawn Hargreaves’ Blog, 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 Stalls part two: beware of SetData

Here is the screen shoot:

posted @ 2008-04-30 17:40 SigEric 阅读(318) | 评论 (0)编辑

2008年3月20日

 

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.

1.       Converting the building top view in shp file to a graphic engine format so that we can load it directly from engine.

2.       A plugin for 3Ds Max to import Shp file to max model.

Since I am new comer to FBX team, I decided to make a converter to turn shp file to FBX format.

First, we have to know FBX is more for animation propose because it is the original format of Motion Builder.  So, building meshes through FBX SDK is a tough job for new users.

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.

1.       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  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  , diffuse channel layer element  , etc.). After the gathering of all elements, u can put them in a layer and element between layers can “mixed” or “blend” together somehow. E.g. Texture element in different layers can blend with each other.

2.       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,  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.  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.

3.       How to share materials and textures? For material, you can setup couples of material layer elements. Then call the SetMaterials 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.

Here is the screen shoot, take a coffee and enjoy…

posted @ 2008-03-20 18:03 SigEric 阅读(174) | 评论 (0)编辑