|
|
In article <web.42c1137fc739b361d9bc26010@news.povray.org>,
dra### [at] gmailcom says...
> hi...
>
> is there any way to port POV to opengl?
>
Or for a more complex explanation that Warps. No, because OpenGL only
simulates raytracing using a) triangle meshes, not mathematical formula,
b) its textures are pre-created, c) its reflection and other light
features are mapped to objects, not generated by physical models and d)
pretty much all of it is done using a painter type algorithm, which,
instead of following a beam of light to see 'what' and 'if' it hit
something, simply cuts away everything that shouldn't be 'visible' and
ignores it. Item (d) is why you have to fake reflections, since OpenGL is
incapable of determining 'if' let alone 'what', 'how many', or 'to what
degree' light bounces of other objects, before being seen by the camera
position.
Think of it this way. POVRay sets up a room, some lights and a camera,
then snaps a photo. OpenGL and DirectX is a guy sitting in a room with an
exacto knife, who splashes paint over several thousand sheets of paper,
then uses the knife to 'cut out' every bit that isn't part of the final
result, pastes them all on on top of the other, *then* takes a photo of
the result. While this can 'look' very realistic, given a lot of patience
and careful preparation, some things are impossible and you can't simply
come back to the same room and stick a camera 'behind' the objects or
move any lights. Doing so messes up any reflections or other 'effects'
that have to be carefully 'adjusted' to still look right. I.e., you have
to cut up entirely new bits, paint them all, then 'hope' you didn't mess
something up which leaves the table top reflecting the floor, instead of
the lamp over top of it and similar mistakes. Even OpenGL programs that
'do' allow that do so by 'precalculating' where the reflections should
be, then feeding a fake image of that reflection to the OpenGL system as
a texture. I.e., it uses POVRay style calculations to figure out, "sort
of", what it should look like, then glues the result to the wall, table,
mirror, etc. that needs it.
POVRay is an complete machine show with an industrial lathe and a full
employment of welders. OpenGL is a guy with a box of legos, a few tubes
of paint and maybe some modelling clay to smooth the more obvious blocky
bits. Its quite literally a complete impossibility to shoehorn POVRay
into the later. Though, someone did work on a version that supported a
'preview' system. It worked by taking the real math, manufacturing a
bunch of approximate fakes, then showing a cheap imitation of the final
result. I suspect it never worked too well, or for all objects. Some,
like isosurfaces could take almost as long to produce a bad imitation,
than to produce the real thing. This is why things like Moray, etc. that
'do' use OpenGL, to give a rough idea of what the final result will be,
don't even try to show some objects, but just stuff a big box, that is
close to the estimated size expected, in their place.
--
void main () {
call functional_code()
else
call crash_windows();
}
Post a reply to this message
|
|
|
|
In article <42c40043$1@news.povray.org>, sau### [at] netscapenet says...
> Warp wrote:
>
> > Saul F. Luizaga <sau### [at] netscapenet> wrote:
> >
> >>Warp and what about DirectX?
> >
> >
> > Why would it be any easier to convert a pov scene to DirectX than it is
> > to OpenGL?
> >
>
>
> I don't know too much about programming Warp, that's why I ask you,
> since you're an exoert C/C++ programmer I think you should know. So
> isn't a esay task hah... but it will be a useful feature don't you
> think, as a preview one I mean.
>
DirectX is just a different 'shell' or front end over the same triangle
mesh technology. Its like asking someone if it would be easier to convert
their toothbrush into a straight razor or a knife. Odds are pretty god,
given the basic nature of both, that neither will be acceptable.
--
void main () {
call functional_code()
else
call crash_windows();
}
Post a reply to this message
|
|
|
|
Saul F. Luizaga <sau### [at] netscapenet> wrote:
> I don't know too much about programming Warp, that's why I ask you,
> since you're an exoert C/C++ programmer I think you should know. So
> isn't a esay task hah... but it will be a useful feature don't you
> think, as a preview one I mean.
In general, converting pov-scenes to *any* other formats is a very
difficult task.
For some explanations, see
http://tag.povray.org/povQandT/filesQandT.html#povtootherformatsdifficulty
--
- Warp
Post a reply to this message
|
|