How to blend textures on 2 objects

Viewed 48

I am writing a topdown shooter, where the player constantly moves to the right to progress. I cubes (plates) that are used as the floor as the player advances through the game. Each plate has a different texture - snow, grass, etc - which I choose at random. The question - how do I blend the textures on one plate with the following plate. I assume I will have to spawn them overlapping, but I don't know what technique to use to gradually transition from one to the other. I'm not looking for a full written solution, just a nudge in the right direction so I can look up the right terms to start learning how to do this.

1 Answers

Vertex Colors: You could color each cube with vertex colors, but that would typically limit you to 3 or 4 different textures to blend between... Also the transition is hard when the cubes are just overlapping. If you have a single object (consisting of connected cubes) you could make use of the blended vertex colors.

blended vertext colors

The texture blending can be achieved like this: Vertex Colors blue and black, you can see the blending between the areas (blurry gradient) Vertex Colors

If you blend like this:

enter image description here

You will get this: enter image description here

And if you also use a height-map + PBR maps, it can look like this: enter image description here

I guess this approach is very limiting to the number of possible blocks.

Tiles:

Like in 2D Tile Editors, you need to model/texture different objects to use between your cubes. Example:

Grass Cube - Transition Cube - Sand Cube

And then you need a transition Cube for every possible transition.

The amount of required transitions grows fast when you add base blocks!

enter image description here

Tiles Source Kenney.nl

That could be combined with Wave Function Collapse which was used in TownScaper.

Related