Of course, I ran into some issues here and there; here are some of them:
Black. Caused by shader error.
I had barely any idea on how to get to the wanted result here; this is when I decided to dig through my old code.
Final result. Downloaded textures from http://www.kenney.nl/ (I like his art; it's almost minimalist) and tweaked a couple of them to get the 3 textures for grass, dirt, and rock. I don't know if I'll be keeping them or not though.The texturing is more difficult than it looks, or at least I did it in an unnecessarily difficult way.
For each triangle of the terrain, I assign each vertex a color of R, G, or B. If you render it, it'll be like this:
And for each vertex, I also basically assign the texture that corresponds to its element. So rock can be paired with R(ed), dirt with green, and grass with blue. Each color combination of R, G, and B of the triangle tells how much each of the 3 elements influence the final pixel. This means that the middle of the triangle would have a pixel that blends the 3 elements equally.
So yeah, that's how I did blending.
I think I'm going to attempt to implement my newly-written library into Earthrunner, the game I worked on and released as beta.

.png)
.png)

No comments:
Post a Comment