FORUMS: list search recent posts

Transparancy mapping

COW Forums : Autodesk Maya

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
David Lee
Transparancy mapping
on Oct 29, 2010 at 12:47:25 pm

Hello everyone.
Here's a little problem that cannot seem to get round.
I am trying to apply an image of a leaf onto a polygon plane.
I have set up the image in photo shop with the leaf on one layer with transparent Background.
I have saved it as a .png file and applied the image to the colour swatch in maya.
The material looks good in hypershade and the view port.
I set up a light and apply raytrace shadows because i want to see shadows cast on the ground
When i render the image i get a feint grey area around the leaf. its as if the leaf image background was not totally transparent.
Any ideas?


Return to posts index

Michael Frank
Re: Transparancy mapping
on Oct 29, 2010 at 4:08:03 pm

Tried to set up something similar and couldn't recreate the issue. You mean that the area that is transparent is casting a semi-transparent shadow?

Can you post up a pic?

Mike Frank
Cave House Studios


Return to posts index

David Lee
Re: Transparancy mapping
on Oct 29, 2010 at 4:29:07 pm




This was rendered with mental ray rendering. one point light with ray traced shadows.


Return to posts index


Michael Frank
Re: Transparancy mapping
on Oct 31, 2010 at 4:15:16 pm

Yeah, I still can't manage to recreate this. I feel like I've had this problem before but can't remember how I worked around it. I might have made a separate transparency map per Sho's advice..

It's almost like the material has some specularity or some other attribute that is getting picked up on and is not affected by the transparency mapping. Maybe the alpha -looks- 100% transparent and is really only 95%? I dunno.. without your png file to play with, I can't seem to duplicate the issue.

Mike Frank
Cave House Studios


Return to posts index

Earl Peters
Re: Transparancy mapping
on Jun 5, 2013 at 1:42:52 pm

Hi,i know how to solve that problem, in the leafs material tab go to Raytrace options and bring Shadow attenuation to 0.


Return to posts index

Sho Pi
Re: Transparancy mapping
on Oct 30, 2010 at 3:17:49 am

There are two things going on. First, the .png file is not a suitable file for good clean rendering for a few reasons. You wouldn't use a .gif either. You are better off using .jpg or .bmp files than .png, but .iff files, .tif's, etc. are much better.

Second, do you have "Alpha is Luminance" checked in your file node's attributes? This should let you use a .pgn file properly anyway, but you should move away from this file type. Sure, you need two files if you used a .bmp file (one for alpha, grayscale only and on RGB), but if you're using mental ray properly then they'll be converted to .map files anyway. The speed gain is far worth the (generally) minimal conversion time, especially multiplied throughout all the rendering aspects...


Hope these ideas help!


Return to posts index


John LaBrie
Re: Transparancy mapping
on Nov 2, 2010 at 8:59:27 pm

I have a similar problem... so here's a couple of my own questions:

(1) Where can I find this "Alpha is luminance" checkbox?
(2) Do you have to use Raytrace Shadows to get the shadow of the opaque part of your texture, or can you do it with the Depth Map Shadows?

The reason I am asking is because I am "faking" a fancy frame for a painting on the wall by using a .jpg for its color and a .gif (black and white basically) for its transparency. The color part of the frame shows up correctly, but the shadow still shows up rectangular - ie. ignores the transparency map.

I am using Depth Map Shadows because when I turn on my Raytrace Shadows instead, I get no shadows at all for some reason. Please advise me about why I might get no shadows when using the Raytrace option.

Lastly, I just have one more question to throw into this mess:

(3) How do I make my object (the painting on the wall) be self-illuminated and ignore lighting that's in the scene?

Thanks for helping me answer all these questions!!


Return to posts index

Sho Pi
Re: Transparancy mapping
on Nov 2, 2010 at 9:39:17 pm

1. "Alpha is Luminance" is located in the File Node attributes, under the Color Balance section. You should not be using .gif files with Maya, nor .png files. You would be better off using your alpha channel as a separate .jpg file for many, many reasons, but .bmp, .iff, and .tiff are the best for quality. If you're using mental ray properly, all these types will be converted to memory-mapped textures anyway at rendertime (.map format), so the smaller the file, the quicker the conversion, but you also sacrifice quality a bit. Also, do not use Quadratic filtering (default) for the File Node of your alpha, mipmap with a filter of .2 is best generally.

2. Raytrace shadows should always be used for tracing such things, as Depth Shadows are simply for basic scenes where speed is a big factor, and they also don't work well with transparency and glass (for example) without cranking up the sampling so high it's almost as slow as raytracing, anyway.
To get raytraced shadows to work, you'll need your lights to be casting raytrace shadow-rays, and their depth at least 1. You'll need your ray-depth set properly in the Render Settings. And you'll need Cast and Receive shadows "On" for your objects themselves. There may be other issues, but that's the general rundown.

3. For the object to ignore scene lighting, there are many options. You can use light-linking, you can turn off "Illuminates by default" for your lights, but the best way is to control your lighting with passes or with a second render, then composite the two together in Photoshop or After Effects/Nuke/Whatever. You can do two renders, or one .exr file with both passes. This is a complex workflow, but start with the two-render method first and you should be fine!

