POV-Ray : Newsgroups : povray.unofficial.patches : OpenGL support idea Server Time
10 Oct 2026 11:31:20 EDT (-0400)
  OpenGL support idea (Message 1 to 21 of 21)  
From: David C
Subject: OpenGL support idea
Date: 15 Jan 2001 12:04:45
Message: <3a632dad@news.povray.org>
I am wondering about adding an OpenGL preview for animations. I have three
questions.

- Would it be legal to distribute since OpenGL would be doing the
rendering and povray would only be doing the parsing?
- Is it being done already?
- Is it somthing that the povray comunity would be interested in using?
(besides me)

I am thinking of just using it for very fast test renders, using quick
colors instead of real textures and simple lights so you can see how the
objects look and how the camera moves. You could then tweak it very
finely for animations since the edit/render/view cycle would be shorter.


Post a reply to this message

From: Chris Huff
Subject: Re: OpenGL support idea
Date: 15 Jan 2001 12:44:01
Message: <chrishuff-AECD5C.12452115012001@news.povray.org>
In article <3a632dad@news.povray.org>, "David C" <dav### [at] satnet> 
wrote:

> I am wondering about adding an OpenGL preview for animations. I have three
> questions.

This would probably be harder than you think...the code for setting up 
OpenGL would be platform dependant, and you would have to use something 
like Warp's tesselation patch, because most objects are rendered 
directly, not tesselated.


> - Would it be legal to distribute since OpenGL would be doing the
> rendering and povray would only be doing the parsing?

I don't think there would be a problem, as long as the version you are 
distributing consists of everything in the official version of POV 
*plus* optional OpenGL rendering. (You couldn't release a version that 
only does OpenGL previews.) I'm not sure though, I will check with the 
POV-Team.


> - Is it being done already?

If so, nobody has said anything about it. I doubt it, for the reasons I 
mentioned above.


> - Is it somthing that the povray comunity would be interested in using?
> (besides me)

Almost definitely.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: David C
Subject: Re: OpenGL support idea
Date: 15 Jan 2001 14:47:41
Message: <3a6353dd$1@news.povray.org>
In article <chrishuff-AECD5C.12452115012001@news.povray.org>, "Chris Huff"
<chr### [at] maccom> wrote:

> This would probably be harder than you think...the code for setting up 
> OpenGL would be platform dependant, and you would have to use something
> like Warp's tesselation patch, because most objects are rendered 
> directly, not tesselated.

I know about how the objects are rendered. I was thinking of using the
glut library so that it would be platform independent. I really havn't
put too much thought into this. It's just a really neat idea I had that I
may or may not write.


Post a reply to this message

From: Ken Cecka
Subject: Re: OpenGL support idea
Date: 15 Jan 2001 15:28:32
Message: <3a635d70@news.povray.org>
David,

Have you thought much about how you would handle CSG?  I don't know 
anything about Warp's tesselation patch that Chris referred to, but CSG can 
be a show-stopper.  Finding an algorithm to generate meshes for arbitrary 
CSG combinations is difficult.  Usually you end up with a tradeoff between 
speed and accuracy.  For a static OpenGL display, the algorithm doesn't 
need to be particularly fast since you only calculate the mesh once, and 
then are free to explore your scene with a mobile camera (fun!).  If you 
want animation, you need to be able to quickly recalculate CSG meshes 
(consider a scene with a difference of two spheres, where one of the 
spheres slides from left to right during the animation).

I've actually written a lot of code to solve this exact problem (since I 
figured almost any other primitive POV uses will be easy to tesselate), and 
have pretty well given up on it, although I still fiddle with it from time 
to time.  There are some fundamental problems in the approach I was taking 
that I haven't seen a way to solve yet.  I can go into more detail on what 
I've tried and some of my conclusions if you're interested.

Ken

David C wrote:

> I am wondering about adding an OpenGL preview for animations. I have three
> questions.
> 
> - Would it be legal to distribute since OpenGL would be doing the
> rendering and povray would only be doing the parsing?
> - Is it being done already?
> - Is it somthing that the povray comunity would be interested in using?
> (besides me)
> 
> I am thinking of just using it for very fast test renders, using quick
> colors instead of real textures and simple lights so you can see how the
> objects look and how the camera moves. You could then tweak it very
> finely for animations since the edit/render/view cycle would be shorter.
>


Post a reply to this message

