Jump to content
Sign in to follow this  
iamjaideep80

Trace Function In Vex For Renderman

Recommended Posts

Hi Everybody,

I am trying to creat Renderman Shaders using VEX network. But i don't know how to use Raytracing in VEX. How to get a TRACE function here in VEX ,like in RSL. Or is that, we have to do something else.

Thanking in advance........

...... Jaideep

Share this post


Link to post
Share on other sites

This is from the vex help html doc. If you are working in VOPs there is a ray trace vop or in code use the below.

#  void trace(vector &cv, &of; float ⁡ vector P, D; float bias, max_contrib, [

options])

This function will send a ray starting at P and in the direction specified by the normalized vector D. The resulting color, opacity and alpha will be returned. The bias parameter is typically a small number which is used to prevent self-shading of the trace() function. The max_contrib parameter is used to give the renderer an idea of how much the result of the trace() call will contribute to the resulting pixel color. The max_contrib parameter has no effect on the results of the trace() call.

# float rayhittest(vector P, D; float bias, [

options])

float rayhittest(vector P, D; vector &pHit, &nHit; float bias, [options])

This function will send a ray from the position P along the direction specified by the direction D. The length of the D vector represents the farthest distance considered when check for occlusion. The function will return the distance to the object intersected. If no object is hit, the distance will less than 0. If pHit and nHit are specified, they will be set to the position and normal of the hit surface.

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×