|
![](/i/fill.gif) |
In article <3df9e374@news.povray.org>,
"Thorsten Froehlich" <tho### [at] trf de> wrote:
> In article <hsi### [at] netplex aussie org> , Henri
> Sivonen <hsi### [at] niksula hut fi> 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] niksula hut fi
http://www.hut.fi/u/hsivonen/
Post a reply to this message
|
![](/i/fill.gif) |