Jump to content

Ray tracing


Recommended Posts

Have few questions about ray-tracing in mantra....

First of all many raytraces have controlls how many times a ray can reflect/refract - how is this controlled in mantra?

secondly if I use rayhit vops on fully opaque object ex. plastic sphere with P and I then the distance returned would be the thickness of the sphere at the point?

need all this to get good transparancy for liquids (it took me a wile to figure out how to do decent refraction ;) )


Link to comment
Share on other sites

Hi Kaspar,

First of all many raytraces have controlls how many times a ray can reflect/refract - how is this controlled in mantra?

Please go to the Render tab of the object and the options you're looking for are "Ray Bounce" and "Ray Clip" (Houdini 5.5 and below) or "Reflect Bounce", "Refract Bounce" and "Ray Clip" (Houdini 6.0 and above).

As for your second question, I'll leave it to someone more knowledgable than me to answer it. ;)

I hope to see the liquids you're working on though. :)



Link to comment
Share on other sites

Ok that cleared on thing up for me, but how does ray-tracing work :blink:

I mean the ray level 0 hits the surface point P, the point P shader says trace to direction I, so ray level 1 hist a surface point P1 and P1 has the same shader as P so the tracing would go on untill reflect/refract bounce level is achived or P with no ray-tracing is hit!? :ph34r:

if it is so... then when I use rayhit vops distance returned would be P to P1, P to Px or even Px-1 to Px <_<

Maybe there is a good source on the internet about ray tracing, baecuse I have advanced renderman book and I cant figure it out for renderman as well (and I have lost my copy of BMRT :huh: so cant test it either)


edit: c'mon I know there are some phunky ray mongers around, who can help me :ph34r:

Link to comment
Share on other sites

  • 2 weeks later...

I have lost all hope -> so I turned to documentation :huh: but the things get starger....

Note: Though it is possible, in many cases, the area sampling features will not produce usable results with the rayhittest() function.

what do they mean by that? that I cant preform volume measurements with rayhittest(), then how?

ohh an a test render as well:



Link to comment
Share on other sites

Hmmm...actualy You can.

Rayhittest will return the distance to the !!!FIRST!!! object intersected.

So...forget about bounce level :)

To make sure that you trace volume of current object

use construction like this:

string myname = getobjectname();

float depth = rayhittest(P, normalize(I) * maxdist, bias, "scope", myname);

Link to comment
Share on other sites

but that is exactly what I am doing,

1. pic is opaque surface

2. pic is the translucant surface

3. pic is the outcome of the ray hit test (it seems ok dosen't it!?)

4. colormix(2,1,3) -> now that is totally bogus, but when I use solid color or anything without ray-tracing it is OK... so what is up with that



edit: here's a taught maybe I should limit rayhit test to be used only on primary rays, so the transparency would not be re-calculated on reflected and refracted P's?

This seemed to do the trick :ph34r:


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.

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