PDA

View Full Version : Get my grunge details back in mib_color_mix? (or mix8Layer)


jasonhuang1115
10-19-2009, 08:39 PM
Hi,

I have been trying over the weekend to get this solved but in vain.
What I want to get is simply layering a grunge texture ( assigned to a Lambert shader or just a surface shader) on top of a mia material. But I lost great amount of details when layering shaders using either the mib_color_mix or mix8layer (haven't tried djx_color_mix yet). I use a really simple scene as a test.

Render of the grunge texture assigned to a surface shader.
http://screensnapr.com/u/59m2fv.png

I then save the grunge (only) with transparency as a TIFF.
http://screensnapr.com/u/w3j6zc.png

Using mib_color_mix, pure white surface shader as the color_0. Grunge texture assigned to a 2nd surface shader and assign the 2nd surface shader to color_1. The shading network is:
http://screensnapr.com/u/uvlwls.png
http://screensnapr.com/u/8k2rrp.png

And the render:
http://screensnapr.com/u/fsnf82.png

A lot of details are lost. I tried different blending modes as well as masks for the weight as mentioned by djx in his blog, but still the details are lost. How to get them back? (scene file attached)

- Jason

djx
10-20-2009, 01:33 AM
Maya does not handle premultiplied colors very well when layering. In your example your color is faded in both the color and the alpha channel, so mib_color_mix is doubling up the effect. To fix it in this example you could make a selection from your grunge layer in photoshop and use it to create an alpha channel, then create a black layer under your grunge layer and merge the two. When you save the file this time, the transparency is only in the alpha channel, so maya will layer it correctly.

-- David

jasonhuang1115
10-20-2009, 05:04 PM
Thank you David for taking the time. :)

I did some more tests based on your suggestion, but unfortunately it still is not working. I think the problem is rooted from how these mib_color_mix or mix8layer (haven't tried your djx_color_mix just yet) handle semi-transparent texture and its alpha.

To clarify the problem, I save the PSD shown below as a TIFF without alpha, and render with a single layer mib_color_mix. All the grunge details are preserved.
http://screensnapr.com/u/t3zxca.png
http://screensnapr.com/u/ntpvfj.png

Then, I did what you mentioned, create an alpha based on the grunge, merge the grunge layer down with the black layer (get rid of the yellow first), save it as TIFF with alpha,
http://screensnapr.com/u/gxw6v1.png
http://screensnapr.com/u/ewszuw.png

Set up the mib_color_mix as you mentioned in the blog post, including the (reverse) alpha for weight_0 and weight_1. The grunge details are still lost in the render.
http://screensnapr.com/u/8ic3g7.png

I played with different blending modes or ways of using alphas in the "weight" slot, but I just couldn't figure a way to make the grunge layer on top of the base just like seen in Photoshop. There is got to be a way to set up a dirt layer on top of the base paint while preserving all details right??

scene file and texture PSD in here if you are interested: scene and PSD (http://rcpt.yousendit.com/757701247/addb1ae88e2aac7bce452578ba275eec)

djx
10-21-2009, 12:13 AM
Your alpha channel is not correct. When I open your psd and look at the alpha it is very dark, and I'm guessing you made it based on the luminance of your grunge layer.

What you need to do is ctrl-click on the grunge layer to get a selection based on transparency, then in the alpha channel, start with black and use that selection to fill with white. You should see a much brighter result. I've uploaded my version here (http://www.djx.com.au/cgtalk/grunge/grunge_DJ001.zip).

-- David

jasonhuang1115
10-21-2009, 03:31 AM
YOU ARE THE MAN!!! It works! :beer:

Thank you!

- Jason

CGTalk Moderation
10-21-2009, 03:31 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.