From: Chris Huff
Subject: Re: OpenGL support idea
Date: 15 Jan 2001 16:13:37
Message: <chrishuff-2E3292.16145515012001@news.povray.org>
In article <3a6353dd$1@news.povray.org>, "David C" <dav### [at] satnet> 
wrote:

> I know about how the objects are rendered. I was thinking of using the
> glut library so that it would be platform independent. I really havn't
> put too much thought into this. It's just a really neat idea I had that I
> may or may not write.

Hmm...if you use the GLUT library, you gain platform independance (you 
will only need to recompile for most platforms), but it kind of limits 
you...I don't think you can combine GLUT with platform-dependant 
interfaces, and GLUT was mainly designed for tests and demos. Maybe a 
GLUT interface, but make sure you keep the GLUT-dependant code well 
separated and provide plenty of ways to use other platform-specific 
interfaces instead.
And GLUT still won't help you render many POV primitives...julia 
fractals, for instance.

And what extent of previewing were you thinking of? An immediate preview 
of each frame and writing those results to the output file, or rendering 
all frames (without displaying) and displaying them all at once? For 
stills, a way to move camera and lights around without reparsing the 
file? (that last one could be really platform/GLUT dependant...)

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Chris Huff
Subject: Re: OpenGL support idea
Date: 15 Jan 2001 16:19:28
Message: <chrishuff-C2A809.16204115012001@news.povray.org>
In article <3a635d70@news.povray.org>, Ken Cecka 
<cec### [at] alumniwashingtonedu> wrote:

> Have you thought much about how you would handle CSG?  I don't know 
> anything about Warp's tesselation patch that Chris referred to, but 
> CSG can be a show-stopper.  Finding an algorithm to generate meshes 
> for arbitrary CSG combinations is difficult.  Usually you end up with 
> a tradeoff between speed and accuracy. 

Warp's code uses the marching tetrahedrons algorithm and can handle any 
arbitrary shape, including CSG. There is a speed/accuracy/memory 
tradeoff...and the meshes aren't as optimized as they could if you made 
them yourself, but it works, and OpenGL would just be a preview, so you 
wouldn't even need very high quality meshes.


> For a static OpenGL display, the algorithm doesn't need to be 
> particularly fast since you only calculate the mesh once, and then 
> are free to explore your scene with a mobile camera (fun!).

I'm not clear on whether he is working on that kind of interactive 
display or simply using OpenGL for extremely fast preview images.

 
> If you want animation, you need to be able to quickly recalculate CSG 
> meshes (consider a scene with a difference of two spheres, where one 
> of the spheres slides from left to right during the animation).

Or just compute all the images and play back the results. Or just do 
things the way POV does them now, only using OpenGL to do the rendering 
instead of the raytracing engine.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: David C
Subject: Re: OpenGL support idea
Date: 15 Jan 2001 20:40:19
Message: <3a63a683$1@news.povray.org>
In article <chrishuff-C2A809.16204115012001@news.povray.org>, "Chris Huff"
<chr### [at] maccom> wrote:
> 
> 
> Or just compute all the images and play back the results. Or just do 
> things the way POV does them now, only using OpenGL to do the rendering 
> instead of the raytracing engine.

I was originally thinking of just using opengl as a relatively superfast
way to render animations exactly how povray does it so you can see how
they look. I personally can't see many practical reasons you would need to move
around in the world other than the camera defined in the pov file.


Post a reply to this message

From: David C
Subject: Re: OpenGL support idea
Date: 15 Jan 2001 20:48:34
Message: <3a63a872@news.povray.org>
In article <chrishuff-2E3292.16145515012001@news.povray.org>, "Chris Huff"
<chr### [at] maccom> wrote:

> 
> 
> And what extent of previewing were you thinking of? An immediate preview
>  of each frame and writing those results to the output file, or
> rendering  all frames (without displaying) and displaying them all at
> once? For  stills, a way to move camera and lights around without
> reparsing the  file? (that last one could be really platform/GLUT
> dependant...)
> 
 I have thought about some of these things too. I might have a framerate
problem if I tried to render the animation in real time. There is no fps
option in povray as well, so I wouldn't know the user's desired
framerate. I think definitely that each frame should be rendered and
written to a file. I'm not sure about real time previewing. There is also
the matter of how to get the frame from opengl to a file. I know some
libraries support offscreen rendering, but that again would be platform
dependent. Ah well. Maybe I should play with opengl and get comfortable
with it for a few weeks first.


Post a reply to this message

