Good day Unity3d!
So I’m trying to incorporate seasons into my game. Here is a very crude implementation that I have so far: http://pastebin.com/qaBSpg5S
So right now nothing fancy, I take my terrain and cover it all in either snow or grass. I’m not even doing height/slope testing to properly shift the textures which I suppose will add even more to the computation times.
There are two main problems I see with this implementation. The first one is the terrain goes from lush grass to dense snow in 200ms. I’m wondering if there is a way I could gradually blend both textures to make the snow kind of “build” on the terrain. I thought about getting my values, and slowly increment during update() or a coroutine then apply the maps until all values are at the desired range. While this would technically work the main problem is the lockup setAlphaMaps() creates.
My terrain is 1500 x 1500, there’s 1000 x 1000 that’s playable, the rest is simply to make the world more believable. Updating the splatmaps this way locks the execution for about half a second, it’s really abrupt. I can probably deal with that either just leaving the lag there or fading to black when switching seasons. But for a RTS I think fading to black will break the rythm of the game.
Now imagine if I want to slowly blend the textures it means I’ll need to call setAplhaMaps 20-30 times, the game will be unplayable during the transition so there’s no point. I tried reading online about ways to do this smoothly and without locking up the main thread. My initial thought was to call triggerWinter() from a different thread, great! Nope, I get get_Alpha_Maps can only be called from the main thread.
So that’s not possible, I found a package that looks super neat called UniStorm, it looks a bit overkill for what I want (especially since you never actually see the sky in my game) but they have dynamic snow. I believe they achieved this using a shader though. I unfortunately know nothing about shaders so I don’t even know what to search for.
Anyone is familliar on how to update/change the alphamaps on the terrain without locking the main thread?
Thanks a lot!