Jump to content

Trace Function In Vex For Renderman


iamjaideep80

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

Link to comment
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.

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