MartiM Posted March 25, 2020 Share Posted March 25, 2020 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 Quote Link to comment Share on other sites More sharing options...
Nicholas Ralabate Posted January 24, 2021 Share Posted January 24, 2021 (edited) 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 January 24, 2021 by Nicholas Ralabate Quote Link to comment Share on other sites More sharing options...
davpe Posted January 26, 2021 Share Posted January 26, 2021 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. 1 Quote Link to comment Share on other sites More sharing options...
pezetko Posted January 26, 2021 Share Posted January 26, 2021 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. packed_target.hipnc 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.