Creation of masks for textures and transparency/opaqueness

Hi, I’m at work and bored so thinking about my game :slight_smile:

I am still looking into the possibility of using a tile-like approach to terrain rendering and trying to solve the transition issue. E.G. lets say you have grasslands (green grass texture) rolling into plains (brown grass texture) and have a tile layout like this:


On the tiles in the middle I would like to have some sort of transition so the change from one terrain type to the other is uneven. Instead of creating hundreds of textures to represent these transitions I was thinking of using masks instead (something I started to do for my 2D isometric version but gave up on).

So a mask image would look like this (simplified for clarity):

1 1 1 1
1 2 2 2
1 2 2 2

Where 1 would mask out one texture and 2 would mask out the other. So this mask could be used to create a transition texture for the terrain above on the second and fourth lines where plains have grassland to the west and north. I could even have several variations of the same thing to introduce uneveness. This would mean all my work would be in one set of masks plus variations and I could transist from any terrain type to any other.

All the transition textures would be created and kept in memory at the time the game loads so as not to impinge on the game loop. Quite a memory pig I would imagine. And this does not solve the issue where you would have an intersection of three or more terrain types though there are solutions for 2D which could be applied here.

I have started to look at the terrain stuff but havent found out enough about it to make a judgement on whether to use it or not. The learning curve looks steep because I want to use it in an unusual way - or am I wrong in that?

Any problems or drawbacks to the above approach? Too ambitious? Anyone seen anything like this done before?

Also I am still struggling with the issue of overlays (like roads, railways, cultivated fields etc) whether or not I use the terrain stuff already built into jME or my own approach. I was thinking of just sticking to simpler terrain generation and using models for the overlays - dont know what kind of performance hit that would imply though. I guess if the terrain is made with fewer triangles/polys then that would give me more freedom to overlay features. One problem I can see is if I use bumpmapping to get undulation in the terrain then overlays would be clipped and dissapear or appear to hover above the ground in places. Anyway, I'll stop now and do some work XD