sebkaine Posted September 23, 2016 Share Posted September 23, 2016 (edited) 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 September 23, 2016 by sebkaine Quote Link to comment Share on other sites More sharing options...
sekow Posted September 23, 2016 Share Posted September 23, 2016 (edited) check out the render state node, you have access to pack attributes via packed:attribute syntax Edited September 23, 2016 by sekow 1 Quote Link to comment Share on other sites More sharing options...
sekow Posted September 23, 2016 Share Posted September 23, 2016 said that, I believe that a bind just does the trick too Quote Link to comment Share on other sites More sharing options...
sebkaine Posted September 23, 2016 Author Share Posted September 23, 2016 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 Quote Link to comment Share on other sites More sharing options...
sebkaine Posted September 23, 2016 Author Share Posted September 23, 2016 (edited) 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 September 23, 2016 by sebkaine Quote Link to comment Share on other sites More sharing options...
sekow Posted September 23, 2016 Share Posted September 23, 2016 https://www.sidefx.com/docs/houdini15.5/nodes/vop/bind Quote Link to comment Share on other sites More sharing options...
sebkaine Posted September 23, 2016 Author Share Posted September 23, 2016 so after test : - bind don't work - render state + packed:att synthax work and this is a very elegant solution as you don't need to unpack to color your chunk ... a simple ex: packed_attribute.hip 1 Quote Link to comment Share on other sites More sharing options...
adrianr Posted September 23, 2016 Share Posted September 23, 2016 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? Quote Link to comment Share on other sites More sharing options...
sebkaine Posted September 23, 2016 Author Share Posted September 23, 2016 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 ... Quote Link to comment Share on other sites More sharing options...
adrianr Posted September 23, 2016 Share Posted September 23, 2016 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. 1 Quote Link to comment Share on other sites More sharing options...
sebkaine Posted September 24, 2016 Author Share Posted September 24, 2016 (edited) 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 September 24, 2016 by sebkaine Quote Link to comment Share on other sites More sharing options...
berglte Posted September 24, 2016 Share Posted September 24, 2016 Is this what you want to achieve? Mantra unpacks the packed geometry at rendertime so you should be able to get the original per point Cd attribute with a bind VOP. packed_attribute_02.hip Quote Link to comment Share on other sites More sharing options...
sebkaine Posted September 25, 2016 Author Share Posted September 25, 2016 (edited) 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 September 25, 2016 by sebkaine 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.