POV-Ray : Newsgroups : povray.pov4.discussion.general : Feature Request: "Multi-Pass" and "Tripple Buffer" Rendering? : Re: Feature Request: "Multi-Pass" and "Tripple Buffer" Rendering? Server Time
24 Apr 2024 12:19:24 EDT (-0400)
  Re: Feature Request: "Multi-Pass" and "Tripple Buffer" Rendering?  
From: Alain
Date: 1 Mar 2016 15:43:24
Message: <56d5feec@news.povray.org>

> There are some features that could easily be added, and would be able to
> speed up rendering significantly.
>
> These are "Multi-Pass" and "Triple Buffer" Rendering.
> Let me explain in detail.
>
> We have already some kind of "Multi-Pass" rendering.
> People use the "Frames" or "Clock" Parameters of the command line for that.
>
> But thats in fact a missuse and it needs the Command line.
>
> I'd suggest something thats "code based", uses something like
>
> #FOR PASS 3 TO 9
>
> #if Pass(x)
>    (#PATHNUM)-> evaluates to the Number of the Path
> #ENDIF
>
> #ENDPASS
>
> This would lead the rendering engine to repeat reading in the script file
> 6 times with a changed "Path-Number".
>
> "Clock" could be used otherwise and what it was really designed for.
> So far about my "Multi-Pass" Suggestion.
> The implementation is definitely easy as i see it.

I'm not sure that it's actualy easy to implement. Easy to describe, yes.
Easy to describe don't mean that the coding is easy.

>
> --------------------------
> NOW TO "Triple Buffering"
> --------------------------
>
> For this, we need to add the ability to render into different "Buffers"
> and we need Commands to combine or SAVE these Buffers.
>
> For example using a simple Directive like:
>
> #BUFFER 1
> this will stay the rendertarget until there is a new
> #BUFFER 2
>
> and there must be a
> #BUFFER MAIN
> which is the MAIN Buffer (the one actually used)
>
> The only other steps are "How to combine the buffers.
> For this we need some sort of "Bit-Blit" Command, maybe this can even be done
> quickly by the grpahics hardware. If not its a simple ASM Loop with a logical
> Operator.
> I suggest something like:
>
> #COMBINE 1 TO 2 USE "AND"
>
> // This is the default mode
> #COMBINE 1 TO MAIN USE "OR"
>
> and of course
> #COMBINE 1/PRIO TO MAIN USE "OR"
>
> this "/PRIO" is important, it means that any pixel that was NOT black on 1 will
> replace any pixel on MAIN. Something like this can be used to combine pictures.
>
> Here at this place you can use more Phantasie - if you like.
> While a simple "OR" is at least needed to combine two Buffers,
> there may be more "Combination Modes".
> Like "ADD IF LIGHTER","ADD IF DARKER","ADD SATURATION","ADD HUE" etc.
> this could be expanded with time.
>
> This way you could even render one Part with some polygons and some lightings
> into Buffer 1
> Render another Part into Buffer 2
> and then combine them to one picture.
>
> Later it could be enhanced like this
> #COMBINE 1/PRIO/SCALE TO MAIN USE "OR"
>
> Which in fact is not "wizzards art" but done with a few commands in any
> programming language.
>
> This suggestion should be easy to implement with a high potential of usage.
>
> Oncxe its done, we can then start using the POV-Ray already built in possibility
> to render several images at once.
>
> Could look like this:
>
> #THREAD 1 RENDER
> #BUFFER 1
> ....
> #END THREAD
> #BUFFER 2
>
> #THREAD 2 RENDER
> ....
> #WAIT THREAD 1,2
> #COMBINE 1,2 TO MAIN USE "OR"
>
>
>
> #END THREAD
>

Tripple buffering is a very good way to speedup SCAN LINE rendering 
using some kind of shading engine. It's specialised for that kind of 
rendering.
A geometric primitives based ray tracer can hardly benefit from it.


Post a reply to this message

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