Say we now add a transparent green object to our scene. To avoid our original
rendering problem, the rule is that all opaque objects are drawn first. So the
blue object is rendered. If we now render the green object, and then, the red
object in that order. The green object will block the red one. We want the blue
object to be affected by both the green and red filters. But the red filter is
rendered too late and has no effect. Just to make life exciting, say we add yet
another filter, a yellow one behind the blue object. This filter is not visible
for the pixel shown. But whatever solution we choose must make sure this object
is taken into account properly. My question to you is, which is the best
solution? The one that will give us the result of red blend to blue. And then
green blended over that. Draw all the transparent objects, sorted by their alpha
values, largest to smallest. Using the painter's algorithm, with the z-buffer
off. Sorted in back to front order. Or based on intensity, with the brightest
objects drawn first.
シーンに透明な緑のオブジェクトを加えます
レンダリングで生じる問題を避けるために
不透明なものはすべて最初に描くことにして
青のオブジェクトをここに置きます
緑のオブジェクトを描いた後に
赤のオブジェクトを形成すると
緑のオブジェクトは赤を隠します
青のオブジェクトに
緑と赤の両方の影響を与えたいのですが
最後に形成されたのは赤のフィルタなので不可能です
さらにもう1つ黄色のオブジェクトを
青のオブジェクトの後ろに描きましょう
フィルタは目に入ってはきませんが
このフィルタが考慮された解決案を選んでください
赤を青にブレンドしたものにさらに緑を混ぜるためには
次の方法のうちどれを使えばよいでしょう
透明なオブジェクトを
すべてアルファ値の大きい順に描く方法
Zバッファを使わず画家のアルゴリズムを使う方法
遠くのものから描く方法
明度の高いオブジェクトから先に描く方法
我們現在加入綠色透明物件到場景裡
為了避免原來的繪圖問題,現在規則是不透明物件先畫
所以藍色物件先畫了
接下來如果先畫綠色再畫紅色
綠色物件會擋到紅色
我們希望藍色物件同時被綠色跟紅色過濾片影響
但是紅色過濾片畫得太晚而沒有效果
為了讓問題更有趣,我們在藍色物件後面在放一個黃色過濾片
這個過濾片在這個像素上不可見
但我們選的任何方案都必須考慮到這個物件並妥善處理
我的問題是哪個答案最好?
哪個答案能給我們紅混在藍上,接著綠色再混上的結果
畫所有透明物件... 由 Alpha 值排序大到小
關掉 Z 緩衝區改使用畫家演算法
由後往前排序
或是照亮度排序,最亮的先畫