Frequently when talking about mesh decals in UE4, I get comments about them being annoying to maintain, because every time you change your meshes you have to rebuild / adjust layers of decals.
Now, personally, I don’t really care that much, because my projects are all pretty small, and fixing up decals in Modo is generally a very quick job.
But it’s come up enough that I figured I’d make a “2 metres short of Minimum Viable Product” example of how you could address this.
That’s what I’m calling Houdini Engine + UE4 now, just to continue the tradition of me being annoying.
Right. Houdini stuff.
I made a digital asset:
There are two inputs, which will get fed in from UE4 (later).
In the Houdini scene, #1 input is the object I want to generate a decal on, object #2 is a projection plane.
The stuff on the left is actually all redundant, but what I was planning to do was construct layout patterns in Houdini for different decals on one sheet, and let Houdini just automatically do the UV layout. But procedural UV’ing got super annoying, so I decided not to do that.
Extrude plane, cookie with box:
Delete faces that are on the opposite side of the projection (dot product driven delete sop, basically).
Since I couldn’t really get the UVs working the way I wanted, I created a centre point on the projection plane, get the normal and constructed U and V vectors, which I then project onto the verts in the decal mesh.
I did that all in VEX, because it seemed like a good idea at the time.
I was fairly annoyed with working on it by this point, so I just exposed the rotation and scale of the decal so you can play with it in Unreal 🙂
Back in UE4
With that done, and the thing saved as a Houdini Digital Asset, time to load up a shamefully unfinished UE4 project (there are lots of choices here…).
The workflow is:
- Load the digital asset into the content browser.
- Drag a copy into the scene.
- Using “World Outliner Input”, Select a plane for the projection, and an object to put decals on:
Bam! New decal mesh, floating over the top of the original object, you can save it out using the Houdini engine bake stuff, or whatever you want to do.
I didn’t bother taking this too far, because I don’t really intend to use it myself, but if I thought it was going to be useful there are a bunch of things I’d probably do.
I mean, aside from completely re-build it from scratch, because it’s a whole bunch of broken hack right now…
- Expose a few different projection types
- Create separate Houdini asset that lets you lay out planes on a decal sheet to define regions for different decals (which I started on)
- Make it work with multiple planes passed into the one asset
With any luck, Epic will just come along with a similar workflow where you can press a button on a projected decal in editor, and it will do this sort of thing for you 🙂
(In the meantime, I’ll just stick with manually doing it in Modo, thanks very much…)