View Full Version : surface shader and alpha channel -or a world of pain
07-22-2011, 10:35 AM
I've been trying to get the transparency to work on a surface shader just like it would work on any phong or lambert.
I'm working on a project that has everyhting painted in the textures. I.e. a flat illustrative look so the surfece shader seemed like the way to go.
I've been trying to make a tennis racket, the gaps between the strings should be taken care of by transparency. -simple right?
I've tried every possible file format, tiff, png, tga, jpg. I've tried to combine them i.e have a tga for the rgb and a png for the alpha. I've tried MR and software. I have checked the colour values of my alpha map. black is 0 and white is 255. I've tried when what should be transparent is actually transparent in the map and the other way round.
And I have tried all my maps on other materials and they work.
What makes this even stranger is that it works in the low quality viewport. But it goes wrong in the high quality and the render.
Working on maya 2012 sp2 tested on 2011 and does not work either.
So I guess my question is -is it even possible to get this to work or is it another bug to add to the list.
Or what would be the best way to buil a shader that is completely flat like the surface shader but has a straightforward way of dealing with transparency.
any help would be greatly appreciated.
07-22-2011, 10:43 AM
Just use a lambert with diffuse=0 ambient=1 then map your colour + transparency as normal.
07-22-2011, 11:01 AM
thanks a lot the lambert works, still wondering what the issue with surface shaders and transparency is though.
07-22-2011, 11:54 AM
in the past i noticed that Mental Ray was interpreting the alpha as inverted compared to maya software...
07-22-2011, 12:02 PM
in my case it does not work with either
07-22-2011, 12:04 PM
search rules! ;)
07-22-2011, 12:19 PM
I actually saw that post unfortunately it did not fix the problem for me. I think it might be something different in my case as for some reason it works when I use a ramp for the alpha???
I guess I'll be using the lambert diffuse ambient method as it gives me the best results with the least amount of clicks :)
07-22-2011, 12:43 PM
Well, really strange. It should work. I had that problem and it helped me.
Simply put your alpha texture to the trasparency of layered shader. Don't forget to change composition flag of your Layered Shader to Layered Texture and turn Alpha Is Luminance in apha texture on. Plug just color texture into out color slot of surface shader. And finally drop surface shader into layered shader. Thats it. :)
You dont even need that surface shader. Just connect your texture to the color slot of the layered shader. Lambert+ambient+alpha is probably gonna give you problems unless your your color texture is always on a black background. LayeredShader works well though.
07-22-2011, 03:39 PM
Thanks for correcting me. Its even simpler. :thumbsup:
07-22-2011, 03:39 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.