Jump to content

Getting Custom Attributes Info With Rays


Recommended Posts

Hi all.

I want to throw rays to get attribute information from hitted surfaces.

The existing functions like trace or rayhittest only returns some predefined attributes like color, alpha, P or N, but what about to retrive custom information attrahed to the hittedt surface?

Is possible?

Thanks

Link to comment
Share on other sites

I'm guessing he means inside a shader which I don't think is possible at the moment. There are some possible hacks but what exactly are you trying to achieve?

I believe you could adapt this technique for modifying shader attributes as well as long as you create an attribute that is named the same as the shader attribute. The shader will then update. I'll have to try it.

I agree it would be helpful to see a hip file demonstrating the problem.

Link to comment
Share on other sites

Simon, I'm not sure if this is what you were getting at but here's a version with a shader attribute being modified according to the ray hit. You could do this for a renderman shader attribute by using the mapping parameters in the RenderMan tab of an Attribute SOP.

Pablo, is this any use?

rayToGetAttribute2.hip

Link to comment
Share on other sites

Simon, I'm not sure if this is what you were getting at but here's a version with a shader attribute being modified according to the ray hit. You could do this for a renderman shader attribute by using the mapping parameters in the RenderMan tab of an Attribute SOP.

Pablo, is this any use?

I was thinking more of situations where you are firing rays inside the shader at render time and trying to pick up an attribute from the hit surface. Say when you don't know what the geometry is that's going to be hit and can't pre-ray onto it, or when it simply isn't efficient to do so, or when the real geometry points are too sparse for attribute transfer to work, that sort of thing. That's why I was wondering the precise details of what lisux was hoping to achieve.

I think it would be handy to have a vex function that could ray trace and query an attribute on any hit surface, even have it eval a shader to get the value perhaps.

Link to comment
Share on other sites

I was thinking more of situations where you are firing rays inside the shader at render time and trying to pick up an attribute from the hit surface. Say when you don't know what the geometry is that's going to be hit and can't pre-ray onto it, or when it simply isn't efficient to do so, or when the real geometry points are too sparse for attribute transfer to work, that sort of thing. That's why I was wondering the precise details of what lisux was hoping to achieve.

I think it would be handy to have a vex function that could ray trace and query an attribute on any hit surface, even have it eval a shader to get the value perhaps.

Hi Simon and Grasshopper.

Yes I am in the situatuation described by Simon.

I want to do the same as in RSL, throwing rays to fetch geo data.

I was trying to do this in a volumetric shader I was developing, with different ray marching algorithm that requires raytracing.

At the end, I have leave this option because i have to made many workarounds in the shader to solve the problem of fetcheing data from geometry, and finally the shader is to expensive.

So finally again a I return to my dear sprites <_<

Thanks for your example grasshopper, this is one of the solution I thought but at the end the owrkflow is so dirty, I don't like it, maybe for other effects is good, ie procedural moedeling, but to susbstitue the RSL feature is not so good.

Thanks for your answers.

And please SESI, add this feature to VEX.

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