Exporting Vertex Colours from Houdini

houdini

#1

Hello,

Thought I would share this quick tip in case anyone else was curious.

*Note : ‘right-clicking’ and ‘re-importing’ the fbx into Unreal doesn’t work. You have to delete it and then re-import if you update the mesh. I am sure this could be done with Houdini Engine. The project I am on doesn’t currently use it though.

Hopefully I explained it well and it’s useful for someone else.


#2

This is great stuff to share!
But a couple of questions. Why use three vector ramps? You would get the same result with one.The second question is why you are running it over verts instead of points? An Unreal Vertex is a Houdini point or am I missing something here? Lastly, is why you do this on a grid. The first calculation (@ptnum/@numpt) gives you the equivalent of @curveu on a curve. So if this was a sweep along a curve it would makes sense, but on a grid it’s hard for me to grasp. If you add a single edgeloop (to for example fade out the edges) it would break it all wouldn’t it?


#3

I use three ramps so I can control the ramps individually out of the point vop. Just visually see what I am tunkny per channel.

You could definitely approach this a lot of ways in Houdini, you’re right. This was perhaps one of the simplest approaches to get there. A grid was used because there’s plenty of tutorials on adding noise a bunch of ways to a mesh. Figured I would leave that out to make it less messy.

It works with verts. My logic was vertex color, use the verts.


#4

Right, vertex works but depending on the mesh it can be several times as memory heavy than point for the same result as there is a vertex for each primitive a point is connected to.

As a test, make a 1000x1000 grid and give it a color. If you store it on points and export it as a FBX it’s 73 mb. If you store it on verts, it’s 134 mb. Unnecessary waste.

Vertexdata in houdini can be looked at as smoothing groups if you come from another package and should really only be used to define hard and soft normals (at least when we are talking about things that eventually will become FBX). For other data, points is the better option.

As for the grid part, I’m not against having that topology. It’s the creation method I’m questioning. If you add noise to the mesh in the picture, it’ll break early. Small amounts are ok but you’d need more topology for any significant distortion. That’s where the problem comes. You can’t change the topology in this setup as you have based the ramps on the pointnumber distribution. A more stable way would be to sweep a 2x2 grid along a resampled curve. It would 1, give you the ability change the topology and density. 2. You have more control over a curve than a twist deformer and 3. It automatically calculates curveU based on the curve length so you don’t need to do that manually.

You could also base the curves on the UV coordinates so you can have a ramp (or three…) going across as well, allowing you to fade the hard edges out in case you ever want to use a tiling texture.


#5

#6

You do not need to delete it and re-import it, Simply open the Geometry you wish to update inside of unreal and go to import settings > asset import data > Mesh and change Vertex Color Import Options to what you want it to do, In your case override or replace (think ignore is default), Simply click re-import and done.

Also i thought it would be cheaper if you simply controlled and generated your gradients inside a material instead of working with vert color from your DCC tool. Simply put you have an easier control and you shouldn’t need houdini engine if you set it up right before export. I agree with what Andreas said above, A setup of your UV’s based on a path you already control would be better even if you use houdini engine to bake meshes in Unreal your uv’s should always be 0-1 from the start of a curve to the end of it. Andreas Tutorial on the sword slash should cover this.

PS not raining down on you or anything, we are giving feedback on the approach.


#7

Thanks for the feedback @DieByZer0 and @Partikel. Still relatively new to UE4. So happy to learn some new things :slightly_smiling_face: