Home Game Development opengl – How do I modify elements of a texture on a quad?

opengl – How do I modify elements of a texture on a quad?

0
opengl – How do I modify elements of a texture on a quad?

[ad_1]

I’m programming a Real Time Strategy recreation, and I used to be questioning how I may retexture one a part of a terrain quad to vary a texture within the place the place I click on at. For instance, if I clicked within the middle of the terrain, I may change the usual grass texture into a mud texture.

I used to be contemplating, maybe, utilizing mix maps, however these wouldn’t work, as they map out the terrain pre-render, as is finished by a heightmap.

Here is a video of the RTS recreation in the intervening time

I intend to make use of these in order that I can retexture the bottom when there are bushes (like within the picture beneath):
enter image description here

or if there are farms (minus the wheat, simply the tilled land):

enter image description here

or, final, however not least, sources:

enter image description here

Are there any shader strategies that I may attempt to get an impact much like these? If so, are there any sources that I may attempt that would offer me sufficient info? It doesn’t should be in C++/OpenGL. I’m in higher want of a proof of how I may do that accurately and effectively, with the intention to give the RTS map extra taste.

I’m prepared to supply any code that is perhaps wanted of me.

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here