PDA

View Full Version : Mia x alpha


miQlo
09-19-2011, 01:13 PM
This problem has probably been answered hundreds of times, sorry for bringing it up again but I can't find those threads.

I'm trying to do a simple mia x network with a layered texture. I have two layers in the LayerdTexture node. The left layer is a PSD with a color layer and a alpha layer. The right layer is the base color I want to have on my material. The alpha input should mask out the color input so that the magenta background is visible behind the logo. As you see in the images below something goes wrong. There is a dark frame around the texture.
What am I doing wrong? I have spent two days on this and I can't figure it out.

http://forums.cgsociety.org/attachment.php?attachmentid=164135&stc=1
http://forums.cgsociety.org/attachment.php?attachmentid=164133&stc=1
http://forums.cgsociety.org/attachment.php?attachmentid=164132&stc=1

nookie
09-19-2011, 01:29 PM
try changing the "default color" in the "color balance" tab in the file node (like white for the color testure and black for the alpha texture). That`s the color used in the space outside the UV 0-1 when the texture is not wrapped (so now you have like 0.5 transparency)

miQlo
09-19-2011, 02:17 PM
Thanks nookie, that worked. But is the network correct? The colors looks a bit dull don't you think?
I just read that the LayerdTexture node doesn't work in Mental Ray and that you should use the mib_color_mix instead. I'm experimenting with it right now.

http://forums.cgsociety.org/attachment.php?attachmentid=164136&stc=1

miQlo
09-19-2011, 02:41 PM
Isn't there a way to directly connect the alpha output to the mia x diffuse. It sounds like the diffuseA input of the mia x should be the right input but nothing happens when you connect to it.

kuschel33
09-19-2011, 03:38 PM
You should connect you alpha file to the cutout opacity of the mia_x shader.

nookie
09-19-2011, 04:35 PM
if you need to layer textures I think this is the way to go
http://img405.imageshack.us/img405/3065/screenum.jpg (http://imageshack.us/photo/my-images/405/screenum.jpg/)

Uploaded with ImageShack.us (http://imageshack.us)

If you need to layer shaders I would just make a texture for the alpha and connect that one to the weight.
BTW, take care of premultiply while doing this or you will get artifacts on the borders :)

miQlo
09-20-2011, 08:29 AM
kuschel33: cutout opacity makes the object completely invisible where it has a black mask, that is not what I'm after.

nookie: Finally, it's working. I had made the same network as you before but I didn't know about the "alpha is luminance" option, so obviosly it didnt work.

What do you mean with "premultiply", is it a blending mode in the mib_color_mix?

nookie
09-20-2011, 09:53 AM
check this

http://www.digitalartform.com/alphaChannel.htm (Method 2)

and maybe google it a little bit (premultiply and unpremultiply), it's quite an important subject :)

miQlo
09-20-2011, 11:56 AM
Ok I see the problem. This could also be a way to do it right? It's certainly already mentioned somewhere but I came up with it now. Instead of alternative 1 you go with alternative 2.

http://forums.cgsociety.org/attachment.php?attachmentid=164158&stc=1

nookie
09-20-2011, 03:35 PM
yeah that's a nice way to avoid the black border!
If you are using rendered images just disable premultiply, you'll get an aliased edge in the color and an antialiased alpha... when you multiply the two of them in a comp app (or whatever) you'll get a nice border without the black line :)

miQlo
09-23-2011, 11:11 AM
Just read about premultiply in the maya documentation. Thanks allot for that tip, I didn't know about that option.

For others who doesn't know about it it's under "render settings>quality>framebuffer" and you can read more about it here (http://download.autodesk.com/global/docs/maya2012/en_us/index.html?url=files/Rendering_Windows_and_Editors_Render_Settings_mental_ray_tab.htm,topicNumber=d28e601499)(scroll down to framebuffer)

Mille grazie ;)

CGTalk Moderation
09-23-2011, 11:11 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.