How to transmit point cloud attributes to alembic instance ?

Forums: How to transmit point cloud attributes to alembic instance ?
Generic forum to discuss Octane Render, post ideas and suggest improvements.
Forum rules
Please add your OS and Hardware Configuration in your signature, it makes it easier for us to help you analyze problems. Example: Win 7 64 | Geforce GTX680 | i7 3770 | 16GB

How to transmit point cloud attributes to alembic instance ?

Postby fantome » Fri Feb 05, 2021 11:47 am

fantome Fri Feb 05, 2021 11:47 am
Hi Guys,
I have an alembic file containing instance geometry on an animated point cloud.
The point cloud has
- a @Cd attribute for colorPP,
- a @width attribute for radiusPP,
- and a @v attribute for velocity.

@width and @v are working fine. but i can't find a way to transmit the color of my points to my instance in octane standalone.
Do you guys have any idea on how i can make this work or if it is impossible at the moment ?

i need to transmit these colors:
pop.jpg


to these instance.
inst.jpg


Here is an orbx scene describing the problem.
color_instance.orbx
(8.46 MiB) Downloaded 201 times


Thanks for your lights !
Cheers
E
User avatar
fantome
Licensed Customer
Licensed Customer
 
Posts: 266
Joined: Wed Dec 16, 2015 3:38 pm

Re: How to transmit point cloud attributes to alembic instance ?

Postby galleon27 » Fri Feb 05, 2021 12:51 pm

galleon27 Fri Feb 05, 2021 12:51 pm
Ok. I'm gonna go on a limb and guess that the sim was done in Houdini using packed primitives. That won't work. If you import geo_instance_v001.abc back into Houdini, you'll see that there is no Cd attribute. You will have to unpack the sim before you export.

I've attached both the hip file and the orbx.
Attachments
color_instance_test.zip
(12.29 MiB) Downloaded 189 times
Screenshot 2021-02-05 133710.png
Win 10 64bit // GTX 4090 + GTX 3090 // 5900x // 64GB // SideFX Houdini // C4D
User avatar
galleon27
Licensed Customer
Licensed Customer
 
Posts: 240
Joined: Wed Jul 15, 2015 11:55 am
Location: Serbia

Re: How to transmit point cloud attributes to alembic instance ?

Postby fantome » Fri Feb 05, 2021 2:14 pm

fantome Fri Feb 05, 2021 2:14 pm
Thanks for your fast answer Galleon27.
The problem is that if i unpack , i think it will loose all the benefits of instancing, and bascially each object will take some space in the vram.
It is like exporting a geocache of all the objects with a @Cd attribute.

I agree with you that transmit particles attributes to instances in standalone is impossible at the moment, but i need to be 100% sure.
As octane is now able to read user data on point and mesh i think it just miss a samll brick to make this works.

But the info is there in the abc you can read it throw arnold or redshift for exemple, so it is readable.
Octane just need before instancing to read the point info and apply it to the instance.

Actually there is a way , but it's very cumbersome, you need to export per frame .csv , and write you own custom texture in COP to encode @Cd and then read it throw the instance color node.
it does work as you keep instancing and colors , but the big cons is that you can't have motion blur or motion vector, cause you have no way to transmit @v throw .csv method.

Cheers
E
User avatar
fantome
Licensed Customer
Licensed Customer
 
Posts: 266
Joined: Wed Dec 16, 2015 3:38 pm

Re: How to transmit point cloud attributes to alembic instance ?

Postby galleon27 » Fri Feb 05, 2021 2:49 pm

galleon27 Fri Feb 05, 2021 2:49 pm
You will definitely lose the benefits of instancing with unpacking. As far as i know, octane doesn't support attributes on instances yet.
Here's a quote from this thread. It is from a year ago but i don't think anything has changed since then.

juanjgon wrote:
efxlab wrote:Is it possible now with 2020 to retrieve attribute from packed instance in houdini ?


Octane doesn't support user attributes in the instances yet (Octane 2020 supports them in the meshes, curves, and particles), but in any case, the packed instances are not extracted as Octane instances, they are expanded to the full geo, so well, if they have any embedded attribute, it should be available for Octane.

