Hello,
is there anybody who can help me please?? I’m developing terrain engine. It uses 4 TUs for interpolating textures and finaly modulating result fragmets with primary color, which is calculated as a “slope lightning”. CLOD and culling algorithm is disabled. By normal way, rendering polygon by polygon, everything works fine.
Now i have decided for performance boost, as the power will be needed for hand gesture recognition in my project.
Vertex array with color array alone (without textures) boosted my FPS almost 3 times, as i expected. The original way how i did interpolation was setting alpha of GL_TEXTURE_ENV_COLOR and used GL_INTERPOLATE mode for TUs. But the problem is, that there is no way how to change GL_TEXTURE_ENV_COLOR with vertex arrays, one value per polygon (or even vertex).
So i have decided to render 2 triangles per one GL_TEXTURE_ENV_COLOR change, rendered by glDrawElements. I expected some performance fall - from 60 fps with arrays, without textures, to 30 fps with textures. Instead of performance fall, performance disaster came, slowing down to 3 fps.
So the question is:
Why the rendering procedure, 20 lines of code, no math, with arrays, runs at 2 fps, where rendering with 150 lines full of math (calculation of tex coords, vertex position from heightmap…) runs much faster?
Is there any way how to use arrays, or even buffer objects, together with interpolation of textures?
Thank you very much for any hints,
best regards
J. Bastek