From: Chris Huff
Subject: Re: OpenGL support idea
Date: 15 Jan 2001 20:49:03
Message: <chrishuff-752B67.20502515012001@news.povray.org>
In article <3a63a683$1@news.povray.org>, "David C" <dav### [at] satnet> 
wrote:

> I was originally thinking of just using opengl as a relatively 
> superfast way to render animations exactly how povray does it so you 
> can see how they look. I personally can't see many practical reasons 
> you would need to move around in the world other than the camera 
> defined in the pov file.

That should be easier to write and keep platform independant, too. And 
more likely to get working right...
How do you plan on doing different camera types? As far as I know, 
OpenGL only does perspective and orthographic projection. You might have 
to issue a warning when another type is used and use perspective 
projection in those cases...that shouldn't be a problem for quick 
preview renders.

Practical reasons: it could make it easier to get camera position/angle 
and general lighting right, but it really would be the job of a 
third-party modeller.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: David C
Subject: Re: OpenGL support idea
Date: 15 Jan 2001 21:59:42
Message: <3a63b91e@news.povray.org>
In article <chrishuff-752B67.20502515012001@news.povray.org>, "Chris Huff"
<chr### [at] maccom> wrote:

> That should be easier to write and keep platform independant, too. And 
> more likely to get working right... How do you plan on doing different
> camera types? As far as I know,  OpenGL only does perspective and
> orthographic projection. You might have  to issue a warning when another
> type is used and use perspective  projection in those cases...that
> shouldn't be a problem for quick  preview renders.

Well I wasn't thinking of fully supporting all of povray's stuff like
some of the different light types that don't have a native equivelent in
opengl. And then, there's transparency, reflections, refractions,
povray's function-textures, media, imagemaps, and maybe a few more
I havn't thought of.

> Practical reasons: it could make it easier to get camera position/angle 
> and general lighting right, but it really would be the job of a 
> third-party modeller.

In order to get camera position and angle, there would need to be a way
to output the current values that the camera has which would make opengl
rendering even more different than povray raytracing. I think, if I do
actually start building it, that I'd try to mimic the behavior of native
rendering as much as possible. For me, this is all just talk so far. I'd
love to do it, but I'm not sure I will.


Post a reply to this message

From: Chris Huff
Subject: Re: OpenGL support idea
Date: 15 Jan 2001 22:01:38
Message: <chrishuff-ED9D55.22025915012001@news.povray.org>
In article <3a63a872@news.povray.org>, "David C" <dav### [at] satnet> 
wrote:

>  I have thought about some of these things too. I might have a framerate
> problem if I tried to render the animation in real time. There is no fps
> option in povray as well, so I wouldn't know the user's desired
> framerate. I think definitely that each frame should be rendered and
> written to a file. I'm not sure about real time previewing.

Real time previewing definitely wouldn't be possible...the parse time 
would reduce it to a couple seconds a frame for simple scenes, and I've 
had scenes that went for nearly an hour just parsing. To get an animated 
preview, you would pretty much have to save the frames as they are 
calculated, and then display them. It would be simpler and more 
consistent to treat OpenGL rendering just like ordinary rendering.


> There is also the matter of how to get the frame from opengl to a 
> file. I know some libraries support offscreen rendering, but that 
> again would be platform dependent.

I'm pretty sure there are standard functions for getting the image data 
(glReadPixels()?), and the code for setting up the OpenGL context and 
stuff should be separated out into a platform-dependant section anyway.


> Ah well. Maybe I should play with opengl and get comfortable with it 
> for a few weeks first.

If you need help, I am also learning OpenGL and may be able to help you 
find some resources...

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Alan Kong
Subject: Re: OpenGL support idea
Date: 16 Jan 2001 01:34:29
Message: <ckq76t877dnmmv8huc0fie4pfuf30cpkhh@4ax.com>
On Mon, 15 Jan 2001 21:00:55 +0600 David C wrote:

>Well I wasn't thinking of fully supporting all of povray's stuff like
>some of the different light types that don't have a native equivelent in
>opengl. And then, there's transparency, reflections, refractions,
>povray's function-textures, media, imagemaps, and maybe a few more
>I havn't thought of.

  David, I think it comes down to whether or not you want to spend the
time to write the OpenGL code with its inherent limitations or be
satisfied with using the already built-in quality settings in POV-Ray,
as per docs section 3.2.6.1 "Quality Settings".

-- 
Alan - ako### [at] povrayorg - a k o n g <at> p o v r a y <dot> o r g
http://www.povray.org - Home of the Persistence of Vision Ray Tracer


Post a reply to this message

