Advertisement

Vertec Array Question + Wireframe

Started by March 31, 2004 07:33 AM
3 comments, last by Ransom 20 years, 11 months ago
ok, i got my height mapping to work. but i got a question, more really about C++ than OpenGL but it still applies. Is it faster to traverse an array or to do math? The reason i ask is that my program which just has a height map in it basically, starts chugging at a step size of 4 or so... if i declare an array of size [(MAP_SIZE/STEP_SIZE)^2] of vertexs, and travers that array after having done the math only once will i see a dramatic increase of speed? also, I''m getting a lot of artifacts when i try to map a texture to my height map. however in my opinion the wireframe mode with a texture mapped (GL_FRONT_AND_BACK, GL_LINES) looks a lot cooler anyway. Is there anyway i can get a boost in speed by leaving it in wireframe? Thanks
Also, is there a way to only make specific things wireframe?

For example if i wanted all my objects in wireframe but i wanted a visible skybox?
Advertisement
nobody has any thought?
in terms of question one, try it. I think that arrays will be faster, particularly since you can then use a vertex array, but the best way is simple to try it. As for your second question OpenGL is a state machine. so call
(GL_FRONT_AND_BACK, GL_LINES) before wireframe objects

and

(GL_FRONT_AND_BACK, GL_FILL) before filled ones

Also keep in mind that wireframe tends to be hideously slow because it offers very little in the way of culling and lines are often rasterized as 2 triangles
instead of setting the texturing mode to lines,

can''t you just draw the line primitves, instead of polygon primitives

or am I wrong ?

This topic is closed to new replies.

Advertisement