Some of these are things I have discussed years ago, but I thought it
could be useful to revive the discussion a bit.
One of the original plans for POV-Ray 4 was to make a complete rehaul
of the SDL from scratch, making it a lot more versatilve, expressive,
powerful and faster (via byte-compilation). This would have been a
completely new input language that's different from the current one
(but with, perhaps, a backwards compatibility mode to support existing
I have no idea what the current plans are, but I have the impression
that the idea of this kind of complete overhaul has been pretty much
scratched, in favor of simply enhancing the current SDL. (If I'm wrong,
I'd love to hear about the current development ideas on this.)
If we are simply going to keep the current SDL and enhance it, rather
than create a completely new input language, perhaps a kind of in-between
solution could be possible.
I really think that the enhancements made to the SDL should use the same
design principle as what happened with graphics accelerator cards.
In the late 90's and very early 2000's, when graphics accelerator cards
were becoming more and more popular, and were becoming more and more
advanced, the manufacturers were doing the same thing as the POV-Ray
SDL has been doing: Piling up individual hard-coded features one on
top of another. Basically everything that graphics cards supported at
the time were such individual hard-coded, inflexible features (such
as lightning, bump maps, vertex transforms, etc.)
Quite soon, however, graphics card manufacturers realized that this is
a completely infeasible design. It needlessly limits what games can do,
it makes the graphical options limited and very rigid, and it stifles
the game developers' options. New graphical effects can't be added to
the game if the graphics card doesn't directly support it.
Thus they went into a rather different direction: Rather than add more
and more fixed features, they instead concentrated their efforts in
implementing an expressive fully-fledged efficient machine code, which
could be run on a vertex-by-vertex and on a pixel-by-pixel basis
(namely, vertex and pixel "shaders"). This machine code could be given
data and parameters both by the running program and the graphics card
itself, and it could do whatever calculations with them (and pass that
data from the vertex shader to the pixel shader as needed) which would
affect the coloration of the final pixels.
Thus, for example, rather than add yet another type of rigid, fixed form
of, say, bump mapping, this machine code system would allow the game
developers to implement their own freely customized version. (This
freely-implementable "bump mapping" could even be algorithmically
generated and even animated, if so desired. There is basically no limit.)
This design has been highly successful. Rather than spend time and effort
on fixed features, they have spent that time and effort in making the
machine code system more efficient and even more flexible. (This is such
a crucial feature of current graphics cards that their prowess is pretty
much solely measured in how many shader operations per second they can do.)
Now, I'm not saying that POV-Ray should implement a "shader" language
that can do absolutely anything (although if well designed and implemented,
that would be great). However, I think that future expansion of the
current SDL should, in my opinion, at least go more into that direction.
A concrete example: I have suggested in the past a new feature for POV-Ray:
A kind of "poor man's blurred reflection" system, where the reflection on
a surface is the more faded the farther away the reflected surface is.
In other words, the strength of the reflected ray's color is inversely
proportional to the length of said ray. (When used properly, this can
give a kind of "blurred reflection" effect, with the advantage over actual
blurred reflection that this would be significantly faster. Imagine, for
example, this effect used on some porcelain object with a weak reflection
to start with.)
However, rather than add this particular effect as a fixed, hard-coded
feature, it would be much better if the user would be given the option
of specifying some kind of function for eg. how the contribution of
reflected rays are calculated on the color of a surface. This way it
would not only be possible to implement this particular feature, but
a myriad of other features. (This user-defined function should, obviously,
get as parameters, or be able to get with special functions, all kinds of
info about the reflected ray, the reflecting object, the reflected object,
and other data.)
This doesn't necessarily have to have an impact on rendering speed when
*not* using the user-defined-function-for-reflections feature. The
implementation could simply check if such a function has been specified,
and if not, then use the old method. This should have a negligible impact
on rendering speed.
These user-defined functions should of course be used in other places
as well, not just in reflected ray calculations.
As said, I think that enhancements made to the current SDL should at
least try to go more into this direction, rather than just keep adding
more and more new fixed hard-coded features.
Post a reply to this message