1

Background: I'm writing a program that creates generative art. I care about creating one final static image, and I don't need to render a bunch of frames per second. So far it's been 2D, and I'm on a Mac so I've been using the Core Graphics (aka Quartz) 2D drawing API. I've reached it's limits so I started messing with OpenGL, but I'm not happy with the antialiasing so far.

I'm wondering if I should invest in learning it, or whether it's not built for what I want. Is OpenGL more about creating moving graphics as fast as possible, mainly for games? If I want the highest quality rendering (high resolution, smooth curves, best antialiasing, arbitrary lighting and shading algorithms) do I need to write my own renderer, or does it make sense to learn OpenGL? Will I be able to use it as a base?

Rob N
  • 15,024
  • 17
  • 92
  • 165

4 Answers4

4

OpenGL is not a general purpose graphics library.

OpenGL is a API with the design being focused on controlling GPUs for purposes of drawing realtime graphics. If you know how to use it you can use OpenGL to generate high quality, close to photorealistic drawings. But it takes a lot of effort to do this.

Antialiasing is actually rather easy to do with high quality: Select a multisampled frambuffer format with a high subsampling density, enable multisampling and render.

However your use case sounds more like the task for an offline renderer like Renderman, Pixie, Yafa-Ray, and similar.

datenwolf
  • 159,371
  • 13
  • 185
  • 298
2

You want RenderMan, Pixar's CGI rendering software. Your program could either generate RIB files, which are intended to be the 3D equivalent of PostScript files; or you could use the RenderMan C API directly.

RM has a richer set of built-in primitives, for instance quadrics and subdivision surfaces, and since it's designed for film work you can do everything from toon shading to photorealism.

3Delight have a free/low cost RM renderer you can use on single systems, and Pixar announced a month or so back that they will be providing a free version of RenderMan for individual use Real Soon Now.

The RenderMan Companion by Steve Upstill is the classic guide to programming RM. A more recent book is Rendering for Beginners by Saty Raghavachary.

Hope this helps.

Hugh Fisher
  • 2,321
  • 13
  • 8
  • Wow, I was looking at open source stuff like povray, but if 3Delight is free... I just downloaded it. Thanks. – Rob N Jul 18 '14 at 03:29
1

Is OpenGL the right choice for highest quality renders, without time constraints?

No. As datenwolf has explained, OpenGL is designed to take full advantage of the capabilities of the GPU to do real time rendering. There are existing products designed for extremely high quality renders.

Is OpenGL the right choice for your project?

Maybe. None of the capabilities require a high quality renderer, and all of them can be done fairly easily in OpenGL. The main thing that it does not support is ray tracing.* If you need your renders to be ray traced, then you would be better off looking at other options.

*It is theoretically possible to do ray tracing in OpenGL, but would be a lot of work.

fintelia
  • 1,201
  • 6
  • 17
0

For quality? No.

Sure, you can get far, but as fintelia stated, it does not support raytracing (could do that with OpenCL, but that's not really OpenGL). There are indeed some impressive OGL/D3D renderers out there, but most of the renders seen today are software ones (CPU/Parallelism/CUDA/Compute), V-Ray, Mental Ray, Renderman.

Graknol
  • 21
  • 2