Skocz do zawartości

Mate\shadow


THE MANYSH TRAFO

Rekomendowane odpowiedzi

  • Odpowiedzi 7
  • Created
  • Ostatniej odpowiedzi

Top Posters In This Topic

Gość User190

nie bede sie przemeczal ;) (splutafishowski tutek - bez obrazków, ale chyba można skumać ;)):

 

The Setup:

A globally illuminated object (teapot) on a screen mapped background with a Matte/Shadow groundplane.

The Problem:

The background image shows through the object as if the object is transparent.

 

The players: A background plate, and a globally illuminated, sky and direct lit teapot on a matte/shadow ground:

 

 

 

 

 

Here's a white plaster pass, so you can see the basic illumination setup and the matte/shadow ground object:

 

 

 

 

 

Composited together (in max by just turning on the env background image and setting the ground plane to matte/shadow), you can see the background through the teapot. The effect is subtle with the image map, so I've included a checkerboard that really shows the issue:

 

 

 

 

 

By experimenting I found that two things would make the obvious problem go away. One was turning off secondary illumination in Brazil. The other was hiding the Matte/Shadow ground. The question that comes up... What is Matte/Shadow doing that effects GI? Thinking about it for a bit it became obvious: Matte/Shadow is behaving as an illumination generating object. How does Matte/Shadow work? In it's simplest form, it basically turning the Matte/Shadow object into a simple self illuminated object while it steals it's mapping from whatever is in the background color under the currently rendering pixel, in this case, a screen mapped bitmap. If you screenmap the checkerboard onto a selfilluminated groundplane, you'll see similar problems:

 

 

 

 

 

The reason this happens is that when the GI rays bounce off the teapot, looking for radiators (GI Generators) in the scene, the ones that hit the ground plane have to find out what color the ground plane is when they hit it. The screen mapped bitmap always returns the color of the pixel that's being shaded, not the color of the surface. It's a bit tough to understand, but the thing to get here is that that background bitmap ends up behaving like a screen mapped light map in the secondary illumination on the teapot. It's like the ground plane is a self illuminated object, casting light up onto the teapot, but because of the weirdnesses of screenmapping, the illumination isn't actually cast upwards at all, it's just copied from the background image behind the teapot, making it start to look transparent.

 

So... are we screwed? No way :) Brazil won't let you down :) If I hide the ground plane, the teapot looks fine even with GI on - Brazil knows enough not to use the background image for the GI calculation:

 

 

 

 

 

So, the question is, how do I use matte shadow and have it not act like a self illuminated object - the answer is the Brazil Utility Material.

 

In this case, I put that Matte/Shadow material in the main material slot of the Brazil Util mtl and added a default gray standard material to the Generate (send) rollout of the Brazil Utility Mtl. The gray standard material is just there to give a little gray bounce from the ground - the gray material won't render, but the bounce light from it will.

 

The result:

 

 

 

 

 

Now we have the GI/Skylight lit teapot, the shadows from the Matte/Shadow, and the background, which isn't interfering with the illumination, keeping everything very natural looking and attaching that teapot firmly to the ground.

 

I turn off opaque alpha in the matte component of the Matte/Shadow, copied the shadow color from under the bridge, and turned on opaque alpha shadows so that I could get the proper alpha channel for pulling the shadows in post (if needed).

 

Here's the final image and it's alpha mask:

 

 

 

 

 

... which is what we were after to begin with :)

 

 

Conclusion:

 

It may be a good idea to consider Matte/Shadow as a mtl that may not behave well when you have secondary illumination on. You can use it just fine, but to do so, just nest all your Matte/Shadow materials into Brazil Utility Materials so that you can decouple and control the appearance of the Matte/Shad object from its radiant properties.

 

Other materials that by their nature appear self illuminated or generally redefine how they respond to light in scenes (like toon shaders, cards, etc.) may need similar treatment when combined with secondary illumination.

Odnośnik do komentarza
Udostępnij na innych stronach

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się



×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Wykorzystujemy cookies. Przeczytaj więcej Polityka prywatności