» 您尚未登录:请 登录 | 注册 | 标签 | 帮助 | 小黑屋 |


发新话题
打印

我们终于学到了PS3做Real Time Radiosity实在是快到不行

转自Eji Blog
标题:Painting with Light Enlighten and the PS3


post by Eji @ 10 八月, 2007 06:48


or....
How I learned to stop worrying and accept that the PS3 is perfect for doing real time radiosity XD

Source:
http://www.geomerics.com/documents/GeomericsDevstation2007.pdf
News:
http://www.gamasutra.com/php-bin/news_index.php?story=10031
July 11, 2006
Product: Geomerics Debuts Real-Time Radiosity Solution
http://www.gamasutra.com/php-bin/news_index.php?story=12812
February 19, 2007
Product: Geomerics, Epic Partner To Enlighten UE3
http://www.gamasutra.com/php-bin/news_index.php?story=14659
July 12, 2007
Geomerics Gets $4mil Investment, PS3/360 Middleware Invite


2006年7月的時候,屬於劍橋大學的一個學術兼遊戲媒體製作單位Geomerics發表了它們的第一個產品「Enlighten」,作用是一個tookit可以在其餘的繪圖引擎內加入Real time Radiosity的效果。
然後2007年2月的時候與Epic簽約,整合進UE3;並且在GDC07的時候展示了XBOX360版。(正好在同時,まいにちいっしょ也做出了類似Real Time Radiosity、或者說Ambient occlusion的效果,演算法來自3dsmax知名的plug-in,SkyLight)

今年5月的時候,Devstation 2007上他們發表了PS3上的Enlighten研究成果,標題如上。

"以光替萬物上色:Enlighten 與 PS3的配合",或者說:"我們終於學到了PS3做Real Time Radiosity實在是快到不行"
所以我們來提一下他們到底做了什麼。
Enlighten的功能大致如下:

Real-time radiosity
Dynamic lighting environments
Colour bleeding
Soft shadows
Character lighting
Ambient occlusion
Specular highlights
Normal mapping
HDR
Cross-platform compatibility
其中,Radiosity(熱輻射演算法)的內容請參照Geomerics本身提供的資訊,或者是Wikipedia。
Enlighten在PC和XBOX360上的作法,應該是用CPU或GPU的資源,產生有Radiosity效果的各種材質,然後讓GPU讀回來打光。
而PS3上的Enlighten則是使用SPE。

問題來了,SPE這東西讓諸多廠商又愛又恨,感覺上能做的東西很多,但是又不知道怎麼做。
比方說,SPE靈活度很高,但是性能夠嗎?延遲如何?它能幫助打光流程多大?這麼重大牽涉到整個render流程的東西,真的有辦法靠SPE做嗎?而且用SPE做會不會佔掉很多資源?

所以,以下是他們的報告:

1. SPE真的非常powerful。

