SFML community forums

Help => Graphics => Topic started by: Parsley on March 23, 2016, 12:55:42 pm

Title: Texture Splatting with VertexArrays
Post by: Parsley on March 23, 2016, 12:55:42 pm
I'm trying to implement texture splatting (http://www.gamasutra.com/blogs/AndreyMishkinis/20130716/196339/Advanced_Terrain_Texture_Splatting.php) but having trouble figuring out how to do it with SFML/OpenGL. I have an sf::VertexArray where I store my tile map, like so:

(http://pokingwatergames.com/wp-content/uploads/2016/03/20160323-SplattingExample.png)

Each tile is drawn with its own Quad in the VertexArray. According to Texture Splatting I am supposed to pass two textures to the shader and alpha blend them in there. Is it possible to blend the Quad that is underneath with the Quad that is on top (e.g make it so some of the sand and dirt shows through on the grass Quad), and if so how would I do it? Or is the information underneath the grass Quad "lost" by the time it gets to the shader, and so the shader would not be able to manipulate it?

I hope my question makes sense