2010年10月30日 星期六

Volumetric Fog

Volumetric Fog
http://www.gamedev.net/reference/articles/article677.asp 

Volumetric Rendering in Realtime
http://www.gamasutra.com/view/feature/3033/volumetric_rendering_in_realtime.php 

Volumetric Fog II 
http://www.evl.uic.edu/sjames/cs525/shader.html 

Volumetric Fog

http://www.apgardner.karoo.net/gl/fog.html

Fog Polygon Volumes

http://developer.download.nvidia.com/SDK/9.5/Samples/samples.html#FogPolygonVolumes3

Crysis volFog
http://www.youtube.com/watch?v=UuTTAa4R4dA

UE3: Fog Volumes

http://udn.epicgames.com/Three/FogVolumes.html

2010年10月25日 星期一

MRT format

When I use different format render target in deferred lighting. D3DFMT_A8R8G8B8 is better than D3DFMT_A16B16G16R16F when you don't have precision issue. I have 530 vs. 487 FPS experiment result.

2010年10月18日 星期一

PS3 Cell Processor


http://www.ps3station.com/cell.php

2010年10月17日 星期日

感謝...又突破一個瓶頸

我自己有時候會是一個悲觀性格的人,遇到bug的時候就會責怪自己數學不好英文也不好,開始質疑自己對於這方面的工作是不是難以勝任...別人可能很快就可以搞懂的東西我卻要比別人多花時間...

但今天把工作帶回家解決掉一個花費將近一個禮拜的bug,又獲得一枚經驗值。真不知道是不是自己又太幸運了~~~證明自己還是可以繼續努力,加油!!!  明天有國外客戶要來交流,被叮嚀說一定要開口問問題! 所以我爛爛的英文對話要拿出來面對大家了,希望能夠及格,我真要開始找個時間好好補習了...

Deferred lighting

     Today I finish my deferred lighting debug, there are some experience notes:
  1. In the geometry pass, I prepare 4 render target
    • depth map( view position and depth, actually we can try to just store the depth value only) - remove, we can just save clip space depth(z/w) to instead
    • normal map( view space normal ) + clip space depth(z/w)
    • diffuse map( diffuse color)
    • specular map( specular color and shininess )
  2. Draw lights
    • First, draw ambient light, we fetch the diffuse texture compute with ambient light  and fetch depth value from depth map write to the frame buffer and depth buffer. If you have z-prepass needn't rewrite depth to the z buffer.
    • Second, sun light draw a full screen rectangle( is clip space coordinate ) compute the directional lighting, multiply among diffuse, specular map and lighting formula. Enable alpha blending one plus one, disable depth write
    • Third, omni light draw the light volume( a sphere ), use point lighting formula. Enable alpha blending one plus one, use front-face culling, disable depth write, and depth test use greater than. We can use clip space depth to transform pixel to the view space and do lighting. Importantly, the texture coordinate of the MRT maps, must in the pixel shader transform from screen space to image space !!! otherwise you will see the light volume slip on your screen.

           float2 vTexcoord = IN.texCoord.xy / IN.texCoord.z;   
          vTexcoord.x = 0.5 * (1 + vTexcoord.x);
          vTexcoord.y = 0.5 * (1 - vTexcoord.y);

      thank for this article(http://www.gamedev.net/community/forums/topic.asp?topic_id=557716) give me idea.
    • Fourth,  spot light just draw a cone mesh, this kind of light we don't not support now.


      The bottom figure is ambient + sun + three omni light result:

                 World space deferred lighting discussion: http://www.gamedev.net/community/forum/topic.asp?topic_id=544144&whichpage=1&#3508871

2010年10月15日 星期五

D24S8 depth sampling wrong

http://www.gamedev.net/community/forums/topic.asp?topic_id=515318

2010年10月1日 星期五

Deferred Rendering

Deferred Shading - nvidia
http://developer.nvidia.com/object/6800_leagues_deferred_shading.html
 
Deferred Rendering Demystified
http://www.gamedev.net/reference/programming/features/defRender/

Deferred Shading
http://www.3dvia.com/studio/documentation/user-manual/shaders/deferred-shading

G-buffer, Geometry Buffer (Saito and Takahashi 1990)