Wednesday 13 March 2013

Horizontal unwrapping

"Horizontal unwrapping" is something I've been wanting to do in UDK for a while now. The idea is that if you can perform simple unwraps in-engine based on world position, you can use that information to apply things like grunge really easily and ensure its the correct way up, even if your asset has been rotated.

Theoretically, one could even apply that same grunge to all objects in the scene, and it would harmonize them by applying the same dollop of grunge to all objects in close proximity, a bit like a decal might.

The problem I've always hit is that unwrapping based on world position is essentially planar mapping, and suffers all the same problems (stretching at oblique angles).




I tried again to solve the problem by incorporating the user-unwrapped UVs, with no great success, and also by examining the direction of any given face to choose which direction to "project from". Also unsuccessful, resulting in weird stretching and squashing. This was the best result I could come up with, and it wasn't good enough to use:


However, when i settled with the following restrictions:
  • unwrap must be user-unwrapped to be horizontal to begin with
  • objects no longer world-space unwrapped (no benefit of world-space harmony)
I was able to take on the problem from a different angle. Essentially, rotate the user's existing unwrap when the object is rotated, rather than generate a new one.


You may notice I'm using a new rock I made today. This time instead of using 3D Coat I used max to combine the objects. It would have been easier if ProBoolean hadn't been messing me around. grrr.

No comments:

Post a Comment