Jump to content

Access the point attributes of a pack primitive without unpacking ?


sebkaine

Recommended Posts

Hi guys,

I would like to know if there was a way to access the point attributes of a pack object without unpacking.

For exemple i have lots of chunks created from a POP sims.

The point have a @Cd / @uv attribute.

I would like to use those in a shaders. But at the moment i need to unpack to use them in my shader.

The instancing time go from 2s in pack mode to 3mn per frame in unpack mode.

So it's a lot of wasted time just to access 2 attributes.

as they are small it would be perfect if objects just use the point attribute as an approximation.

 

Is it possible to do this at the moment ?

Thanks for your time !

Cheers 

E

Edited by sebkaine
Link to comment
Share on other sites

great thread Sebastian thanks a lot ! :)

Actually i also solve the speed problem.

1- if i pack the geo before the copy the copy time is extremely slow -> 2mn

2- if i tick the Pack geometry before copying in the copy sop is blazing fast -> 1s

3- if i copy unpack geo it take ages to copy - > logical conclusion ...

This first conclusion is kinda weird to me cause i thought method 1 and 2 were the exact same thing ?

 

if i then unpack the geo by unchecking the iteration option i get a very fast update around 5s so good enough for me !

so :

- pack with the copy sop option 

- unpack without the iteration option 

-> works great 

 

Now i am going to try with the  packed:attribute syntax to see if it's the new graal !

Cheers 

E

 

Link to comment
Share on other sites

10 minutes ago, sekow said:

said that, I believe that a bind just does the trick too

 

This one has fly under my radar ... what is bind ? :)

 

EDIT

outch just an import att at shader level ... i still use parameter node ... my bad !

Edited by sebkaine
Link to comment
Share on other sites

Thanks for the example sebakine, that is a great solution. I would also like to know the answer regarding the speed difference in packing prior to copying and packing as part of the copy. Something the copy sop can do internally regarding copies that it has to duplicate if feeding it an already packed primitive perhaps? 

Link to comment
Share on other sites

i think an explanation is that i have 2 level of packing.

 

- i do a first small shattering of 10 pieces

- then i use those pieces as instance in a copy

if i want to unpack them i have to do 2 iterations.

 

so i think that packing before copy or in copy are identical if you copy a full simple geo 

but if you copy something that has already have packing it can introduce the weird difference

 

that's a theory ... :)

 

 

 

 

 

Link to comment
Share on other sites

Think I've found where the big speed difference comes from, at least how I've seen it manifested in the past, it's the 'Create Name Attribute' on the Assemble sop. I always use it for packing rather than the Pack sop, don't ask me why, and it has create name checked on by default. With this enabled copying even packed geometry is no faster than copying regular geometry (both around 5 seconds copying a polygon mesh box of 1000ish points to a 10000 point template) - Turn it off, or pack it in the copy sop, gets the time down to around 0.05 seconds.

  • Like 1
Link to comment
Share on other sites

Thanks for the extra info Adrian !

 

I would be curious to know is there might be a way to 

- store Cd as point att in a poly object 

- pack the object 

- then be able to read the Cd att of all the point and not just the point that represent the pack object.

basically unpacking shading info at rendertime, cause working with unpack / vs pack can definitly change your RBD life. :)

 

 

Edited by sebkaine
Link to comment
Share on other sites

Thanks Teemu for your help, in fact it work with a simple bind connection and that's very cool.

But in my case i have to camap 3 different frame , and thus create uv's from camera.

In that scenario i try to figure out how to camap without having to unpack ?

 

EUREKA !

i just have to prepare my camap before sending to the RBD sims ... 

 

The loop is complete now i can work only in pack and don't waste my day in front of the progress bar ...

Thanks again for all your input guys !

 

a simple ex:

 

camap.hiplc

Edited by sebkaine
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...