From: Vahur Krouverk
Subject: Re: OpenGL support idea
Date: 16 Jan 2001 03:39:00
Message: <3A640955.A9981B76@aetec.ee>
David C wrote:
> 
> I am wondering about adding an OpenGL preview for animations. I have three
> questions.
> 
> - Would it be legal to distribute since OpenGL would be doing the
> rendering and povray would only be doing the parsing?
> - Is it being done already?
> - Is it somthing that the povray comunity would be interested in using?
> (besides me)
> 
> I am thinking of just using it for very fast test renders, using quick
> colors instead of real textures and simple lights so you can see how the
> objects look and how the camera moves. You could then tweak it very
> finely for animations since the edit/render/view cycle would be shorter.

I haven't followed Moray development recently, but at some time it had
animation plugin, which allowed to see animations relatively easy from
Moray (but rendering was done with Polyray dll, IIRC). Moray is for
Windows only of course, so not much for multiplatform support, but if
one can stand modeller and uses Windows, then it might be solution.

Then, couple of years ago Johannes Hubert wrote basic POV-Ray animation
program in OpenGL for the IMP. He used POB  patch for handling POV-Ray
objects and displaying them. IIRC this program worked with primitives
only and was written in very short time so it didn't provided very much
functionality. Johannes is not seen recently and AFAIK he didn't
released source code for this program. Additionally, POB patch was for
older version of POV-Ray and AFAIK it is not updated for recent
version(s).

So, seems like you are on your own. RT animation would be nice, but I'm
not sure, that POV-Ray is the best program for doing this...


Post a reply to this message

From: Rick [Kitty5]
Subject: Re: OpenGL support idea
Date: 16 Jan 2001 06:05:11
Message: <3a642ae7@news.povray.org>
> Have you thought much about how you would handle CSG?  I don't know
> anything about Warp's tesselation patch that Chris referred to, but CSG
can
> be a show-stopper.  Finding an algorithm to generate meshes for arbitrary
> CSG combinations is difficult.

Moray manages to evaluate csg quite happily (with opengl) however it can be
slow for complex operations, so for use in a animation preview system it may
take (in some cases) almost as long to evaluate the csg as it would to
render it normally.


--
Rick

POV-Ray News & Resources - http://povray.co.uk
Kitty5 WebDesign - http://kitty5.com
Hi-Impact web site design & database driven e-commerce
TEL : +44 (01625) 266358 - FAX : +44 (01625) 611913 - ICQ : 15776037

PGP Public Key
http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=0x231E1CEA


Post a reply to this message

From: Jim Kress
Subject: Re: OpenGL support idea
Date: 16 Jan 2001 13:17:18
Message: <3a64902e$1@news.povray.org>
I'd encourage you to do this.  There is a real need for this kind of
functionality.

Also, please ignore the nay-sayers.  Every time this subject comes up, a
number of POV participants jump on the head of the suggestor and flog the
suggestor mercilessly.  Ignore them and do what you think is right.

Jim
http://www.kressworks.com/


"David C" <dav### [at] satnet> wrote in message news:3a632dad@news.povray.org...
> I am wondering about adding an OpenGL preview for animations. I have three
> questions.
>
> - Would it be legal to distribute since OpenGL would be doing the
> rendering and povray would only be doing the parsing?
> - Is it being done already?
> - Is it somthing that the povray comunity would be interested in using?
> (besides me)
>
> I am thinking of just using it for very fast test renders, using quick
> colors instead of real textures and simple lights so you can see how the
> objects look and how the camera moves. You could then tweak it very
> finely for animations since the edit/render/view cycle would be shorter.


Post a reply to this message

From: Greg M  Johnson
Subject: Re: OpenGL support idea
Date: 16 Jan 2001 13:19:44
Message: <3A648F67.26055491@my-dejanews.com>
David C wrote:

> - Is it somthing that the povray comunity would be interested in using?
> (besides me)

I have some particle-based animations that would be neat to let run like all
day as either a screensaver for entertainment value  or to explore the "steady
state" condition after thousands of frames.   I'd like to keep it in povray
scene language syntax because then I could easily put it all back to make
"real" animations when I'm done.


Post a reply to this message

From: Chris Huff
Subject: Re: OpenGL support idea
Date: 16 Jan 2001 16:16:47
Message: <chrishuff-07183F.16174816012001@news.povray.org>
In article <3a63b91e@news.povray.org>, "David C" <dav### [at] satnet> 
wrote:

