Jump to content

Reflection Occlusion


Korhon

Recommended Posts

Hi!

I was wondering if anyone managed to do reflection occlution with mantra?

Is this something that can be done with vops?

I found this a older thread about this, but it only explains a cheat, and a way of doing it with code. ( and i dont know how to write shaders )

This thread show what i want to do.

http://www.illuminatelabs.com/support/tuto...tive-occlusion/

Thanks :)

Link to comment
Share on other sites

you have the ability to specify direction vector (N) for the occlusion VOP

so you can plug there a reflect VOP with normalised I and normalised N as inputs

you will not have control over sample spread however, so its use is limited

if you want spread control you probably need to use gather loop

or does anybody know an easier solution?

Edited by anim
Link to comment
Share on other sites

Thanks for the fast reply!

I tried it and it works as you described. :) But im in need of a crisp reflection occlution pass.

So if anyone have some way of manipulation the spread let me know :)

Link to comment
Share on other sites

Hi!

I was wondering if anyone managed to do reflection occlution with mantra?

Is this something that can be done with vops?

I found this a older thread about this, but it only explains a cheat, and a way of doing it with code. ( and i dont know how to write shaders )

This thread show what i want to do.

http://www.illuminatelabs.com/support/tuto...tive-occlusion/

Thanks :)

This is perfectly doable in Mantra and VEX. There are number of similar approaches to reflection occlusion. One can ask how to deal with self reflections in such case and so on. I'm not in this topic by any means. But anyway, quick try of the way from your link in vex - definitely incomplete...

surface 
   reflectionOcc(string map=""; 
			   float angle=.25; 
			   int samples=32)
   {

	   string name = "";
	   float occ = 0;
	   vector bend = 0;
	   vector nN = normalize(N);

	   // Scope to this object:
	   renderstate("object:name", name);	

	   // Env reflections:
	   vector d = reflect(normalize(I),nN);
	   vector env = environment(map, d, "envobject", "space:world");

	   // Compute occlusion:
	   occlusion(occ, bend, P, d, "samples", samples, "angle", angle, "scope",name);

		Cf = env * (1-occ);

   }

Save it to *.vlf file and use command: vcc -l myfile.otl myshader.vfl

cheers,

skk.

EDIT:

showtime!

:)

post-744-1244031556_thumb.jpg

Edited by SYmek
Link to comment
Share on other sites

Wow thanks for the reply!

Will try it out now!

I was also thinking of making a reflective shader that reflects a white enviroment and itself as black. Wouldnt that work pretty well for a reflection occlution pass?

But im now sure on how to make it reflect itself black.

Link to comment
Share on other sites

Wow thanks for the reply!

Will try it out now!

I was also thinking of making a reflective shader that reflects a white enviroment and itself as black. Wouldnt that work pretty well for a reflection occlution pass?

But im now sure on how to make it reflect itself black.

That would work too. The occlusion() call is quite a bit faster than the reflectlight() call because it doesn't have to evaluate the color of the surface it strikes (well, only opacity if you explicitly tell it to).

Link to comment
Share on other sites

I found this a older thread about this, but it only explains a cheat, and a way of doing it with code. ( and i dont know how to write shaders )

Gosh. I feel stupid, I completely missed that part. Sorry :blush:

I think you could use fastshadowVOP to mimic occlusion with control over cone angle in vops. It could be even faster then occlusion, except you can't use irradiance cache to accelerate it (like in case of occlusion()). Just mult it with environmapVOP.

skk.

Edited by SYmek
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...