Thanks,
-Juanjo
Win 10 64bit // GTX 4090 + GTX 3090 // 5900x // 64GB // SideFX Houdini // C4D
User avatar
galleon27
Licensed Customer
Licensed Customer
 
Posts: 240
Joined: Wed Jul 15, 2015 11:55 am
Location: Serbia

Re: How to transmit point cloud attributes to alembic instance ?

Postby jobigoud » Fri Feb 05, 2021 9:10 pm

jobigoud Fri Feb 05, 2021 9:10 pm
If I'm not mistaken the data model in Octane should support this, in theory, as each particle can also point to an *object* that will replace the sphere during rendering. (In Lua API: NT_GEO_MESH.A_SPHERE_OBJECT_INDICES).

So if you could somehow have your torus, cube, etc. stored inside the same cache as the particles, and have each particle point to one of these, it should work. (Disclaimer, I've never tried this and never seen a mesh with this arrangement).

In theory a script could take some input geometries and inject them in the particle cache to be used as the replacement objects.
User avatar
jobigoud
OctaneRender Team
OctaneRender Team
 
Posts: 230
Joined: Sat Aug 15, 2015 1:28 pm

Re: How to transmit point cloud attributes to alembic instance ?

Postby fantome » Sat Feb 06, 2021 6:20 pm

fantome Sat Feb 06, 2021 6:20 pm
Thanks for your answer guys !
you both confirm what i thought.
- transmit particles attribute to instance object is not possible for now
- but in theory we are pretty close to be able to make it work.

@jobigoud
So if you could somehow have your torus, cube, etc. stored inside the same cache as the particles, and have each particle point to one of these, it should work.


i think this is already what is happening in my cache. alembic does store the particle objects and their custom attributes plus the reference shape object, that will be instanced base on point cloud info.

- octane is already able to understand xform, radiuspp, v and to transfer them on the instance of the referenced object.
- octane is also able to understand user custom attributes on particles and reference object.

the only thing that octane can't do is to transfer the custom user data contained on particles to the instanciated object. and like you said i think most of the circuits are already on the pcb, it just miss some small extra welding to activate the features.

that would be great if this could work by default in octane standalone, by using directly the vertex color / float nodes like i have try to do in my scene.
while this might sound like a useless exotic feature for many people, it is really a very important tool for environment and motion design work, and especially useful for the C4D/Houdini users.

I hope that someone will have the time to try to make this work, cause this is the last major feature i miss in octane.

Cheers
E
User avatar
fantome
Licensed Customer
Licensed Customer
 
Posts: 266
Joined: Wed Dec 16, 2015 3:38 pm

Re: How to transmit point cloud attributes to alembic instance ?

Postby jobigoud » Wed Feb 10, 2021 3:50 pm

jobigoud Wed Feb 10, 2021 3:50 pm
fantome wrote:Thanks for your answer guys !
you both confirm what i thought.
- transmit particles attribute to instance object is not possible for now
- but in theory we are pretty close to be able to make it work.

(...)

while this might sound like a useless exotic feature for many people, it is really a very important tool for environment and motion design work, and especially useful for the C4D/Houdini users.

I hope that someone will have the time to try to make this work, cause this is the last major feature i miss in octane.



It is possible indirectly via a color map where each pixel is an attribute value that gets associated with an instance, using the Instance Color node. This works in C4D.

Each extra attribute like particle color is to be stored in a different map. The values in the map are indexed by instance id/particle, first pixel is for the first instance, etc. There must be one version of the map for each frame of animation. The instances must have an ID that makes them relate to the behavior of a specific particle over time.

At the moment the instances in your alembic export don't have IDs (also for some reason each instance is in its own dedicated scatter node).

If you have c4d you can check this documentation page, there are examples of transferring particles attributes to instances and there is a link to c4d scenes.
User avatar
jobigoud
OctaneRender Team
OctaneRender Team
 
Posts: 230
Joined: Sat Aug 15, 2015 1:28 pm

Re: How to transmit point cloud attributes to alembic instance ?

Postby fantome » Thu Feb 11, 2021 9:35 am

fantome Thu Feb 11, 2021 9:35 am
jobigoud wrote:- Each extra attribute like particle color is to be stored in a different map.
- The values in the map are indexed by instance id/particle, first pixel is for the first instance, etc.
- There must be one version of the map for each frame of animation.
- The instances must have an ID that makes them relate to the behavior of a specific particle over time.

At the moment the instances in your alembic export don't have IDs (also for some reason each instance is in its own dedicated scatter node).

If you have c4d you can check ... there are examples of transferring particles attributes to instances and there is a link to c4d scenes.


Thanks again for taking the time to help jobigoud !

Yes indeed the only way to make this work in standalone is by using the instance color node, loading a per frame custom maps.
I succesfully make this works by exporting a .csv particles sequence and instancing a reference geo with the scatter node. The problem i have with this technic is that :
- i can only scatter one reference object on the point cloud
- i can't have motion blur

I then do some research with alembic to bypass those restriction. Alembic did solve the motion blur problem, as octane understand @velocity on points.
But i am still stuck with colors. You suggest that there might be a way to make the instance color node work also with alembic instance ? for the moment i fail to make it work with abc.
So i might have miss some important info there ?

for ex i have 10 points with random colors and 2 ref object. if i create an attribute ID with integer value 0 for object A and 1 for object B, and if i also create an attribute ID on my points with a value between 0 and 1 to define which object to instance, octane will be able to understand this ? and be able able to match the instance color node , to the coressponding object ?

I know it works in C4D and Houdini, i don't use C4D, but juanjo solve for houdini is working fine, but i prefer to assemble my scene in standalone to be able to render on the cloud.
That would be great if this could work natively. Again it's a really useful feature for houdini guys, an other guy just ask for this yesterday on the houdini forum:
viewtopic.php?f=102&t=76929&start=10#p396414

Cheers
E
User avatar
fantome
Licensed Customer
Licensed Customer
 
Posts: 266
Joined: Wed Dec 16, 2015 3:38 pm

Re: How to transmit point cloud attributes to alembic instance ?

Postby jobigoud » Sun Nov 28, 2021 10:47 am

jobigoud Sun Nov 28, 2021 10:47 am
Hi Fantome,
I took another look into this.
Although I'm still not sure where exactly the issue is coming from, I think the core issue is in the way Octane sees the Alembic file, for one reason or another. The one called "geo_instance_v001.abc" which has the different reference objects and the motion blur. Instances are sharing the geometry references but they don't have IDs, so we can't use any instance based shading. I don't know if the issue is on the export side or the import side.

However if we go through the instances and force a unique ID on them, it should enable per-instance shading. I wrote a (very experimental) script that makes a copy of the input alembic and add the IDs. It seems to work, I can use the "Instance range" node to generate a unique color per instance.

I don't know if you will be able to transfer the "Cd" attribute directly, you'll probably need to generate or have Houdini generate the instance color map for use with the Instance color node. For this you'll need to know how the IDs are generated: I just incremented the ID for each found instance, irrespective of the source object. The counter does not reset for each reference object.

The script graph exposes pins for the materials but don't use them, they are only there to force the Material map to create its inputs.
I attach the scene with the scriptgraph inside, let me know if this works.

nodegraph.jpg


color_instance_modified.orbx
(6.49 MiB) Downloaded 152 times
User avatar
jobigoud
OctaneRender Team
OctaneRender Team
 
Posts: 230
Joined: Sat Aug 15, 2015 1:28 pm

Re: How to transmit point cloud attributes to alembic instance ?

Postby fantome » Mon Jul 18, 2022 10:56 am

fantome Mon Jul 18, 2022 10:56 am
thanks a lot for your help jobigoud, and sorry for my very very delay answer.
i was wondering if the fix that you code is still needed today ? or does standalone recognize id's directly now ?
cheers
User avatar
fantome
Licensed Customer
Licensed Customer
 
Posts: 266
Joined: Wed Dec 16, 2015 3:38 pm
Next

Return to General Discussion


Who is online

Users browsing this forum: No registered users and 16 guests

Tue Apr 16, 2024 7:03 pm [ UTC ]