Jump to content
art3mis

Shader to offset UVs before alembic export

Recommended Posts

Posted (edited)

Successfully exporting a small crowd using the stadium shelf tool into Unreal.
The problem is I only get a single character material or texture atlas applied to ALL 50 crowd agents in the alembic.
In Houdini there are 9 different texture atlases randomly applied.

Since inside Unreal you lose access to the individual crowd agents, my thinking is that the correct solution is the following.
For 9 material variations represented by 9 different texture atlases I would create one 3x3 master texture containing all 9 variations
Then I would need to somehow create a shader that will randomly offset the UVs for each character BEFORE they get rendered as an alembic.

Can anyone help with this?

houdini.JPG

unreal.JPG

Edited by art3mis

Share this post


Link to post
Share on other sites
Posted (edited)

I think you will have to build a special material inside Unreal, just like Houdini has done for the mocap biped asset. What's happening inside Houdini is a the texture index is used to select which map to apply. You'll need to find the equivalent of that inside of Unreal, such as passing an attribute index along with the mesh geometry.

Perhaps check out MaterialLayers..?

https://docs.unrealengine.com/4.26/en-US/RenderingAndGraphics/Materials/MaterialLayers/

 

Once you come up with a material that works for your case, you may want to write a tool in Houdini that examines your Houdini materials and kicks out an Unreal python script that you can run inside the Unreal Editor to migrate that materials into that render system. 

Here is a link to a short script that shows how to generate a material linked to external files. (i.e. diffuse, normal, ao maps.)

https://forums.unrealengine.com/t/solved-connect-a-texture-to-a-material/151392

Edited by Atom

Share this post


Link to post
Share on other sites
Posted (edited)

Thanks for the feedback!
I considered passing an attribute index along with each crowd agent however what I don't understand is how to access the mesh of individual crowd agents inside the alembic once it has been imported inside Unreal.
Won't this be necessary to accomplish what you are describing? AFAIK Unreal just looks at the alembic (in my case comprised of 50 crowd agents) as a single object when imported as Geometry Cache?
That's why I reasoned the material variation has to be done via offset UVs in Houdini on each crowd agent before it gets rendered out as alembic.
I'm probably missing something...

Edited by art3mis

Share this post


Link to post
Share on other sites
Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoticons maximum 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.


×