
本教學(xué)為翻譯教學(xué),轉(zhuǎn)載請(qǐng)注明來自aboutcg.net,以及注明翻譯者
原教學(xué)出自EVERFLOW STUDIOS網(wǎng)站,原始鏈接如下:
http://www.everflow.com/support/tutorials/AO/Everflow_AmbientOcclusion1.html
作者:Bruce
Email:webmeister@everflow.com
翻譯:freeyy
關(guān)于譯者:

請(qǐng)尊重互聯(lián)網(wǎng)道德,轉(zhuǎn)載請(qǐng)注明轉(zhuǎn)載出處和翻譯者,謝謝!
這是個(gè)系列教程,我今天翻譯了第一部分,后續(xù)的我會(huì)盡快翻譯出來。雖然是05年的東西我還是覺得這些基礎(chǔ)知識(shí)還是我們這些CG人該了解和掌握的~~

There are many uses for the Ambient Occlusion shader, one being to accentuate details/edges and increase the realism of 3d renders. This occlusion is also known as the ‘dirtpass’ or ‘dirtmap’. The pass renders quite quickly and since it is a Global Illumination (GI) solution, it is an excellent tool when time is of the essence, and GI quality is required.
環(huán)境遮擋著色器有許多的用途,其中之一是用來增強(qiáng)細(xì)節(jié)/邊緣 以及增加三維渲染的真實(shí)感。這里的 遮擋同樣也是已知的“污垢處理”或者“污垢貼圖”。渲染過程非常迅速并且因?yàn)樗且粋€(gè)全局光照(GI)的解算結(jié)果,所以當(dāng)時(shí)間緊張時(shí),它就是一個(gè)優(yōu)秀的工 具,并且對(duì)于 GI 質(zhì)量來說它也是必須的。
I will not go into the details of the science behind the magic, simply put; ambient occlusion fires rays into the scene at various angles from various points on the geometry, and determines which rays are blocked by other geometry, and creates a visual representation of the occlusion. The closer the occlusion, the stronger the representation.
我將不會(huì)深入探討科學(xué)技術(shù)背后的魔法,僅做簡(jiǎn)單的敘述;當(dāng)環(huán)境遮擋初級(jí)光線從幾何體的不同出發(fā)點(diǎn)以不同的角度投射到場(chǎng)景中,隨后將檢測(cè)那些光線被另一個(gè)幾何體所遮擋,最后會(huì)為遮擋簡(jiǎn)歷一個(gè)視覺上的反饋??拷恼趽鯇⒈憩F(xiàn)出更強(qiáng)烈的反饋。
Below are 3 spheres over a plane. You can see the strength of the occlusion is dependant on the distance to the plane. If you look closely, you can see the spheres also are ‘casting’ occlusion upon each other.
下面是在一個(gè)平面上方的三個(gè)球體。你可以看到遮擋的強(qiáng)度將依賴于平面的距離遠(yuǎn)近。如果你觀察近處,你可以看到球體與另外一個(gè)相互“投射”了遮擋。

Overview:
概述:
We will render our image normally, and save the result. This can be done using any renderer, default scanline, radiosity, mentalray etc. Next we will assign all the objects in our scene the occlusion shader. We will composite the two resultant renders in a third party application. In this instance, since it is just a still, we will use Photoshop. Any video editing package will allow you to composite them for animation as well.
我們將正常的渲染我們的圖像,然后存儲(chǔ)結(jié)果。這可以通過 任何渲染器來辦到,缺省掃描線、光能傳 遞、mentalray等等。下一步我們將為在我們場(chǎng)景中的所有物體指定遮擋著色器。我們將在一個(gè)第三方的程序中合成兩個(gè)渲染結(jié)果。在這個(gè)例子中,因?yàn)樗?僅僅是一幅靜態(tài)的畫面,所以我將使用 Photoshop。任意的視頻編輯模塊也將允許你為了動(dòng)畫而合成它們。


Step 1: Render Scene
步驟一:渲染場(chǎng)景
There is no need for any preparation, simply render your scene as you normally would. In this instance I created a simple greeble wave, rendered with default lighting.
這里不需要任何的準(zhǔn)備,至于需要按你的標(biāo)準(zhǔn)來渲染你的場(chǎng)景。在這個(gè)實(shí)例中我創(chuàng)建了一個(gè)簡(jiǎn)單的建筑波浪(譯者:用 Greeble 插件做的一個(gè)波浪城市小廠家),然后用缺省的照明進(jìn)行渲染。

Step 2: Assign MentalRay as your renderer
步驟二:指定 MentalRay 作為你的渲染器

