POV-Ray : Newsgroups : povray.general : OpenGL to POV : Re: OpenGL to POV Server Time
5 Aug 2024 04:20:49 EDT (-0400)
  Re: OpenGL to POV  
From: Henri Sivonen
Date: 17 Dec 2002 08:49:09
Message: <hsivonen-836A11.15490717122002@netplex.aussie.org>
In article <3df9e374@news.povray.org>,
 "Thorsten Froehlich" <tho### [at] trfde> wrote:

> In article <hsi### [at] netplexaussieorg> , Henri 
> Sivonen <hsi### [at] niksulahutfi>  wrote:
> 
> > I need to generate a POV-Ray scene file from a scene that has been
> > programmed in OpenGL. Is there an implementation of the part of the
> > OpenGL API that deals with geometry that would output POV scene files
> > instead of rendering?
> 
> Hi Henri,
> 
> Nice to see you are still out there and using a Mac.

Hi! Yes, I'm still a Mac user but on the OS X side nowadays.

> I am not aware of any library that will do it, but assuming you have just
> meshes, I think those can be converted without too much work.  But it really
> depends on what you have.  Of course, converting textures and such will be a
> little bit more difficult.

I ended up implementing the required (very small) subset of the OpenGL 
API myself in such a way that the function calls generate POV scene code.

We've got a labyrinth made with OpenGL. The textures for the walls, 
floor and the ceiling are now prerendered in POV-Ray using the 
orthographic camera. When the labyrinth app is compiled against the 
"povgl" implementation, it generates the .pov files for the textures and 
when it is compiled against the real OpenGL library, it uses the 
POV-rendered textures.

This way, we get to use nice procedural textures from POV-Ray's include 
library and we get per-texture-pixel (diffuse) shading with cool 
area_light shadows instead of OpenGL's per-vertex shading without 
shadows.

-- 
Henri Sivonen
hsi### [at] niksulahutfi
http://www.hut.fi/u/hsivonen/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.