is it possible to grab primnum in a shader?

   769   2   0
User Avatar
Member
621 posts
Joined: Aug. 2008
Offline
i would like to be able to grab the primitive number and multiply for a random number, i want each of my primitive be different.
could make an attribute at sop level where:

@myprim_num = @primnum

but i don't want to store it as a attribute i think is unnecessary to add more data since is right there. any ideas? (hopefully works with materialsX)

Tanks guys
User Avatar
Member
1075 posts
Joined: April 2017
Offline
I'll usually generate a float from it. like:

f@randPrimMasking = rand(@primnum);

(*you might need to promote to vertex)

But I dont know if @primnum can be used directly. What renderer are you using?
User Avatar
Member
621 posts
Joined: Aug. 2008
Offline
karma, i am just surprised that primnum or point num are not accessible by default and need to be store into the geometry.
  • Quick Links