POV-Ray : Newsgroups : povray.programming : first colum and last row active?? Server Time
28 Mar 2024 07:15:25 EDT (-0400)
  first colum and last row active?? (Message 1 to 10 of 10)  
From: Aidy
Subject: first colum and last row active??
Date: 26 Feb 2011 14:25:01
Message: <web.4d6953405712788cd3fa8b3e0@news.povray.org>
Hiya,

I'm working on a project using porvay, and am currently looking through the
"Start_Adaptive_Tracing" method and inside the loop (over columns then rows)
there are two for loops which are commented as setting the last row inactive and
setting the first column inactive.

I was just wondering what these actually do as I'm a little confused by them?

Thanks
Adrian


Post a reply to this message

From: Le Forgeron
Subject: Re: first colum and last row active??
Date: 27 Feb 2011 03:11:32
Message: <4d6a0734$1@news.povray.org>
Le 26/02/2011 20:23, Aidy nous fit lire :
> Hiya,
> 
> I'm working on a project using porvay, and am currently looking through the
> "Start_Adaptive_Tracing" method and inside the loop (over columns then rows)
> there are two for loops which are commented as setting the last row inactive and
> setting the first column inactive.
> 
> I was just wondering what these actually do as I'm a little confused by them?
> 
Could you please:
 * identify the version of code (3.6, 3.7 or 3.1) as well as subversion
(3.1g ?)
 * provide at least the filename and an approximated line number

