[Unity3D Hex Map Game Dev] 49: Major Visual Upgrade - Normal Maps, Team Colors, Emissive Windows

Опубликовано: 04 Июнь 2026
на канале: Re: cOg Mission
424
18

00:00 Intro
00:53 Shaders
02:12 Normal Maps
06:26 Impact of Normal Maps
08:15 Building Upgrades
08:47 Team Colors by Color Masks
10:16 Emissive Windows by Alpha Channel
10:54 Normal Maps applied to Terrain Shader
13:46 Overview Panel

#worldturtles #unity #indiedev
Hello and welcome back to World Turtles. I’m currently working very hard trying to cram as much polished content as I can into the game in time for the June Steam Games Festival, or Next Fest as they’re now calling it. I’ll be setting up live streams for the event, and would appreciate if some of you can have a test run with me, as I’ve never done it before, so please keep an eye out for more detail early June. Now, sometimes progress feels a bit slow, and other times I’m ecstatic after implement something major in a day or two. Today I can show off a few of the additions I’ve made over the last two weeks, and I think they really bring the map to life, so enjoy the ride.

Adventure from bensound.com
Forest Walk, Bonfire, and Adventure by Alexander Nakarada (www.serpentsoundstudios.com)
Licensed under Creative Commons BY Attribution 4.0 License
https://creativecommons.org/licenses/...

Let’s start off with shaders. My knowledge of shaders is a bit shady, although I’m now learning rapidly. What I do know is they are an extremely powerful and performant tool for making it look like something is happening, without expending the system resources to actually make it happen. What do I mean by this? Let’s look at an example.
When the woodcutter chops a tree, the little shiver the tree makes is actual, in that the model itself is rotated in 3D space, a little bit to one side and then back again, over a short period of time. This looks very nice, and is no problem when a few trees shiver at a time. You can also try to use this technique to let trees gently sway to and fro to simulate wind. However, add more than a few trees and this starts getting expensive, and your frame rate drops. But, using shader tricks you can keep the models completely still and rather slightly manipulate the way the triangles are drawn. For example, the movement in these flowers are all shader based. I applied the same shader to the trees. We are limited in how much movement we can get before it starts looking as if the entire tree is moving around, but we only need the slightest of changes to make it look realistic enough and add great value to the overall look of the scene.
the normal vector of our flat texture is always in the same direction. In this example we’re looking straight at a rectangular plane, with the normal vectors pointing towards us, and light shining from us onto the rectangle. If the sun shone onto the rectangle from somewhere to our right, the entire rectangle would darken a bit, since the normal vectors are all equal, and the rectangle reflects less light back to our eyes. But we can override these normal vectors with virtual ones. Let’s divide our rectangle into 4 thinner ones, then colour the second one from the right a bit lighter and the one to its left a bit darker. This changes our perception of the flat texture. It now looks like a ramp has appeared, and if the light was shining from the left, it would look like a dip.
The same basic idea is applied in shaders using normal maps. The tents of the Founders Hex and Wanderers cabins have always had normal maps implemented. Consider the little folds and wrinkles in the cloth. While the texture itself does hint at these, it’s in the normal map that it really transforms into something that looks 3D. You may ask why we couldn’t just make the texture more detailed – surely it would give the same effect? And you actually could, but you would have to redo it for every different direction the light could come from. Let’s see why. The version of our rectangular bars created by changing the colour on some parts of the 2D texture is exactly the same as one that would result from setting up a normal map with one appropriate normal vector for each of the 4 bars. But only with the light coming from exactly the direction we had before. If the source of the light now moves a little bit, the intensity of the colour on each bar needs to change as well. We can calculate this change using the normal vector and the new direction from which the light shines. However, in the case where we only changed the colours of the two bars, we still have the same normal vector for the entire texture. So, our adjustment calculation is going to lead to the same adjustment for the entire texture. The entire texture becomes lighter or darker homogenously. We don’t like that, since it again ignores the virtual bumps and 3D information we tried to work into the 2D texture. It assumes that the change in light angle impacts the intensity of all virtual bumps exactly the same.