Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Voxel Engine : performance

horiahoria Member Posts: 32
Last week I was working on a voxel engine (well at least a basic ideea of it) .I scanned a image into a matrix and used red values in each of it's pixels to draw a height map. Here's the really bad part : i drew cubes (this were my voxels)(aprox 100 hy 100) every time i redrew the viewport, and i drew them all. Now I saw a example code (pretty vague) and they were drawing only the voxels that were inside some rays or something like that (I think it was the frustrum).
My question is: How do I do that? or anything that can help me.

P.S. : I used Borland C++ Builder with OpenGL API.

Comments

  • CroWCroW Member Posts: 348
    Why doesnt you use Vertex/Triangle-Based rendering?OpenGL was created for faster rendering of polygons,not software-based voxels.you could render your heightmap by creating to triangles between 4 points in your heightmap.i tried this myself some time ago and it draws more than 250fps (havent the exact value in mind at this time) on my gf3 ti200.

    to speed the things a little up your could check which vertices (or voxels ;) ) are behind the viewer and couldnt be seen.this could be done by the vector-dot-product of the look-at vector and the vector cam-pos to the vertex/voxel.angles larger than 90 degress are behind the viewer.

    in my oppionion ogl creates better quality-images faster than any software-renderer/voxel engine on todays gfx-cards.although you re using ogl to create render your boxes,you cant take advantage of ogls speed.
Sign In or Register to comment.