As a beginner in OpenGL i was wondering what could be the best way to render a textured terrain.
The data is stored in a grid-like structure and for every point the height and the texture (which could be i.e. grass, mud, stone …) are saved.
At the moment i render the grid multiple times, one time for every possible texture, specifying glColor3f(1.0,1.0,1.0) if the texture is set on a given point and glColor4f(1.0,1.0,1.0, 0.0) if the texture is not set, creating a smooth fade.
To me this doesn’t seem to be an efficient way so i’m asking which other ways could be possible to do this. Any hint would be apprechiated.
It covers just about everything you’ll ever need to know.
I am not deliberately ignoring your question, but when you look at that site you’ll see there is just such depth to this subject that you really need to absorb some more info before asking questions about technique… It will save you time in the long run.
I already thought there would be no simple answer to my question
I took a quick look on that site, and some techniques described there go pretty much in the direction of my idea (even if much more advanced!), gonna take a closer look at the links provided there.
I found a technique called “splatting” which suits my needs. It uses multitexturing and the setup for the texture stages, unfortunably, is written for D3D.
Can anyone “translate” me this to OpenGl code, please?
What do i have to add for lighting?
And i would like to understand how this things work together but couldn’t find any explanation of glTexEnv which covers also the GL_COMBINE_x and GL_SOURCEx_x parameters. Is there any good reference or tutorial?