How do I edit a texture for a terrain with OpenGL?

I am programming a map editor for my RTS game. I wanted to know how I could edit the texture of the terrain so that I could make paths without needing a blendmap. I have gone on several forums, and I have tried some different techniques (FBO), and none of them have worked all how I wished they would have (hahaha)!

If you would like me to post images, I can do so!

I also have a youtube channel about my engine as well!

I have been told this is too large of a task for a 1 person project but I do not want to stop trying new things for it until I have it at least sort of figured it out.

I could also use this to help with things such as fog of war.

Could this be done?

Thank you all for your help!

Bind a texture to a FBO, bind the FBO, then render to it.

Note that you can’t modify a texture “in place” this way. If a texture which can be read by the shader program is bound to the current FBO, the results are undefined. You need to either have distinct “source” and “destination” textures, or use image load/store instead. If the texture has mipmaps, they need to be regenerated after modifying the base level.

The main disadvantage of “baking” detail into the texture is that you can’t re-use it (e.g. tiling). So the size of the map is limited by available texture memory.

How to I make the FBO only the texture? I am only able to get it to be a viewport, and while that does look cool, it is not what I am looking for.

Oh no… I need tiling… Is there a way around this? Like, a way that I could edit the texture of each tile?
Is it possible that I could tile the texture being sent to the FBO, and then draw the texture on top of it?

I’m not sure I understand the question.

If the texture dimensions aren’t the same as the window, you’ll need to call glViewport with the texture bounds when binding the FBO, then call glViewport with the window bounds when unbinding it.

If each tile has its own texture, then you can edit it. “Tiling” refers to repeating a single texture across a large area. E.g. if you have a large area covered with grass, you don’t need a different grass texture for each chunk.

That’s a large part of the reason that blend maps are used: you can have a relatively small grass texture and another relatively small path texture, both of which are tiled. The blend map can’t be tiled but it only needs a single channel (or one channel for each texture other than the background) and can have a much lower resolution than the textures being tiled.

I mean, is there a way to write only the grass texture to the FBO, and not a whole terrain? All of the tutorials write about how to make an entire scene and change parts about it, and that is not exactly what I am looking for. I just want to edit the terrain.