Lots of good examples of SPUs doing useful things
- 'Offline' image processing
- Animation
- Physics
- Compression
- Progressive meshing
- Blend shapes
- Extreme vertex/triangle processing
(see: The Naughty Dog guys talk from gdc 2007:
https://ps3.scedev.net/projects/gdc_2007) *:需要帳號
- Clearly very powerful!


2. 但因為架構的關係,它沒有強到可以提供GPU fillrate的代用方案。
當初David Kirk所曾提到的Post-processing的作法,實用度也不高。


Not so hot at replacing fillrate
- Bit difficult to use it as a substitute GPU
- Can't really render part of the scene on SPU and combine results on GPU
Triangle rasterisation setup, streaming…
Hardware filtering, mipmaps, perspective correction…Antialiasing,zbuffering,stencilling…
GPU really benefits from having dedicated hardware for this
Would be god damn complicated
- Also not really workable for post processing
Render scene >dma round through SPUs >process >render through GPU again
Could delay results by a frame?
Still not particularly desirable and large amount of data to move



3. 但是SPE卻很適合Texture Generation;而因為結構上的設計特性,RSX也可以相當有效率地讀取這些東西,而這個作法也可以比較容易整合進繪圖流程裡面。
也就是說,Enlighten在PS3上作法,其實是透過SPE產生以材質為形式的資訊,讓RSX可以取用。

Most previous work has focused on vertex based operations
- Makes sense given flexibility of SPUs
RSX can efficiently read textures straight from main memory
- Huge advantage for generating anything intended for the GPU on the SPU
- One of the best points of the PS3 architecture
Textures easy to process on SPUs
- Simple to stream in/out in chunks
- However, random accesses need to be made coherent - so not much good if you can't do this
Easy to do inplace modifications
- Possibility of progressively updating a texture
- No need to double buffer if you get sync right



4. 不過這東西因為是用額外材質的方式送給GPU,所以要加進原來頻寬就很吃緊的繪圖流程中會變得比較困難,比較好的方式是整合一些壓縮來減少頻寬負擔。

Memory bandwidth is likely to be the bottleneck
- Generating large textures is going to generate problems in a heavily loaded system
- Generating full screen images still going to be unfriendly
- Compression is your friend
- Need to make your memory usage count
Textures are just a storage medium
- Ultimately just a way of getting data into shaders
- Many possibilities!



原理講完了,來點爽快的數字吧,Geometrics提供了他們在SPE上執行的效果與性能數字。
基本上Enlighten本身為了求可以整合進客戶的繪圖流程,他們表示Enlighten本身在一般的GPU(這應該指的是Xenos,或者是同時期的高階SM3 device,在GDC06[06Q1]的時候應該是G71和R580)上可以達到100fps的速度(也就是大約10ms左右),這樣才能在實際工作的狀況下,維持60fps。
當然它使用到了Render to Texture之類的技術,所以頻寬其實吃得也不會少,如果GPU負載高的話他們也有提供offload到Host CPU(比方說Xenon的Host CPU其中一個thread、或者是PC上的Multi-Core)的功能。

但是在PS3上,他們企圖全部由SPE來處理。因為RSX其實頻寬並不是很充足,做Render to Texture本身就是個很耗資源的事情。

Originally implemented a GPU version for reference on the PS3
- Runs perfectly fine, but expensive resource


結果SPE.... 實在太快了。XD
在1個SPE上只佔了5ms的執行時間,幾乎是60fps(15ms per frame)下1/3的單SPE資源,或者是SPE總資源的5%左右(5/ 15x6 大約5.5%)
(順道給個對比,當初まいにちいっしょ用了總共4個SPE來達到30fps,大約135ms;不過因為本身型態所致,他們畢竟沒有花很多時間在optimize上;而Geometrics的optimize工作,至少有從1月收到PS3硬體,到五月 Devstation07 發表之間這段時間可作,他們主要的業務也是這個)

SPU version much faster
- System runs in 5ms on a single SPU (!)
- That's = 1/3r d of an SPU @ 60 fps
- Or 5% of the total SPU potential at 60fps
That' s why we are excited
- Algorithm is scalable so we can crank up the quality
- Still need to explore possibilities unique to the PS3
- SPUs are more flexible than GPUs - haven't really exploited this yet
- Very promising future!


這简直太快了....如果前面的100fps(10ms)的數字是確定的話,那相當於單顆SPE就可以比C1、R580和G71還快兩倍。(!)
總之,除了GPU讀texture之外,實質上對GPU沒有額外的負擔;相對於其他系統而言需要GPU做RoT再讀回來需要兩倍的頻寬與時間,又會影響GPU的PS可用資源,即使offload到CPU上,也會另外需要足夠的I/O頻寬來負擔傳輸所需。
PS3有SPE處理、FlexIO提供充足的頻寬,RSX針對主記憶體內的材質做了改進,使得Enlighten在PS3上的執行變得非常有效率。想當然爾,這讓Geometrics非常振奮,並預期還有很大的進步空間

不過這也預告了一件事情:就像上面Geometrics所提示的內容,SPE畢竟和RSX之間有距離限制,高度整合的fillrate replacement(如讓SPE做AA)、或者是post-processing確實是不很實際,未來的SPE assistence應該都會在Texture Generation的基礎上做。


TOP

难道要彻底解放spe??



TOP

这么厉害的东西为什么要换成rsx?当年2个cell不是很好?


TOP

不是说cell来管图象效果不好的。。。弄成又一个机能无限的ss就要被人笑话了

TOP

不知道战区这帖会被喷成啥样

TOP

引用:
原帖由 fido7 于 2007-8-10 19:51 发表
不知道战区这帖会被喷成啥样
http://www.tgfcer.com/club/thread-5894328-1-1.html

满足你

TOP

战了30页!!!!!!!!!!!!

TOP

如果自己不是很懂还是别转好了~,软饭中"专业人士"众

TOP

tg的专家太多了,人才济济啊

TOP

引用:
原帖由 张国志老师 于 2007-8-12 00:27 发表
tg的专家太多了,人才济济啊
老师 你也是专家啊

TOP

发新话题
     
官方公众号及微博