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

Author Topic: Terrain questions: general approach, texture splatting, maps  (Read 2268 times)

0 Members and 1 Guest are viewing this topic.

mvlabat

  • Newbie
  • *
  • Posts: 7
    • View Profile
Terrain questions: general approach, texture splatting, maps
« on: September 05, 2014, 04:12:44 pm »
Greetings to everybody. I'm new to game creating, OpenGL, SFML and you forum )
Currently I'm writing my own terrain engine, so to say...  I intend to make a level editor in the future. My ambitious plan is to make something like this:


Looks like an impossible task for a newbie because of using custom shaders and abstruse formulas, but I want to implement at least texture splatting on edges...

Struggling with google I hoped to find some tutorials about making such terrains but all my requests were to no avail.

So
1) My current approach is to make a vexel array for each land area containing different textures. Somehow I want to make texture splatting in vexel array intersections. By the way I use vertex arrays of different types, not only quads.. Does it make sense in order to draw a terrain?
2) I have heard about using alpha maps for splatting textures. But I have no idea how to implement this... If it is a large topic could anyone advise me some articles or literature about this?
3) I'll repeat that I'm new to SFML and I don't have any knowledge of OpenGL actually. Can I reach my goals learning SFML only? Or do I have to learn OpenGL basics first?

Thank you for your further helpful answers.

mvlabat

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Terrain questions: general approach, texture splatting, maps
« Reply #1 on: September 09, 2014, 09:26:30 am »
Excuse me to up this

Ztormi

  • Jr. Member
  • **
  • Posts: 71
  • Web developer by day. Game developer by night.
    • View Profile
Re: Terrain questions: general approach, texture splatting, maps
« Reply #2 on: September 09, 2014, 01:12:33 pm »
To me it just looks like it's just splatting alpha channel textured quads with different layers.

Simple way to achieve this would be:

-Have all your quads or "splats" stored in collection(s).
-Add new quad to collection on mouseclick, you could detect if there's already quad added within certain radius so you can remove the old one.
-Create vertexarrays for each terraintype. Loop through your quads and add them to the corresponding vertexarray.
-Render all vertexarrays from bottom to top.

If you're a newbie I'd suggest you to ditch the vertexarrays and quads at first and implement the same functionality with Sprites first. After you've got the general idea how the thing works you could optimize it to use vertexarrays.