Friday, August 20, 2010

Creating Ambient Occlusion with transparency texture– Tutorial

질문 : hair 등의 투명 알파맵 텍스처가 들어간 물체에 Occlusion pass 를 제대로 쓰려면 어떻게 하나? 텍스처가 아니라 오브젝트 폴리곤 자체로 occlusion 이 계산되어 곤란하다.

답 :
Creating Ambient Occlusion with transparency texture– Tutorial

이미지를 제외한 본문 전체 :
In my previous post Dissecting the mib_amb_occlusion node. I talked about using transparency in Ambient occlusion, but I didn’t really cover the subject of using texture with alpha and having that casing AO on the nearby object.

In this simple scene we have a texture file with alpha assigned to a separate geometry.

If we would to render, we get this result.

A regular AO pass would look something like so

This in theory is accurate, since ambient occlusion doesn’t recognize alpha in texture files.
To get around this limitation, we will be using the mib_fg_occlusion node found under Mental ray lights in the Hypershade (don’t ask me why it’s setting there)

Note: The mib_fg_occlusion node requires having Final Gather to be turned on.

Create a surface Shader and assign the mib_fg_occlusion to it’s out color.
This Shader will act as the AO for the geometry without transparency.

Create another surface Shader that will be assigned to the transparency object.

Open the SG node of that new shader, under mental ray > custom shader and add mib_transparency node (found under mental ray Sample Compositing)
To get the AO to appear, we just need to add the same mib_fg_occlusion node to the Input of the mib_transparency.

Finally just add the mask of your texture file to the Trnsp slot of the mib_transparency.

To get a better render of our AO, we need to increase the FG settings.

Here is a screenshot for my shading network.

키워드 : alpha

No comments:

Post a Comment