VBO/IBO Terrain Rending Problem

Started by
1 comment, last by _OskaR 13 years, 10 months ago
Hello, I am having a heck of a time getting my head around vbo/ibo fully.
Right now my terrain is rendering wrong..it is rendering with two layers..when it should only have one.

Photobucket

The diagonal solid strips aren't supposed to be there...only the triangles. This is causing me problems because it makes it so that the terrain appears to have two layers in some parts.

For example here is two screenshots of me inside of the terrain.
ScreenShot1
ScreenShot2

Here is a pastebin of how I create and draw my terrain.
My code

Normally, I render my terrain with GL_TRIANGLE_STRIP. I am only using GL_TRIANGLES atm so that I can see what is going on easier.

Any help would be hugely appreciated..this has been bugging me for a while.

Thanks.

[Edited by - Erebel on June 29, 2010 8:04:54 AM]
Advertisement
*Cleaned post
For GL_TRIANGLE_STRIP looks not bad but U don't finished strips. U do sth like:
img1U draw next line (of triangles) but U still draw triangle strips - so also U have one big long triangle (that's the 2nd layer).
U need to draw an "empty triangle" (by adding few indices):
img2and U will have one big triangle but one side will be equal to the zero so U will draw (invisible) line.
For GL_TRIANGLES indices are wrong - U have 2 indices for two triangles (should be six).
U can chceck FFT Ocean Simulation - http://www.nvidia.cn/content/cudazone/cuda_sdk/Linear_Algebra.html - it's also indexed grid with triangle strips.

This topic is closed to new replies.

Advertisement