Jump to content

Reflection Pass With Alpha?


Recommended Posts

Hi, I have a question about reflection pass.Is it possible in Houdini to create reflection pass with cutout alpha for the actual reflection.In XSI this is pretty easy, you just turn of diffuse, spec, etc on the actual shader and you done.

I tried to use Vex with simple reflective material also layered shader making the diffuse value to 0 but I still get the alpha for entire object.

Any ideas how to achieve that?

Link to comment
Share on other sites

Although this could be perhaps possible to achieve in one of Houdini's shader, the way such tasks are usually accomplished in Houdini is VEX/VOPS, it's flexible and has to be done only one time, later on you can use your own spacial shaders library:

Create new VEX Surface SHOP Type. Jump inside pressing i key on it. Add Reflective VOP and/or Environment VOP. The first one will use ray trace if allowed (if you won't turn it off in Mantra), the second uses only environmental maps. If your alpha for cutoff matte comes from a texture, add also TextureVOP (add Shading Layer Parameter, convert uv vector to floats and wire it to TextureVOP s and t). Change Signature in TextureVOP for RGBA (default is RGB). Convert vector4 to vector3 and multiply forth component by Reflectance VOP and/or Environment VOP. Wire it to Cf output.

You can also wire output of your final multiplication to ParameterVOP (set the proper type). Than you could save Cf as usual colour pass and setup Mantra ROP to output deepraster with a reflectance.

hope this helps,

cheers,

sy.

EDIT:

I reread your post. It seems that what you're after it's just a reflective component without special alpha treatment, right? If so all TextureVOP business above you can omit. Just use Reflective or Environment VOPs and wire it to Cf. Also any reflection involved shader from gallery can do this by turning off other components. Check Chrome for example.

Edited by SYmek
Link to comment
Share on other sites

Thank you very much for step by step explanation, I tried to follow each step but I still can't get it to work , maybe i am doing something wrong .If you get a chance can you please post some example file.

EDIT:

I reread your post. It seems that what you're after it's just a reflective component without special alpha treatment, right? If so all TextureVOP business above you can omit. Just use Reflective or Environment VOPs and wire it to Cf. Also any reflection involved shader from gallery can do this by turning off other components. Check Chrome for example.

Here is exactly what I meen:

First one is the alpha that I am looking for, second one is rgb pass and the third one is what i am geting in Houdini

post-2944-1205191016_thumb.jpg

post-2944-1205191033_thumb.jpg

post-2944-1205191057_thumb.jpg

Edited by T.I.M.
Link to comment
Share on other sites

It's hard to believe that you can get alpha on primary rays and set diiffuse on secondary on default shader by turning off other components than reflectance... pretty unintuitive for me, something more had to happened here, but anyway, the easiest code follows:

surface
apha_refl() {

	if (getraylevel() != 0) {

		vector nml = frontface(normalize(N), I );
		Cf = diffuse(nml);

	} else {

		Cf = Af;
	}
}

post-744-1205199323_thumb.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...