> Well I wasn't thinking of fully supporting all of povray's stuff like
> some of the different light types that don't have a native equivelent in
> opengl. And then, there's transparency, reflections, refractions,
> povray's function-textures, media, imagemaps, and maybe a few more
> I havn't thought of.

I certainly wasn't suggesting you should try to support all of 
that...just shadowless point lights, ambient lighting, solid colors, and 
orthographic and perspective cameras would be enough, at least at first.


> I think, if I do actually start building it, that I'd try to mimic 
> the behavior of native rendering as much as possible.

Probably a good idea.


> For me, this is all just talk so far. I'd love to do it, but I'm not 
> sure I will.

It would be an interesting project...and might keep Warp's mesh patch 
alive long enough for someone to fix it. ;-)

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: David Fontaine
Subject: Re: OpenGL support idea
Date: 17 Jan 2001 00:43:57
Message: <3A652FE4.1E416192@faricy.net>
Alan Kong wrote:

>   David, I think it comes down to whether or not you want to spend the

thinking 'Huh? What's this?' scrolling up, 'oh, David C' a "senior moment" as
it were

--
David Fontaine  <dav### [at] faricynet>  ICQ 55354965
My raytracing gallery:  http://davidf.faricy.net/


Post a reply to this message

From: Ken
Subject: Re: OpenGL support idea
Date: 17 Jan 2001 01:06:45
Message: <3A6536C8.70DFA792@pacbell.net>
Jim Kress wrote:
> 
> I'd encourage you to do this.  There is a real need for this kind of
> functionality.
> 
> Also, please ignore the nay-sayers.  Every time this subject comes up, a
> number of POV participants jump on the head of the suggestor and flog the
> suggestor mercilessly.  Ignore them and do what you think is right.

It's blasphemy, Jim. I say nay ! We never had it before so why do we
need it now ? OGL is crappy compared to raytracing. Might as well add
gif output support as long as we are going backwards. I don't like the
idea. You want to do what ? Never had it, never will.

<g>

-- 
Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Jim Kress
Subject: Re: OpenGL support idea
Date: 17 Jan 2001 01:23:20
Message: <3a653a58@news.povray.org>
LOL!

You've decided to become a "say nayer" rather than a "nay sayer"?

Jim

"Ken" <tyl### [at] pacbellnet> wrote in message
news:3A6536C8.70DFA792@pacbell.net...
>
>
> Jim Kress wrote:
> >
> > I'd encourage you to do this.  There is a real need for this kind of
> > functionality.
> >
> > Also, please ignore the nay-sayers.  Every time this subject comes up, a
> > number of POV participants jump on the head of the suggestor and flog
the
> > suggestor mercilessly.  Ignore them and do what you think is right.
>
> It's blasphemy, Jim. I say nay ! We never had it before so why do we
> need it now ? OGL is crappy compared to raytracing. Might as well add
> gif output support as long as we are going backwards. I don't like the
> idea. You want to do what ? Never had it, never will.
>
> <g>
>
> --
> Ken Tyler - 1400+ POV-Ray, Graphics, 3D Rendering, and Raytracing Links:
> http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Chris Huff
Subject: Re: OpenGL support idea
Date: 18 Jan 2001 13:35:31
Message: <chrishuff-BBC03F.13363018012001@news.povray.org>
In article <3a632dad@news.povray.org>, "David C" <dav### [at] satnet> 
wrote:

> - Would it be legal to distribute since OpenGL would be doing the
> rendering and povray would only be doing the parsing?

Well, there don't seem to be any objections from the POV-Team, since 
OpenGL is cross-platform and wouldn't affect normal operation of the 
program. And now that the tesselation patch has been released, it should 
be quite possible...

I'd start by adding Tesselate() and DrawOpenGL() methods to each object. 
The default Tesselate() method would use Warp's code, but object 
specific ones could be added later. The default DrawOpenGL() method 
would use the Tesselate() method of the object to generate a mesh (maybe 
using some global settings or per-object defaults for quality), and use 
that to draw the object, but again could be implemented separately for 
specific objects.
It might be a good idea to add an object type variable in the process, 
it could make some things quite a bit easier. Adding Tesselate() methods 
will be necessary for some stuff I'm doing, maybe we should work 
together on some of the stuff to make sure the separate patches are 
compatable.
Maybe factor out the mesh data stuff into a separate area of code so it 
isn't mesh object specific, this might be useful for when you need mesh 
data but aren't rendering it directly, but likely a lot of work. It may 
be better just to pass mesh objects around.

What do you think?

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

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