|
Tell us what you think of the site.
|
Autodesk Media & Entertainment User Community
|
Autodesk® 3ds Max®
|
|
Autodesk® Maya®
|
|
Autodesk® Softimage®
|
|
Autodesk® MotionBuilder®
|
|
Autodesk® Mudbox™
|
|
Autodesk® ImageModeler™
|
|
Autodesk® Sketchbook® Pro
|
|
Autodesk® Smoke on Mac®
|
| Alpha Channels not working in Mental Ray
|
|
|
Hi there,
I have a tree model, it’s leaves have a color node (picture of the leaf) and Alpha Transparency node (with an alpha channel map of the leaf)
Using Maya software render, the leaves render out good, with the alpha channel transparencies working fine.
When I render with Mental Ray though, the leave just look like square jpgs, showing the color maps in full with the transparency maps not working.
Any ideas on what I’m missing here?
(I already tried turning down the Shadow Attenuation in the Ray Trace options, that didn’t work)
Thanks in advance.
Rob
Autodesk Max 2010 (sometimes I use Max version 8)
Maya 2011, Mudbox 2010, Motion Builder 2010, Windows CP PC Pentium 3.4 Ghz, 2 GB RAM
|
|
|
|
At first I thought it might be your “ray depth limit”, but I tried this and it works fine at the mental ray default settings - so I think it may be the way you connected the transparency. You didn’t specify what format your images were, but since you said the result looks like just JPEGs, I assume that’s what you used.
Your transparency map should be a black leaf against a white background - connect the “Color” attribute of this to the “Transparency” attribute of the shader. JPEGS do not have an alpha channel.
|
|
|
|
|
Halfstone - you’re a pretty sharp guy. That’s right, TGA’s have the Alpha Channel, jpg’s do not. Looks like the transparency attribute is only plugged into the jpg transparency file, and color is plugged into the color map. I’ll give that a try. What’s throwing me off is that it rendered perfectly with the Maya Software Renderer, but not Mental Ray. Why does Maya S Renderer like it?
Author: lookin4info
|
| Replied: 05 February 2010 02:18 AM
|
|
|
|
|
|
Double checked it - It’s currently setup that way I believe. The color attrib of the leaf is plugged into the color jpg texture. The Transparency attrib is plugged into the transparency jpg (which is a white leaf against a black background - not a black leaf against white)
Do I need to invert the transparency to black leaf on white? Not sure how other than photoshop.
Author: lookin4info
|
| Replied: 05 February 2010 02:35 AM
|
|
|
|
|
Maya (and mental ray) both regard Black = 0, White = 1. When applied to a “Transparency” attribute, 0 = no transparency (opaque) and 1 = full transparency.
I would make three separate files in Photoshop - one with the picture of the leaf, one with the leaf filled in completely with black and the background completely white, and the third would be a grayscale image of the leaf against a black background.
In Maya, create a file texture node; import the picture of the leaf as the image, and connect it to the color attribute of your shader (I was using a blinn).
In the hypershade, select the file texture node, select “Edit - Duplicate - Duplicate with connections to the network”. (Use the “Edit” menu command from the hypershade, not the main menu). This gives you a new leaf, but it is connected to the same placement node as the original. Replace the image with the picture of the black leaf against the white background.
Drag this on top of your blinn material, and from the drop-down menu that appears, select “other”. This brings up the connection editor. In the left column, find the “color” attribute, and connect that to the “transparency” attribute on the right. Maya wants to connect alpha or transparency by default- you have to force this connection.
Finally, duplicate this again in the same way, replace the image with the grayscale image, and connect that to the “specular” attribute of the shader. You can adjust the specular by using the “Color Gain” slider for the image in the attribute editor.
|
|
|
|
|
Wow. This is great. Thanks for taking the time. So there are thousands of leaves already placed on the tree. Can I just replace the white on black image currently plugged into the transparency attribute with a new image of the black leaf on white bg? (They don’t have a specular node plugged in currently, but a nice feature to add)
So mental Ray treats the transparency the opposite way as the Maya Software renderer?
Author: lookin4info
|
| Replied: 05 February 2010 10:20 AM
|
|
|
|
|
Actually, this approach doesn’t work. I believe the issue lies in a mental ray setting that I’m missing, because the way these leaves are setup with image texture plugged into color, and white leaf on black jpg texture plugged into transparency - renders great with Maya Software render. I tested some tree cards that work the same way - and they don’t render right with mr either.
I want to use mr for the scene.
Autodesk Max 2010 (sometimes I use Max version 8)
Maya 2011, Mudbox 2010, Motion Builder 2010, Windows CP PC Pentium 3.4 Ghz, 2 GB RAM
|
|
|
|
If you want to post your scene, I’ll look at it. It worked fine for me on the default mr settings, so I’m not sure where to go from here.
|
|
|
|
|
I’m running Maya 2010. You? If you’re running an older version of Maya, will it open my ma file? or is there a way to save it backward compatible? Also - is there a place on this forum to post zip files or should I put it on my webserver? Thanks
Author: lookin4info
|
| Replied: 05 February 2010 02:56 PM
|
|
|
|
|
Ya know. Another thing I noticed. I went into the Visor: Paint Effects tab, under the Plants folder, I used the Mel script called Pine Needles.mel or any of those scripts; and painted some quick pine trees. They only render with Maya Software, but are invisible with mr render. I know there’s some simple little mr setting I’m missing.
BTW I’ve attached the zip file for my scene, just drag the “trees” folder onto your C: drive and you shouldn’t have to remap any of the textures.
Autodesk Max 2010 (sometimes I use Max version 8)
Maya 2011, Mudbox 2010, Motion Builder 2010, Windows CP PC Pentium 3.4 Ghz, 2 GB RAM
|
|
|
|
the problem was exactly as I had said before - first of all, your transparency map needs to be inverted; you are mapping transparency, not opacity - so black is opaque and white is transparent. Also, you need to map the COLOR of the transparency map to the TRANSPARENCY of the shader. You are trying to map the transparency of the map, which doesn’t exist in a JPEG.
There is no way to save a file so that it is backwards compatible, but in your File-Open options you can click on “Ignore Version”, or you can edit the .ma file so that version info at the top of the script matches the version you are using.
I don’t know enough about Paint Effects and mental ray to offer anything meaningful, except that you can always convert Paint Effects strokes to polygons.
|
|
|
halfstone 05 February 2010 02:32 PM
In Maya, create a file texture node; import the picture of the leaf as the image, and connect it to the color attribute of your shader (I was using a blinn).
In the hypershade, select the file texture node, select “Edit - Duplicate - Duplicate with connections to the network”. (Use the “Edit” menu command from the hypershade, not the main menu). This gives you a new leaf, but it is connected to the same placement node as the original. Replace the image with the picture of the black leaf against the white background.
Drag this on top of your blinn material, and from the drop-down menu that appears, select “other”. This brings up the connection editor. In the left column, find the “color” attribute, and connect that to the “transparency” attribute on the right. Maya wants to connect alpha or transparency by default- you have to force this connection.
Thanks again for your help. Were you able to open my tree file?
So I tried your procedure above, I’m assuming by “color” attribute in connection editor, you meant outColor? Because the 4 choices on the left are defaultColor, colorGain, and colorOffset, none of which get a result, but outColor got rid of some of the outer areas of the map, although there is a transparent light gray tint to the edges around the tree.
Is there a setting to improve this? Also - Is there a way to just modify my existing textures through the attribute editor, because I have trees with hundreds of leaves carefully positioned, based on the same texture - I suppose I could just assign my new blinn to all of them if the only way is to force it via Connection Editor.
Autodesk Max 2010 (sometimes I use Max version 8)
Maya 2011, Mudbox 2010, Motion Builder 2010, Windows CP PC Pentium 3.4 Ghz, 2 GB RAM
|
|
|
halfstone 06 February 2010 12:14 PM
I don’t know enough about Paint Effects and mental ray to offer anything meaningful, except that you can always convert Paint Effects strokes to polygons.
BTW
I was able to convert all the paint effects to polygons and they render now in mr. Thanks for that tip as well.
Autodesk Max 2010 (sometimes I use Max version 8)
Maya 2011, Mudbox 2010, Motion Builder 2010, Windows CP PC Pentium 3.4 Ghz, 2 GB RAM
|
|
|
|
halfstone rocks!
As Maya has a million different ways to do things I wanted to add a suggestion to the fray.
There is a useful little attribute on the file in node that helps work around files that don’t have an alpha.
Connect your files the basic way for color and transparency(clicking on the checked box and selecting your file) By default this connects outColor to Color and outTransparency to Transparency. As you found this works for Maya software...but mental ray is the problem.
To fix it do the following.
Under Color Balance on the File in Node for your tree_a_alp you can check ‘Alpha is Luminance’
and you should be all set to render in Mental Ray now.
While this works...it is good to take all of the other stuff mentioned to heart.
I attached a setup file just in case I wasn’t clear.
All the best.
~Ben
|
|
|
|
|
Hi, i’m sorry i have a problem related to the one above.
I’ll do an example with the scene of the tree in this post so we can understand better the point: if I put a directional light in that scene the poligon will cast the shadow of the tree, but also a light shadow shaped as the poligon himself, this with raytracing shadows activated and light angle 3.0, shadow rays 20 and ray depth limit 1.
I also tried to put an higher value to ray depth limit but it seems not to change anything.
I’d like to have a clean shadow of the tree, without the shadow of the poligon.
Can you help me?
Thanks a lot
Mauro
Author: Gesù
|
| Replied: 12 March 2010 03:01 AM
|
|
|
|
Animated Fox 06 February 2010 11:20 PM
halfstone rocks!
As Maya has a million different ways to do things I wanted to add a suggestion to the fray.
There is a useful little attribute on the file in node that helps work around files that don’t have an alpha.
Connect your files the basic way for color and transparency(clicking on the checked box and selecting your file) By default this connects outColor to Color and outTransparency to Transparency. As you found this works for Maya software...but mental ray is the problem.
To fix it do the following.
Under Color Balance on the File in Node for your tree_a_alp you can check ‘Alpha is Luminance’
and you should be all set to render in Mental Ray now.
While this works...it is good to take all of the other stuff mentioned to heart.
I attached a setup file just in case I wasn’t clear.
All the best.
~Ben
Ha ha ha hahah haha ha!!!! Halfstone Rocks! And Ben Rocks! “Alpha is luminance” worked like a charm. I new it was some simple setting I was missing. Thank you both very much - I can now proceed as a critical roadblock is now gone! mr is quirky - maybe that’s why it’s initials are “mr”
(but it looks so good - especially the “Physical Sun and Sky” feature, which is one of the reasons why I want to use it.
Autodesk Max 2010 (sometimes I use Max version 8)
Maya 2011, Mudbox 2010, Motion Builder 2010, Windows CP PC Pentium 3.4 Ghz, 2 GB RAM
|
|
|
|