Jump to content

translucency


MENOZ

Recommended Posts

hello.

i'm trying to create a translucency effect in VOP.

i tried the translucency shader that comes with houdini, but it doesn't work.

the maple leaf shader works <_<

i looked in the network and the way the translucency effect is built seems to be the same.

i don't understand why one works and the other doesn't.

anyway, i'm not shure about using the frontFace vop, instead of the isFrontFace, because this should give me a varying translucency effect, is this correct?

if i use isFrontFace to control the bias of the mixLambertColor it works. but how can i blur the shadow of the objects behind?.

thank you!

Link to comment
Share on other sites

hello.

i'm trying to create a translucency effect in VOP.

i tried the translucency shader that comes with houdini, but it doesn't work.

the maple leaf shader works <_<

i looked in the network and the way the translucency effect is built seems to be the same.

i don't understand why one works and the other doesn't.

anyway, i'm not shure about using the frontFace vop, instead of the isFrontFace, because this should give me a varying translucency effect, is this correct?

if i use isFrontFace to control the bias of the mixLambertColor it works. but how can i blur the shadow of the objects behind?.

thank you!

is there a node that can blur or filter a color? in VOP.

Link to comment
Share on other sites

is there a node that can blur or filter a color? in VOP.

Definitely a job for point cloud... unless you don't want to multi-sample shadows.

EDIT: sorry, just reread previous post... doesn't blurry depth maps work for you?

Edited by SYmek
Link to comment
Share on other sites

Definitely a job for point cloud... unless you don't want to multi-sample shadows.

EDIT: sorry, just reread previous post... doesn't blurry depth maps work for you?

yes, if i use blurred shadow it works, but i have blurred shadow on the other side too.

could you make me an example with point clouds please?

thanks!

Link to comment
Share on other sites

yes, if i use blurred shadow it works, but i have blurred shadow on the other side too.

could you make me an example with point clouds please?

thanks!

Hi MENOZ,

sorry for late answer. I hadn't time to play with it. This is just a quick example of what I meant. By no means this is accurate or correct. Some corrections in vectors are needed but I really had a moment... :(

This is translucency opacity test via standard shadow() call

post-744-1214817879_thumb.jpg

This is translucency with surface color:

post-744-1214818199_thumb.jpg

These are both:

post-744-1214819533_thumb.jpg

Point cloud was generated in SOPs, because I'm lazy (BTW it need to carry point normals). Perhaps pcwrite() with pre-pass computation would be better way. There are also some artifacts and no eta for refraction. Corrections highly recommended! :)

cheers,

sy.

#include &lt;math.h&gt;
surface
milk_glass(vector trans = 0.5;
	   vector diff = 0.7;
	   string pcmap = "";
	   float maxdist = 1;
	   int maxpoints = 50;)

{

	vector pcP = 0;
	vector pcN = 0;
	vector tlight = 0;
	vector nN;

	vector cf, of;
	float af;

	vector pp = ptransform("space:object", P);
	vector Nf = frontface(normalize(N), normalize(I));
	int handle = pcopen(pcmap, "P", pp, maxdist, maxpoints);

	while(pcunshaded(handle, "tlight"))
	{
		pcimport(handle, "P", pcP);
		pcimport(handle, "N", pcN);
		pcN = ntransform("space:object", "space:camera", pcN);	
		nN = -frontface(normalize(pcN),I);
		pcP = ptransform("space:object", "space:camera", pcP);

		illuminance(pcP, nN, M_PI/2)
		{
		vector nL = normalize(L+(P-pcP));
		shadow(Cl);
		tlight  += Cl * dot(nL, nN);
		} 

		refractlight(cf, of, af, pcP, I, 0.005, max(trans));

		int success = pcexport(handle, "tlight", cf+clamp(tlight, {0,0,0},{1,1,1}));


	}


	tlight = pcfilter(handle, "tlight");

	Cf = tlight*trans + diffuse(Nf)*diff;
	Of = 1;



}

Edited by SYmek
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

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...