Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Texture Splatting with VertexArrays  (Read 1123 times)

0 Members and 1 Guest are viewing this topic.

Parsley

  • Newbie
  • *
  • Posts: 13
    • View Profile
Texture Splatting with VertexArrays
« on: March 23, 2016, 12:55:42 pm »
I'm trying to implement texture splatting 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:



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

 

anything