SVO渲染:OpenGL还是自定义渲染器? [英] SVO Rendering: OpenGL or Custom renderer?

查看:331
本文介绍了SVO渲染:OpenGL还是自定义渲染器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我计划创建一个Sparce Voxel Octree(SVO)引擎,并且使用openGL来渲染每个小的多维数据集或者在汇编和编写我自己的渲染器。如果我打算做后者,我不确定如何绘制像素到屏幕(我在Mac,10.8)。什么图形上下文/窗口系统将是这个的首选方法(不是X,我有我的问题X的问题在我的Mac上)。

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).

引擎将需要能够绘制至少50.000个立方体(我将使用opencl / cuda来帮助并行处理立方体)。我只想知道如果通过一个特别设计的渲染器绘制更有效率。

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.

推荐答案

API

OpenGL (到一定程度)最便携的渲染API,你至少有机会保持最新的当前图形硬件功能,虽然这也定期创造了它的公平的沮丧的份额。如果你编写的PC,你可以使用DirectX10 / 11提供或多或少相同的功能。 DirectX有一点点驱动程序开销,而OpenGL是一个状态机,并隐藏了很多东西从程序员。我不知道你如何看待做同样的汇编和任何更少的挫折,除非'asm'你的意思是写glsl或hlsl着色器:)

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

我写了一个OpenGL SVO可视化工具,目前在GTX780上以30帧/秒渲染62.000个体素立方体,虽然我的设置不是最优的,还没有使用实例化渲染或三条带或四边形,或基于几何着色器的方法,其中您只发送在框的中心坐标,并生成完全在着色器中的视觉效果。 OpenGL提供了一整套的方法来优化渲染,它的硬件加速。

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

openGL和openCL之间的互操作是微不足道的,CUDA也集成相当好用openGL缓冲区。我有两个这些设置工作在同一个代码库。第三个选择是使用计算着色器(opengl 4.3+),所以你甚至不需要openCL和CUDA来处理你的多维数据集。

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.

你打算通过svo发送光线,还是简单地将轮廓背面剔除,还是多做一些?

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

这篇关于SVO渲染:OpenGL还是自定义渲染器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