Can someone explain how to use Mantrasurface shader alpha?

   5110   4   0
User Avatar
Member
6 posts
Joined: Sept. 2016
Offline
I started to play with Houdini and I find its workflow fascinating. Now I tried to do a simple task which is to assign a png texture with alpha to a grid. But I could not succeed…

I found some solutions but they seems too advanced for my knowledge (for e.g. any texture vop node by default is set as RGB. you can choose RGBA from that menu and the output of texture becomes a vector4 type. Connect it into a vector4-to-float vop and the 4th float is the Alpha channel you can use as a ‘mask’ for the texture itself or other purposes.) It is quite confusing for a beginner


Can someone give me a step-by-step guide how to set Mantrasurface shader to make use of the alpha channel of the PNG?

Thanks a lot,
Edited by Lava_boy_2010 - Nov. 23, 2016 14:15:12
User Avatar
Member
240 posts
Joined: March 2015
Offline
Hi, a simple method is to use a black/white image on the Opacity tab.

ie.
1. Instead of using a textured image's alpha channel, save that alpha channel as a separate black and white image.
2. Go to the Opacity tab on the Mantra Surface shader.
3. Enable “use map” on color.

If you want to use an embedded alpha, you'll probably need to dive into the Mantra Surface shader and alter a few things. (ie. probably something like the information you found)

hope that helps
Rob
User Avatar
Member
6 posts
Joined: Sept. 2016
Offline
Dear Rob,

Thank you so much! The only problem now the texture is not visible in viewport, only in the render Is there a fix for that?

Thank you again,

LaVelle
User Avatar
Member
240 posts
Joined: March 2015
Offline
Hi, I think this is an issue with the opengl part of the shader. (I'm using an AMD card so it's not a good testing point)

As you've noticed, it will display in the viewport if you use a transparent png as a diffuse map. If you check the opengl tab on the Mantra shader, the OGL Alpha is what displays that transparency in the viewport.
There is an OGL opacity section at the bottom of this tab which should reference the opacity texture. This seems to override the OGL Alpha and I've not seen this work which might be due to my graphics card or file type. (might be worth trying some different file types)

So a workaround is to:
1. Use a transparent png as diffuse map for viewport.
2. Use the black/white image as opacity map for render.
3. Disable OGL opacity map (to enable OGL Alpha in viewport again)

hope that helps
Rob
User Avatar
Member
6 posts
Joined: Sept. 2016
Offline
Hi Rob,

Thank you so much for your help. Now, all works as expected.


LaVelle
  • Quick Links