Vertex colors from Houdini to Unity

   21131   17   5
User Avatar
Member
12 posts
Joined: Dec. 2013
Offline
Hello,
I have a complicated shape (that I don't wanna UV unwrap ) that I want to bring to Unity from Houdini. The geometry has Cd attribute and I need to get that to Unity. What's the best way to do it? I have tried exporting FBX with Cd as point attribute, Cd Primitive attribute, applying a material that uses Point color and exporting that to FBX. No luck so far.
Thanks in advance.
User Avatar
Member
194 posts
Joined: Aug. 2011
Offline
i just wanna +1 this! im pretty sure that i have these type of assets hanhing around all over my hard drive!!
User Avatar
Member
12 posts
Joined: Dec. 2013
Offline
In http://www.sidefx.com/docs/houdini14.0/io/fbx [sidefx.com] it says that the vertex colors are supported to export. So I am pretty hopeful for some answers.
User Avatar
Member
194 posts
Joined: Aug. 2011
Offline
you know, i was thinking about it, and i think i actually did this one time. i just forgot. i think i exported the object as an OTL instead of an FBX.

then in unity i just baked out the object. the only annoying thing was that i had to use some wierd vertex shader thing in unity, and i couldn't use whatever shader i wanted. (i think).

i will have to go back and look at the project and make sure I'm telling you right. Also, it might be different now because that was a while ago.

12++
User Avatar
Member
40 posts
Joined: Dec. 2014
Offline
i think houdini exports vertex color with no problem, however in unity you need a shader that can read vertex color, the default shaders does not paint it.

http://answers.unity3d.com/questions/189584/how-to-get-vertex-color-in-a-cg-shader.html [answers.unity3d.com]
User Avatar
Member
14 posts
Joined: Nov. 2016
Offline
Is there a special Houdini shader for Unity that renders vertex colors?

I use Amplify Shader, it works perfectly fine with geometry exported from Max (Vertex Paint, channel_ID = 0)

But It does not work with Alembics exported from Houdini as Cd attribute is arbitrary (channel_ID = 1-2-3..N)
Yes, I can select a channel in 3ds max to render colors but not in Unity.

1. Is there a way to change the channel for imported ABC file in Unity?
2. Is there a correct way in Houdini to exporting Vertex Color to Unity (I can't find anything for months already)
3. Is there anything can be done on shader level? - like to select a channel_ID from the geo,
Amplify vertex color is RGBA only, no other settings available.


Thanks!

Attachments:
vertex-color-alembics-unity.gif (194.4 KB)

User Avatar
Member
14 posts
Joined: Nov. 2016
Offline
I've posted a git issue in Alembic for Unity repo,
https://github.com/unity3d-jp/AlembicForUnity/issues/210 [github.com]
the Author said it's definitely a Houdini alembic export issue.

so it is not #1_Unity_ALembic or #3_Shader_related issue
It all comes down to a proper Houdini export to Unity I assume.

It would be nice to know what export settings/ workflow to use in this case.
Thank you!
User Avatar
Member
14 posts
Joined: Nov. 2016
Offline
knock knock - 2019 - it's pretty dead here =]

I hope there are more gametools coming to export vertex colors properly to Unity
a good tutorial how to pack it to alembic also works

thanks!
User Avatar
Member
394 posts
Joined: May 2017
Offline
Hey. I just did a quick test export the rubber toy with vertex colours as an fbx to Unity and then applied a shader graph material. It works with default settings. I don't think there's anything special you need to do to get the vertex colours working.

Attachments:
rubber_toy.fbx (2.9 MB)

User Avatar
Member
14 posts
Joined: Nov. 2016
Offline
Oh cool, thanks!
I'll try that one and pretty sure it will work!

but I'd like to export Alembic .abc format (as I can export mesh animations)
For some reason alembic vertex color does not work directly but via channel somehow,
maybe I need to attribute promote or remap?
here is what unity alembic developer says:
https://github.com/unity3d-jp/AlembicForUnity/issues/210#issuecomment-440846343 [github.com]

for some cases new Houdini game tools are super helpful,
like I can export small solid body simulation animations via vertex shader textures,
but it's pretty limited (I can not change vertex scale, just the position)

If you can help with the Alembic SOP setup - that would be super awesome, there are tons of settings for sure,
User Avatar
Member
6 posts
Joined: Jan. 2015
Offline
Hi everybody,
I am struggling with the same issue:
My vertex animations can be sent from Houdini to Unity via alembic, but I can't send the colors over.
Renaming the Cd attrib to “Color” or “rgba” did not help, either. FBX seems not to be an option, because it drops my point based animations (but keeps the colors).

I'd just like to hear if there is a already solution for this.
@gasanoff: Did you find anything appropriate?

Is there anything either on the Unity side or in Houdini that I could do to keep my point colors?

Any help on this would be greatly appreciated!

Thanks!
Edited by gmc - Jan. 16, 2019 12:23:22
User Avatar
Member
14 posts
Joined: Nov. 2016
Offline
Gmc, nope - nothing so far
point animations for FBX requires custom unity assets as far as I know;

Alembic for unity developer said he probably (!) gonna update the plugin soon with houdini colors support;

Another option is to create a custom node for Shader graph or Amplify so you can select a color channel -
but none of them seems enthusiastic to do it.

I still hope Houdini community can help with exporting colors properly - they have gamedev tools, probably we should ask this team to help us, so we can use standard vertex color nodes in shaders.
User Avatar
Member
6 posts
Joined: Jan. 2015
Offline
Thank you, gasanoff.
That's a pity. I'll see if I find the time to take a closer look into the importer source code.
I'll let you know if I find something…
Cheers!
User Avatar
Member
86 posts
Joined: Feb. 2014
Offline
A potential clue for potential solving what should have been easy but unfortunately isn't.

While importing ABC's in Houdini I struggle sometimes with the fact that color and Alpha comes in as a 4-vector (RGBA). Houdini sees color as a 3-vector and Alpha as a separate float. For me I can't just re-pipe this, have to peel off channels and recombine them again. Perhaps the same is true for Unity. So in a way the RGBA from houdini might not be valid but should be temporary written out to custom channels.

Hope this makes sense, I will update if I find more answers.
User Avatar
Member
133 posts
Joined: July 2007
Offline
Just ran into issues seeing basic Vertex Color exported from Houdini 17.5 into Unreal 4.22.

Discovered through trial and error to make it work:

1)You may need to triangulate your geo first with a Divide sop, otherwise it might not match engine and vertex indexes with be garbled.
2)Use Color sops set to Vertex, not primitive or point.
3)Use FBX export. OBJ doesn't work.

