Question

I am planning on creating a Sparce Voxel Octree (SVO) Engine and am caught between using openGL to render each little cube or write my own renderer in assembly and c. If I was going to do the latter, I am unsure on how to draw pixels to the screen (I'm on a Mac, 10.8). What graphics context/windowing system would be the preferred method for this (not X, I have my shares of issues with X on my Mac).

P.S. the engine will need to be able to draw a minimum of 50.000 cubes (I will use opencl/cuda to help with parallel processing of the cubes). I just want to know if it would be more efficient to draw through a specially designed renderer.

Was it helpful?

Solution

API

OpenGL is (to a certain extend) the most portable rendering API, and you have at-least a chance at staying up to date with current graphics hardware capabilities, though this also regularly creates it's fair share of frustration. If you code for PC, you can use DirectX10/11 which offers more or less the same functionality. DirectX has a bit less driver overhead, while OpenGL is a state machine and hides quite a lot of things from the programmer. I'm not sure how you see doing the same in assembler as any less amount of frustration, unless by 'asm' you mean writing glsl or hlsl shaders :)

Svo

I wrote an OpenGL SVO visualizer that currently renders 62.000 voxel cubes at 30 fps on a GTX780, though my setup is not optimal, i.e. it does not yet use instanced rendering or tri-strips or quads, or a geometryshader based approach where you only send in the center coordinate of the box and generate the visual entirely in the shader. OpenGL does offer a whole stack of ways to optimize the rendering, and it's hardware accelerated.

Interop

Interop between openGL and openCL is trivial, and CUDA also integrates quite well with openGL buffers. I have both of these setups working in the same code base. The 3rd alternative is to use compute-shaders (opengl 4.3+), so you don't even need openCL nor CUDA for processing your cubes.

Do you plan on sending rays through the svo, or simply render the outlines back-face culled, or doing something extra?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top