For self-illumination... you'll still need a light. How does a painting light itself? One "trick" you can do is to connect your file texture to the Ambient Color of your material (Blinn, etc.) as well as the Diffuse. But if you're using the mia_material_x (and you should be, if you're using mental ray), then use the "Additional Color" slot. But both techniques are more for say, glowing signs, etc.


Return to posts index

John LaBrie
Re: Transparancy mapping
on Nov 2, 2010 at 10:18:06 pm

Thank you for the excellent reply, I will try all these things now.

One note - why I was using .gif for transparency? Because I had bad experience using .jpg for bump maps. As .jpg has artifacts around areas of detail, my bump maps were not "clean" - as the artifacts would create a rough area around the bumps which would show up in close-ups. So, I used .gif with only 8 colors - and that gave me a really tiny file size with a really clean bump map.

I thought it would be good to use the same for opacity, .gif with an adaptive 8 color palette. This way my opacity map would be clean and tiny in file size. I wonder why you recommend not using .gif when we're dealing with basically a black and white image with perhaps a few shades of gray to anti alias the edges. I thought .gif would be the perfect format for that.


Return to posts index


Sho Pi
Re: Transparancy mapping
on Nov 2, 2010 at 11:13:30 pm

To make your bump maps cleaner with .jpg's, make sure the compression of your output .jpg is very high (90% or more) and use a mipmap filter of .2, and adjust the filter level itself to compensate if necessary. The default File Node filter is Quadratic at 1, for example, which will blur and mess with your .jpg compression. Hope this helps!


Return to posts index

John LaBrie
Re: Transparancy mapping
on Nov 3, 2010 at 2:14:30 pm

Yup, couldn't ask for better help. This forum really rocks!!


Return to posts index

John LaBrie
Re: Transparency mapping
on Nov 3, 2010 at 6:58:18 pm

Ok, see if I can insert a picture, never tried it before:

1240_diningset.jpeg.zip

If you can see the picture (hope it worked), notice the painting on the wall. The shadow is the same problem as David Lee had with his leaf. The paining is of course a single plane, I am "faking it".

I tried everything, including switching file formats for the opacity map, and turning on/off the alpha is luminance checkbox. I am using Lambert material, so there's no shininess.

I tried .tif, .jpg, .gif, .png but all with the same result. I didn't try .iff because Photoshop doesn't save in this format. Does anyone have a solution or idea of what else I could do?


Return to posts index


Sho Pi
Re: Transparency mapping
on Nov 3, 2010 at 7:15:26 pm

My first guess would be that your alpha is "not clean", or that your whites and blacks are not true whites and blacks. I use alpha textures all the time, so you should know there's a light at the end of the tunnel - it WILL work, just gotta figure out what's wrong with your image files!

Since you're having so much trouble, you should consider switching to a mental ray material (I assume you're rendering in MR, given the indirect lighting?). If you're using the mia_mat_x, the "Cutout Opacity" slot handles exactly that, whereas with a Lambert or Blinn, it's simply part of the transparency. The mia_mat_x's transparency is entirely separate from the cutout opacity, making it superior in all ways.


Your image did NOT post, but I was able to download it. I believe you directly link via HTML, here's my first attempt though, my latest from the recent lighting challenge at CGTalk. Note the massive use of cutout opacity to make the leaves work properly:



Return to posts index

John LaBrie
Re: Transparency mapping
on Nov 3, 2010 at 10:59:48 pm

Wow, that's a beautiful scene!

Actually, I don't know if I'm using Mental Ray. I'm quite new to Maya and the indirect lighting you see in my scene is just 2 lights - a key light, and a rim light which is basically a blueish direct light set for specularity only.

I'll try to follow up on what you wrote, and see if I can get it to use Mental Ray with the appropriate material types. Thanks for your advice, and your patience since I know so little about Maya. I do know 3D Studio Max much better and I use Mental Ray there, but right now I'm taking an internet course to learn Maya.


Return to posts index

matt HIcks
Re: Transparancy mapping
on Nov 16, 2010 at 2:42:37 pm

"First, the .png file is not a suitable file for good clean rendering for a few reasons. You wouldn't use a .gif either. You are better off using .jpg or .bmp files than .png, but .iff files, .tif's, etc. are much better."

This is just plain wrong. PNG's are far more suitable for rendering than JPEG as they are lossless and don't contain compression artifacts a la JPEG.


Return to posts index


Sho Pi
Re: Transparancy mapping
on Nov 16, 2010 at 5:59:08 pm

"This is just plain wrong. PNG's are far more suitable for rendering than JPEG as they are lossless and don't contain compression artifacts a la JPEG."

I'm not arguing that the .png file is a better file format than .jpg in general. But Maya doesn't play well with .png files for a multitude of reasons, including the ones I already listed here.

Go ahead and keep using them yourself.


Return to posts index

matt HIcks
Re: Transparancy mapping
on Nov 16, 2010 at 6:14:36 pm

"I'm not arguing that the .png file is a better file format than .jpg in general"

I know, you're saying the exact opposite, that JPEG's is a better format to use than PNG's in Maya.

" for a multitude of reasons, including the ones I already listed here."

You haven't listed any reasons. You've just said it would be better not to use them and use JPEG instead, which is fine, but misinformed. JPEG is a lossless format , which if anything will create artifacts.
PNG's work fine in Maya with mental ray.


Return to posts index

Sho Pi
Re: Transparancy mapping
on Nov 16, 2010 at 6:24:49 pm

Now now, son. There's no reason to get upset or angry about this topic.

.png files aren't lossless - they simply have a more efficient compression method than other formats.

You can use them all you want, but since the Original Poster was having problems with .png files, and especially their alpha channels, I suggested other file types as an alternative. This suggestion should have no bearing on your emotional state. Relax.


Return to posts index

matt HIcks
Re: Transparancy mapping
on Nov 16, 2010 at 6:35:19 pm

From Wikipedia - http://en.wikipedia.org/wiki/Portable_Network_Graphics

Filename extension .png
Internet media type image/png
Type code PNGf
PNG
Uniform Type Identifier public.png
Developed by PNG Development Group (donated to W3C)
Initial release October 1, 1996
Type of format lossless bitmap image format
Extended to APNG, JNG and MNG
Standard(s) ISO 15948, IETF RFC 2083
Open format? Yes


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]