These results are for Unreal but may apply to Unity as well.
Good luck!
Edited by Len - June 5, 2019 13:43:21
User Avatar
Member
29 posts
Joined: March 2015
Offline
Wrong forum
User Avatar
Member
9 posts
Joined: May 2013
Offline
Hey guys!

Coming from the same place, trying to write my vertex colors onto an ABC that I want to read in Unity. I can see that the latest version of the importer can read them, what I am not being able to do is to write the Vertex Colors on the ABC (can't read them even in Maya :c ). Tried already promoted Cd from Point to Vertex and added an Alpha vertex attr. No luck.

Can anyone share some insights on how or what options set on the Alembic ROP for this to work please?

I imported gassanof's alembic and the vertex colors come through with no problem, so I guess there's something I'm missing when writing those. No problem with FBX though, but ABC is really my only option right now for this.

Cheers everyone!
User Avatar
Member
9 posts
Joined: May 2013
Offline
zeekindustries
Hey guys!

Coming from the same place, trying to write my vertex colors onto an ABC that I want to read in Unity. I can see that the latest version of the importer can read them, what I am not being able to do is to write the Vertex Colors on the ABC (can't read them even in Maya :c ). Tried already promoted Cd from Point to Vertex and added an Alpha vertex attr. No luck.

Can anyone share some insights on how or what options set on the Alembic ROP for this to work please?

I imported gassanof's alembic and the vertex colors come through with no problem, so I guess there's something I'm missing when writing those. No problem with FBX though, but ABC is really my only option right now for this.

Cheers everyone!

Hey everyone!

A happy update about this, if it comes handy to anyone. I found out that in order for the Alembic ROP to recognize and write properly the vertex color data the Cd attribute has to be explicitly created as a 3flt(Clr) type of attribute.

So what I did was declare it as such before adding any coloring operation, but it would be nice that those type of SOPs that have to do with modifying color would do it by default.

With that the Abc ROP will be happy and vertex color is written properly.

Cheers guys!

Attachments:
InitializeCd_as_Color.PNG (32.6 KB)

  • Quick Links