Jump to content

use intrinsic info in shaders


Recommended Posts

hey guys,

do you know if it is possible to use intrinsic information in a shader? something like intrinsic:indexorder in a render state just like with packed attributes.

also, still in a render state, packed:primnum or packed:ptnum doesn't seem to be working. 

if i make an attribute in a wrangle on packed prims, let's say i@primid = i@primnum, and i call that in the shader with a render state it works as expected.

any idea?

 

thanks

Martino

Link to comment
Share on other sites

  • 9 months later...

I'm kind of wondering the same thing... was trying to write a shader that worked on both Poly and Volume geometry but checking "intrinsic:typename" doesn't seem to work in the material builder context.

 

Edit: looks like I can use Primitive Intrisic VOP, but that requires a filename...  whereas I'm trying to write a shader that can work on all geo.

Edited by Nicholas Ralabate
Link to comment
Share on other sites

as far as I understand this, renderstate packed can not lookup intrinsics and geometry global variables (@ptnum and @primnum). You can treat them like attributes at geometry level, but not at shader level as shaders have a different set of global variables (see Global Variables VOP - P, Pz, I, N, etc.), As you already found out, if you wanna import geometry globals or intrinsics into a shader it must be saved as an actual attribute with an arbitrary name. 

  • Like 1
Link to comment
Share on other sites

Hi, in Mantra you can sidestep the problem with stylesheets and cvex for primitives. E.g.: Data Binding to intrinsic:indexorder

In this example, I'm targeting packed primitives themselves. If I would add subtarget: Primitive I could target individual polygons on a rubber toy. You can find some examples in the crowd section of the documentation.
intrinsic_indexorder.thumb.png.b5be2510f0c42741095447d389b7d03d.png

packed_target.hipnc

  • Like 2
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...