It might really help people to help you.
(So far, it's a bit like: "I read a Sci-Fi book, it has an interested
chapter about the relationship between father and son. I'm confused by
the walk to the top of a hill.").


Post a reply to this message

From: Aidy
Subject: Re: first colum and last row active??
Date: 27 Feb 2011 07:55:01
Message: <web.4d6a48e670cc8154d3fa8b3e0@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:
> Le 26/02/2011 20:23, Aidy nous fit lire :
> > Hiya,
> >
> > I'm working on a project using porvay, and am currently looking through the
> > "Start_Adaptive_Tracing" method and inside the loop (over columns then rows)
> > there are two for loops which are commented as setting the last row inactive and
> > setting the first column inactive.
> >
> > I was just wondering what these actually do as I'm a little confused by them?
> >
> Could you please:
>  * identify the version of code (3.6, 3.7 or 3.1) as well as subversion
> (3.1g ?)
>  * provide at least the filename and an approximated line number
>
> It might really help people to help you.
> (So far, it's a bit like: "I read a Sci-Fi book, it has an interested
> chapter about the relationship between father and son. I'm confused by
> the walk to the top of a hill.").

Ah yeah fair point. Sorry shoulda thought of that.

It's the release available on the main site, so version 3.6.2, June 2009.
The file I'm currently looking in is render.cpp in the Start_Adaptive_Tracing
method.
I'm getting confused at line 1535, which should be :

for (xx = 0; xx < sub_pixel_size * Frame.Screen_Width + 1; xx++)

Thanks


Post a reply to this message

From: Le Forgeron
Subject: Re: first colum and last row active??
Date: 27 Feb 2011 08:51:04
Message: <4d6a56c8$1@news.povray.org>
Le 27/02/2011 13:51, Aidy nous fit lire :
> Le_Forgeron <jgr### [at] freefr> wrote:
>> Le 26/02/2011 20:23, Aidy nous fit lire :
>>> Hiya,
>>>
>>> I'm working on a project using porvay, and am currently looking through the
>>> "Start_Adaptive_Tracing" method and inside the loop (over columns then rows)
>>> there are two for loops which are commented as setting the last row inactive and
>>> setting the first column inactive.
>>>
>>> I was just wondering what these actually do as I'm a little confused by them?

> It's the release available on the main site, so version 3.6.2, June 2009.
> The file I'm currently looking in is render.cpp in the Start_Adaptive_Tracing
> method.
> I'm getting confused at line 1535, which should be :
> 
> for (xx = 0; xx < sub_pixel_size * Frame.Screen_Width + 1; xx++)
> 

Remember that rendering in 3.6.2 was always from top-left corner, by
full line, left to right first.

In Adaptative tracing, the Block is 2^k subpixels, arranged as a square.
subpixels on square lines are shared between squares.

Last_Row is the storage of the subpixels from the previous line (there
is no point in computing them again).
On the same way, at the end of a block, the right side of the square
become the left side of the new square.

So far so good... but there is two caveat:
 * on the first line, there is no previous line, so the .active of
Last_Row is turned to false, to avoid the usage of bogus values.
 * on each start of a new line, the block must be started afresh (you
cannot reuse the right side for the new left side).

Hope this helps.


Post a reply to this message

From: clipka
Subject: Re: first colum and last row active??
Date: 27 Feb 2011 09:55:02
Message: <4d6a65c6@news.povray.org>
Am 27.02.2011 13:51, schrieb Aidy:
> Le_Forgeron<jgr### [at] freefr>  wrote:
>> Le 26/02/2011 20:23, Aidy nous fit lire :
>>> Hiya,
>>>
>>> I'm working on a project using porvay, and am currently looking through the
>>> "Start_Adaptive_Tracing" method and inside the loop (over columns then rows)
>>> there are two for loops which are commented as setting the last row inactive and
>>> setting the first column inactive.
>>>
>>> I was just wondering what these actually do as I'm a little confused by them?
>
> It's the release available on the main site, so version 3.6.2, June 2009.
> The file I'm currently looking in is render.cpp in the Start_Adaptive_Tracing
> method.
> I'm getting confused at line 1535, which should be :
>
> for (xx = 0; xx<  sub_pixel_size * Frame.Screen_Width + 1; xx++)

The .active flag marks whether the sub-pixel has been rendered already.

For the sake of anti-aliasing, adjacent pixels overlap by one sub-pixel; 
these overlapping pixels are computed at most once (maybe not at all, if 
neither of the pixels needs anti-aliasing), and copied over for the next 
pixel if already computed. As there is nothing to copy /from/ in the 
very first row of pixels and the very first column of pixels, their 
respective topmost / leftmost sub-pixels need to be explicitly 
initialized to "not rendered yet" rather than copied.

The copying of the overlapping columns of sub-pixels happens at the end 
of each iteration, hence the carried-over sub-pixels are expected to 
already be in the first column (of sub-pixels of that pixel) at the 
start of each iteration; the copying of overlapping sub-pixel rows, on 
the other hand, is done at the start of iteration, so those sub-pixels 
are expected to still be in the last row (of sub-pixels of the previous 
pixel row) at the start of each iteration.


Post a reply to this message

From: Aidy
Subject: Re: first colum and last row active??
Date: 27 Feb 2011 11:05:00
Message: <web.4d6a754470cc8154d3fa8b3e0@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:
> Le 27/02/2011 13:51, Aidy nous fit lire :
> > Le_Forgeron <jgr### [at] freefr> wrote:
> >> Le 26/02/2011 20:23, Aidy nous fit lire :
> >>> Hiya,
> >>>
> >>> I'm working on a project using porvay, and am currently looking through the
> >>> "Start_Adaptive_Tracing" method and inside the loop (over columns then rows)
> >>> there are two for loops which are commented as setting the last row inactive and
> >>> setting the first column inactive.
> >>>
> >>> I was just wondering what these actually do as I'm a little confused by them?
>
> > It's the release available on the main site, so version 3.6.2, June 2009.
> > The file I'm currently looking in is render.cpp in the Start_Adaptive_Tracing
> > method.
> > I'm getting confused at line 1535, which should be :
> >
> > for (xx = 0; xx < sub_pixel_size * Frame.Screen_Width + 1; xx++)
> >
>
> Remember that rendering in 3.6.2 was always from top-left corner, by
> full line, left to right first.
>
> In Adaptative tracing, the Block is 2^k subpixels, arranged as a square.
> subpixels on square lines are shared between squares.
>
> Last_Row is the storage of the subpixels from the previous line (there
> is no point in computing them again).
> On the same way, at the end of a block, the right side of the square
> become the left side of the new square.
>
> So far so good... but there is two caveat:
>  * on the first line, there is no previous line, so the .active of
> Last_Row is turned to false, to avoid the usage of bogus values.
>  * on each start of a new line, the block must be started afresh (you
> cannot reuse the right side for the new left side).
>
> Hope this helps.

Thanks for the response that makes sense.

Of the last row, which parts of it will relate to which pixel of the current row
being worked on?
I'm trying to convert the code to run in parallel and am finding this bit a
little confusing.

Thanks
Adrian


Post a reply to this message

From: Christian Froeschlin
Subject: Re: first colum and last row active??
Date: 27 Feb 2011 13:55:20
Message: <4d6a9e18@news.povray.org>
Aidy wrote:

> I'm trying to convert the code to run in parallel and am finding this bit a
> little confusing.

Just to make sure: Are you aware that 3.7 already has parallelization?
That was a rather major rewrite and might save you a lot of trouble.


Post a reply to this message

From: Aidy
Subject: Re: first colum and last row active??
Date: 27 Feb 2011 14:35:01
Message: <web.4d6aa6ff70cc8154d3fa8b3e0@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> Aidy wrote:
>
> > I'm trying to convert the code to run in parallel and am finding this bit a
> > little confusing.
>
> Just to make sure: Are you aware that 3.7 already has parallelization?
> That was a rather major rewrite and might save you a lot of trouble.

yeah I started with 3.7 but I'm looking at parallel with CUDA (I know LOADS have
asked about it before and everyone's said it can't be done but it's my final
year project and I'm allowed to fail :) )

I'll take another look through the 3.7 code and see how they've split it :)


Post a reply to this message

From: clipka
Subject: Re: first colum and last row active??
Date: 27 Feb 2011 15:53:30
Message: <4d6ab9ca$1@news.povray.org>
Am 27.02.2011 20:33, schrieb Aidy:

> yeah I started with 3.7 but I'm looking at parallel with CUDA (I know LOADS have
> asked about it before and everyone's said it can't be done but it's my final
> year project and I'm allowed to fail :) )

Keep us updated about the results - we're still convinced it's too 
difficult to do, but we won't argue with anyone who takes up that glove 
himself to prove us wrong ;-)


Post a reply to this message

From: Aidy
Subject: Re: first colum and last row active??
Date: 27 Feb 2011 16:15:01
Message: <web.4d6abe5170cc8154d3fa8b3e0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 27.02.2011 20:33, schrieb Aidy:
>
> > yeah I started with 3.7 but I'm looking at parallel with CUDA (I know LOADS have
> > asked about it before and everyone's said it can't be done but it's my final
> > year project and I'm allowed to fail :) )
>
> Keep us updated about the results - we're still convinced it's too
> difficult to do, but we won't argue with anyone who takes up that glove
> himself to prove us wrong ;-)

Ha alright will do. CUDA has now added support for all the things people here
said stopped it being feasible so fingers crossed :)


Post a reply to this message

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