|
|
> Can you suggest an implementation which doesn't consume
> tons of memory and is as fast to render as the current when
> those extra features are not used?
Without having much experience with C or C++ not to mention the POV-Ray
source, I have an idea:
When the scene parses, optimised code for each texture can be generated in
memory. By optimised I mean, a block of memory is set aside for each unique
material and the code necessary to produce that material is generated. This
leaves out checking if features are on/off during rendering. It does consume
a bit of extra memory, but hardly tons of it. The same memory block could
even be used for several textures with different values to them, as long as
they use only the same set of features.
By the way, I wonder how much computation time is needed for a material to
have a 'switch / case' statement. Each 'case' being a feature on/off. It
doesn't sound like a big penalty?
Regards,
Hugo
Post a reply to this message
|
|