PDA

View Full Version : mib_color_mix trouble, save me!


Hakushinkan
07-12-2010, 03:00 PM
Hey guys

I'm modeling a car, and using the chance to study some mental ray in the process.

I'm trying to apply a few "stickers" on the metal of the car, like stripes on the side etc...

I'm using the mib_color_mix shader to combine the 2 maps.
I can use maya's layered shader (which works fine) but it looks awful and unrealistic, so I'm trying it out with mental ray.

I'm using this setup:
(1) A Blinn, textured with the stripes file, which has the stripes with color and everything else is alpha (if I place only the blinn on my car, I'll have stripes floating in the air).
(2) Mental Ray car paint shader.
(3) mib_color_mix

As the base coat on the color mixer (color 0) I plug the car paint shader.
I plug the alpha of the texture map to the color mixer, color 1.
I plug the outcolor of the blinn to the color mixer, also on color 1.

I then connect the color mixer to the blinn's material and shadow shaders, and I apply the blinn material onto my object.

Now, I never get it to work!
I just have no idea what to do. Whatever I did do, I don't even know if it's the right thing to do - it's just the thing that got me closest to my goal.

With the settings above, I can see the stripes on the car, but either I don't see the paint under (I just see plain white instead), or the color appears very VERY reflective, white-ish... not the crimson red it's supposed to be. and on it, the stripes are reddish, instead of the black they're supposed to be.

So if anyone knows anything about this, I'd really appreciate the help.

I have a file with the stripes, on which the stripes are colored and everything else is alpha.
I want to apply it on a layer of the car paint shader, without effecting the car paint.


Thanks!

chuckie7413
07-12-2010, 03:45 PM
here is a little video tutorial posted on mymentalray.com

http://www.mymentalray.com/index.php?option=com_shaders&Itemid=127&Action=DisplayDetail&ObjectId=71

you might need to register to view it.

it uses the mixlayer shader which is a third party layered shader. However you can do exaclty the same with the mib_color_mix shader.

Best,

Rich

Hakushinkan
07-12-2010, 03:48 PM
here is a little video tutorial posted on mymentalray.com

http://www.mymentalray.com/index.php?option=com_shaders&Itemid=127&Action=DisplayDetail&ObjectId=71

you might need to register to view it.

it uses the mixlayer shader which is a third party layered shader. However you can do exaclty the same with the mib_color_mix shader.

Best,

Rich

Thanks, I saw this tutorial and that's what inspired me to attempt the method I described above.
It worked partially, but sadly something's probably wrong and I really have no idea what... =\

chuckie7413
07-12-2010, 03:59 PM
can you post a pic of what your color_mix node looks like (attribute editor)

Hakushinkan
07-12-2010, 04:15 PM
can you post a pic of what your color_mix node looks like (attribute editor)

Yeah, there it is: (I'm using a mod DJX made for the color mixer, so I included 2 versions - the modded and unmodded one)

http://picasaweb.google.com/HakuShinkan/ImageSharing#5493037309598483970

http://picasaweb.google.com/HakuShinkan/ImageSharing#5493042019800095250

Those are the 2.
To my knowledge, they're setup the same way.
Edit - Actually, the unmodded one has a mistake in the node setup. Car paint should go to base color, texture should go to color 0. That's what I know anyway.

Hakushinkan
07-13-2010, 01:42 AM
I have now tried a new setup:

I used a blinn as nothing but a "mule".
I assigned it to my object, and assigned the mib_color_mix to the material and shadow shaders of the blinn.

The color mix had the stripes map layer on top of the car paint layer.
At first it worked, but the stripes were white instead of black. The car paint was great though, and that's a first.

when I tried it again, suddenly it all went black, no stripes, no car paint, just a black car.

I'm really at a loss with this.

djx
07-13-2010, 03:53 AM
I'll comment on your use of dj_mix_colors in the picture.
Make sure you render with mentalray (red border in hypershade means not mentalray).
Use mode=mix (not add)
Additional colors=1 (not 0)
File must have alpha channel, if not, make sure "alpha is luminance" is checked.
If just stripes, do not connect file to blinn. Even if you need file for badge texture, use blinn for color only, with no transparency.

good luck

David

Hakushinkan
07-13-2010, 10:59 AM
I'll comment on your use of dj_mix_colors in the picture.
Make sure you render with mentalray (red border in hypershade means not mentalray).
Use mode=mix (not add)
Additional colors=1 (not 0)
File must have alpha channel, if not, make sure "alpha is luminance" is checked.
If just stripes, do not connect file to blinn. Even if you need file for badge texture, use blinn for color only, with no transparency.

good luck

David

Thank you for the answer.
I tried what you said, and it seemed to change some stuff but it's still not working for some reason.

here's what the settings look like now:
http://picasaweb.google.com/HakuShinkan/ImageSharing#5493327435256457474

I tested it on a separate file, and it worked once only the red (car paint) was more like a pink, as if the white part of the stripes map (what's supposed to be alpha) is brightening it.

Other than that result, all attempts ended in either a gray surface with black stripes, or a black surface with no stripes, or a white surface with black stripes.

I could never get it to show the car paint as the surface, with the black stripes on it.

Thanks again for all the help.

djx
07-13-2010, 11:32 AM
you have it all round the wrong way.
try:

carpaint to dj mix color 0
blinn to dj mix color 1
fileTex out alpha to dj mix weight 1

do not connect file to blinn
blinn transparency = 0
blinn color = what ever color you want for stripe.

disconnect dj mix from shadow shader - leave this blank.

fileTex must be white where you want stripes, black where you want car paint.

David

Hakushinkan
07-13-2010, 12:26 PM
you have it all round the wrong way.
try:

carpaint to dj mix color 0
blinn to dj mix color 1
fileTex out alpha to dj mix weight 1

do not connect file to blinn
blinn transparency = 0
blinn color = what ever color you want for stripe.

disconnect dj mix from shadow shader - leave this blank.

fileTex must be white where you want stripes, black where you want car paint.

David

Damn, it works!
Well, at least on the test file.
Thanks a lot!

I tried it on my the file car with these settings:
http://picasaweb.google.com/HakuShinkan/ImageSharing#5493349658434756162

The car stays completely black.
If I understood correctly, the texture is connected for alpha purposes only, right?
So blinn is for the top color, which is covered by the alpha of the texture, which reveals the lower layer of the car paint.

I think for some reason then, the car paint is showing up black.
Any reason that might happen on the car file and not on the test file?

Edit: I've solved it. I thought, the only thing that could make something pitch black with highlights only in a scene, is a photon emitting black light. :P

Thanks a LOT! You've really helped me not only to do it right, but to understand the mechanics as well.
Here's the current test:
http://picasaweb.google.com/HakuShinkan/ImageSharing#5493358558432217826

The top is still textured with maya materials. Now it's finally time to take another step forward. Been stuck on this for the past 3 days. At least I learned a lot about mental ray in the process. :)

CGTalk Moderation
07-13-2010, 12:26 PM
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.