Vertex animation LODs

vertexanimation
lod
ue4

#1

Hey peeps, been a while since I posted here!

Has anyone ever given thought about making LODs for (soft) vertex animations? Specifically when I sim something in Houdini and bring it in unreal.

If I decimate the mesh before simming the animation will be different and not sync up. If I decimate the mesh after the sim the vertex numbers will change so I can’ t use the same position texture.

Has anyone done this succesfully?


#2

Hello, from what I understand, vertex animation texture is points based.
Meaning that each points register one line of pixel in Y axis.
Example : you have 1024 points in your mesh, you will have 1024 lines.
Altering the mesh means you need a new texture.

So I guess you will need to swap the texture as you switch lod, I don’t know if its possible and I don’t know if its optimized since you will need to load severals textures. :thinking:


#3

The only reliable way I can see is to create a new mesh and texture for each level and hard swap between. Then unload the unused one quick. That said, I don’t think you would gain much by doing so.


#4

Altering the mesh doesn’t mean you need a new texture. You can use the same 1k texture if you reduce your mesh to 64 vertices. You are simply removing lines you don’t need, but the data is still valid for the other lines. Yes, you still have to use the 1k texture, but you can at least reduce the vertex count, better than nothing I guess ¯_(ツ)_/¯


#5

It can most likely be done with custom mip maps of the texture and swapping meshes but… there are probably more low hanging fruit that can be optimized instead? :slight_smile:
Maybe an additional optimization step using custom mips could be to lower the framerate to save a little bit more memory, but that depends on if you can tell Unreal Engine to disregard MipLevels on texture load to skip mips above level X - not sure about that :thinking:


#6

Thanks for the replies!

I got it to work by reducing the mesh in houdini and deforming it using the original sim as a guide. Then exported it as a separate mesh + position texture, which I set up using custom lod meshes and material instances in unreal.

Think it’s a pretty decent optimisation since every LOD halves the polycount and texture size, seems good for our project at least.

If anyone is interested I could make an example of how I did it sometime!


#7

out of curiosity, how much of a performance gain do you see?
Are you sure that not all lods are all kept in memory at the same time? you might be saving some vertex rendering but trading those lower vertex numbers might count for an increased memory footprint


#8

I’m not sure about that tbh!

Quite swamped at the moment but I might be able to do some exact profiling soon