Step 3: Create a MentalRay Material.
步驟三:創(chuàng)建一個(gè) MentalRay 材質(zhì)。

Step 3: Click None in the surface parameter slot, and select Ambient/Reflective Occlusion to create the base shader.
步驟四:點(diǎn)擊 surface 參數(shù)內(nèi)的 None 貼圖按鈕,然后選擇 Ambient/Reflective Occlusion 來建立基礎(chǔ)的著色器。

Step 4: You now have your base ‘dirtmap’ shader. Read on for an explanation of the base parameters relevant to our cause.
步驟五:你現(xiàn)在擁有了你的基礎(chǔ)“污垢貼圖”著色器了。為了理解與我們目的相關(guān)的基本參數(shù)的解釋請(qǐng)繼續(xù)閱讀。


Samples: determines the quality of the solution, the more the better. Tradeoff is rendertime.
采樣:確定解算結(jié)果的質(zhì)量,越高質(zhì)量越好。不過要考慮渲染時(shí)間。
Bright/Dark: sets the colors for the extremes of the shader. For our purposes, we will leave the defaults of black and white.
亮色/暗色:為著色器的終點(diǎn)(譯者:這里指遮擋檢測(cè)結(jié)束后的結(jié)果)設(shè)置顏色。為了我們的目的,我們將保留缺省的黑色和白色。
Spread: this value sets the level of diffusion of the occlusion. If the default value leaves your render ‘loose’ you may reduce this value to ‘tighten’ the solution. Similar to the level of a Gaussian Blur filter in Photoshop.
傳播:這個(gè)數(shù)值設(shè)置遮擋的擴(kuò)散級(jí)別。如果缺省的數(shù)值讓你的渲染太過“松散”那么你可能需要減少這個(gè)數(shù)值來“聚攏”解算結(jié)果。它類似于 Photoshop 濾鏡中 高斯模糊濾鏡的效果。
Type: again, we leave this at default, 0, which is occlusion.
類型:再次,我們使用了這里的缺省值,0,它將產(chǎn)生遮擋。
Step 5: Assign the shader to all your scene objects. One sweet way to accomplish this is by using mental rays Material Override. Under the processing tab dwells the Material Override slot. Drag your material from the editor, or select it by clicking the Material Override slot, and selecting it from the editor.
步驟六:為你場(chǎng)景中的所有物體指定著色器。一個(gè)方便的方 法在這里是利用 mental rays 的材質(zhì)覆蓋。在 processing 標(biāo)簽的下面的 Material Override 貼圖按鈕。從你的材質(zhì)編輯器里拖拽材質(zhì)到這里,或者通過點(diǎn)擊 Material Override 貼圖按鈕來選擇它,然后選擇從編輯器中選擇它。
The benefits of this technique are that you do not have to edit your scene materials, simply toggle Enable, and that shader overrides all the objects in the scene.
這個(gè)技巧的好處是你并不需要編輯你的場(chǎng)景材質(zhì),簡(jiǎn)單的打開 Enable 勾選框,然后著色器就會(huì)覆蓋你場(chǎng)景中的所有物體。

Step 6: Set your environment background to white.
步驟七:把你的環(huán)境背景設(shè)置為白色。
Depending on your scene specific/quality needs, you may want to raise the Samples per Pixel in the Render Scene dialog.
依賴于你對(duì)場(chǎng)景的特別之處/質(zhì)量的需要,你可能需要在渲染場(chǎng)景對(duì)話框中增加每像素的采樣。

Render the image.
渲染圖像

Step 7: Composite
步驟八:合成
In Photoshop, copy the Occluded image and paste it on a layer over the Diffuse pass. Set the Occlusion layer to Multiply. Adjust the opacity as you see fit. Click save. Dance a jig.
在 Photoshop中,拷貝遮擋圖像,然后把它作為一個(gè)層粘貼到漫反射結(jié)果的上面。把遮擋層的圖層模式設(shè)置為疊加。調(diào)整透明度直到你覺得合適為止。把它存儲(chǔ)。起身跳支舞………

This is just one use for this most excellent shader, you may add it to other material slots as well as incorporate it into your lights. It is fast, simulates Global Illumination and is highly customizable. Have fun!
這僅是這個(gè)非常優(yōu)秀的著色器運(yùn)用的一個(gè)方面,你可以把它添加到其它的材質(zhì)通道中,也可以把它包含到你的燈光里。它可以快速模擬全局光照并且能夠完全的自定義。玩的開心!
Read on for further options and other uses for this most excellent shader.
為了更多的選項(xiàng)以及這個(gè)非常優(yōu)秀的著色器的其它用途請(qǐng)繼續(xù)閱讀。