Korhon Posted June 3, 2009 Share Posted June 3, 2009 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 Quote Link to comment Share on other sites More sharing options...
anim Posted June 3, 2009 Share Posted June 3, 2009 (edited) 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 June 3, 2009 by anim Quote Link to comment Share on other sites More sharing options...
Korhon Posted June 3, 2009 Author Share Posted June 3, 2009 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 Quote Link to comment Share on other sites More sharing options...
symek Posted June 3, 2009 Share Posted June 3, 2009 (edited) 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! Edited June 3, 2009 by SYmek Quote Link to comment Share on other sites More sharing options...
Korhon Posted June 3, 2009 Author Share Posted June 3, 2009 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. Quote Link to comment Share on other sites More sharing options...
Jason Posted June 3, 2009 Share Posted June 3, 2009 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). Quote Link to comment Share on other sites More sharing options...
symek Posted June 3, 2009 Share Posted June 3, 2009 (edited) 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 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 June 3, 2009 by SYmek Quote Link to comment Share on other sites More sharing options...
Korhon Posted June 4, 2009 Author Share Posted June 4, 2009 Thanks for the replies! Using the fastshadowVOP worked realy well! But the only problem is that the "reflections" fade to fast away, so its hard to get clean long reflections with it. Unless im using it wrong? Added a hip with a test scene. Reflection_occlution.hip Quote Link to comment Share on other sites More sharing options...
rob Posted June 5, 2009 Share Posted June 5, 2009 (edited) Feel free to grab my Vop Should solve all your problems http://forums.odforce.net/index.php?showtopic=9180 r Edited June 5, 2009 by rob Quote Link to comment Share on other sites More sharing options...
Korhon Posted June 5, 2009 Author Share Posted June 5, 2009 Thanks for the Vop Rob! This is exactly whats im looking for! Greate stuff! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.