briochie / wow.unity

A collection of assets to make working with wow.export easier in Unity.
MIT License
18 stars 8 forks source link

Feature request: Replace tile meshes with Unity terrain #7

Open oyvind-stromsvik opened 1 year ago

oyvind-stromsvik commented 1 year ago

I haven't done any work towards accomplishing this myself because I was already able to import the tiles as Unity terrain using this package: https://github.com/oyvind-stromsvik/WoW2Unity

The above package only works with an old custom compiled version of wow.export, but maybe it can serve as a source of inspiration for whoever wants to try and implement this feature in this, otherwise superior, package :)

In my project with about 25 tiles of Elwynn Forest I'm seeing about a 2x performance gain with 25 Unity terrains VS 25 * 256 tile chunk meshes. And it looks identical, except the Unity terrain doesn't have this shading bug: https://github.com/briochie/wow.unity/issues/6

The only manual change I had to do to achieve an identical result was that the original mesh tiles were rotated 180 degrees around the y-axis compared to the terrain, and you can't rotate terrains so I rotated the tiles to match. This was mainly to compare things 1:1, but then I realized that I felt the original tiles were rotated the wrong way anyway. Having positive z be north and positive x be east makes sense for me.

The texture blending has the same issues with both approaches, which maybe can be fixed with more intricate shaders for all I know, and obviously Unity terrains is a lot easier to work with, and allows for much more flexibility in terms of modifications. Unity now also supports painting holes in terrains, which worked perfectly for carving out the cave entrances etc.

briochie commented 1 year ago

This is on my radar, but not high on my list. Unity terrains can be more efficient if you haven't done any sort of optimization on the map meshes. After baking occlusion culling, the difference is night and day, and I typically find to be much more performant that Unity terrain. There are actually packages out there to convert Unity terrain into obj chunks like this to improve performance on mobile.

But at any rate, I can see the use for a more easily modifiable terrain. It's on the list.

oyvind-stromsvik commented 1 year ago

You're probably right. I've never viewed Unity terrains as particularly optimized myself. I just assumed it had to be better than 7000+ meshes with unique textures/materials, but like you say there's probably ways to make the meshes a lot more optimized than the terrain.

I personally knew I didn't want to spend any time on optimizing the meshes since having terrains would be massively beneficial in terms of allowing me to modify things for gameplay reasons, but after having spent a few weeks in the "wow export scene" I've gathered that most people aren't involved in this to make "wow, but better" like I am 😅

briochie commented 1 year ago

Yeah, most people just make art. Some want to make game projects, but it's not very common. Especially since you can't really share your game with people.