Jump to content
MartiM

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
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

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

×