POV-Ray : Newsgroups : povray.pov4.discussion.general : Feature Request: "Multi-Pass" and "Tripple Buffer" Rendering? Server Time
15 Oct 2024 05:38:30 EDT (-0400)
  Feature Request: "Multi-Pass" and "Tripple Buffer" Rendering? (Message 1 to 4 of 4)  
From: Theogott
Subject: Feature Request: "Multi-Pass" and "Tripple Buffer" Rendering?
Date: 1 Mar 2016 13:30:00
Message: <web.56d5df83307d74f9adb2e4f80@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.

--------------------------
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


Post a reply to this message

From: Alain
Subject: Re: Feature Request: "Multi-Pass" and "Tripple Buffer" Rendering?
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

From: Theogott
Subject: Re: Feature Request: "Multi-Pass" and "Tripple Buffer" Rendering?
Date: 3 Mar 2016 13:10:00
Message: <web.56d87cd8cbcef96eadb2e4f80@news.povray.org>
Alain <kua### [at] videotronca> wrote:

> 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.

Maybe i used the wrong word. I described "Layered rendering".
Not buffered rendering.

Rendering Objects in diefferent layers, combining them at the end of the
process.


Post a reply to this message

From: Le Forgeron
Subject: Re: Feature Request: "Multi-Pass" and "Tripple Buffer" Rendering?
Date: 3 Mar 2016 13:37:47
Message: <56d8847b$1@news.povray.org>
Le 03/03/2016 19:05, Theogott a écrit :
> Alain <kua### [at] videotronca> wrote:
> 
>> 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.
> 
> Maybe i used the wrong word. I described "Layered rendering".
> Not buffered rendering.
> 
> Rendering Objects in diefferent layers, combining them at the end of the
> process.
> 


When you insert refraction with ior, you soon find that layers work better per light
source, allowing a fast adjustment of the colour of each light (including intensity).


Post a reply to this message

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