Gradual Texture changes using code?

You guys remember games like Black and White 1, right? I’m pondering about how one would make texture effects like what they had where as you do something in-game and trigger an integer to increase, that causes the texturing to change and for little particle effects to be added. It would be also really nice to maybe look into how to do this to terrain as well or sky because one of the awesome things about Black and White 1 was the more evil or good you got the actual surroundings within your realm would change. The sky would turn blood red and bats would appear around your temple or you’d have a rainbow and very bright sky appearing with doves flying around instead.

Now the code is simple enough I know because it would just be various combinations of if statements reacting to how high an integer goes like alignment points or something. However I want to know how I would do all this gradually the same way Black and White did. So for instance would I make use of alpha in the materials? I know I would have to actually draw the textures in different stages of transformation and so on but even then I suspect if I use just set texture and so on it will just switch on right away instead of fat in and out?

Actually a classic example would be like from Starcraft with the Zerg and the creep, that’s the sort of affect I’m thinking of, where the texture actually grows across the terrain.

Around 0:38 is the kind of thing I’m definitely thinking of, where the overlord actually spews out creep and it spreads out on a surface, it’s such a nice effect for games and actually makes for some interesting gameplay depending on how you apply it.

I didn’t play Black & White before but if I’m not mistaken.
I made this kind of gradient between 2 textures shader before on my game.
It’s a custom shader which include 2 diffuse slots and a drag-able value from 0 to 1.
So 0 will display texture A and 1 will display texture B. 0.XX will display N% of both.
So you use script to manipulate the value during run-time in your game.
I remember that time I made it by using Strumpy Shader Editor but now is deprecated.
So maybe Shader Forge is your next help or find custom shader resources online.

For the Star Craft 2 terrain. It looks like the concept is same as above.
But this time is blending using vertex paint I guess. The terrain got 2 textures applied.
It display texture A when vertex color is black and display texture B when vertex color is white.
And use some kind of detection to manipulate the vertex color via script. Just my guess.

Hope this can bring you some inspiration.:wink:

1 Like

Ouch 90$, that makes sense though because it looks like quite a specialised thing to get it all functional and easy to use, looks like this is going to be something for me to experiment with later on, but thanks for the tips on how to get it all done it looks quite advanced.

Shader forge looks pretty nice though, I was thinking how nice it would be if we had RPGs for instance with alignment systems where the terrain would actively grow and change depending on which sides you picked and so on. Another game I just thought of which actually has this very feature is Total War Warhammer and what happens is when Chaos and Vampiric corruption spreads the actual landscape itself changes and becomes warped or dead depending on the faction.

One of the few interesting features creative assembly actually did well in that game compared to everyone else but it wasn’t very prominent in the game. There’s also a game called Startopia now I remember that had a similar thing except it was with customising and making terrain and a lot of simulator games do this, ah well, something for later projects I guess.

Sounds interesting. Could you find some other game-play video which has this kind of effects.
Let’s take a look and maybe we will realize something or other people can share with you something too.:wink:

Won’t be much help I don’t think because I’ve literally just started learning about this aspect of Unity but I can give some examples.

In particular you’ll immediately notice what I was on about with Total War just how different the provinces occupied by vampires look compared to the other provinces where they aren’t, all of that happens dynamically. It’s a great way of making it so that the terrain isn’t just static and lifeless if you want to make things more interesting for the game environments.

With Startopia, they have this thing called a biodeck on the space station and you can change the amount of moisture and stuff in the ground to grow different plants and what they’re clearly doing is the shader gradients that you talked about.

I just find those kind of effects very interesting and wanted to learn about them, another thing I appreciated a lot when I was young when playing games was how nicely designed some interfaces were back then and how interactive they were rather than just being boring static images or buttons. Button design is a hell of a lot easier to learn about though and I’ve had no problems finding out about that because it’s all just sprite swapping and good art.