POV-Ray : Newsgroups : povray.programming : Question concerning radiosity code Server Time
28 Jul 2024 12:38:07 EDT (-0400)
  Question concerning radiosity code (Message 6 to 15 of 15)  
<<< Previous 5 Messages Goto Initial 10 Messages
From: Michael Andrews
Subject: Re: Related question concerning radiosity code
Date: 30 Aug 2002 09:14:25
Message: <3D6F726A.718839C7@reading.ac.uk>
Michael Andrews wrote:
> On a related theme, in the same function there is a block starting at
> line 1179 which calculates 'gather_grey' from 'Radiosity_Gather_Total'
> and 'Radiosity_Gather_Total_Count'.

OK, now I'm confused.

I had a look for these variables in the source:

$ grep -n 'Radiosity_Gather_Total' *.cpp
octree.cpp:1082:    Make_Colour(Radiosity_Gather_Total, 0., 0., 0.);
octree.cpp:1083:    Radiosity_Gather_Total_Count = 0;
radiosit.cpp:110:COLOUR Radiosity_Gather_Total;
radiosit.cpp:111:long Radiosity_Gather_Total_Count;
radiosit.cpp:837:    VAddEq(Radiosity_Gather_Total, Illuminance);
radiosit.cpp:838:    Radiosity_Gather_Total_Count++;
render.cpp:967:  Make_Colour(Radiosity_Gather_Total, 0.0, 0.0, 0.0);
render.cpp:968:  Radiosity_Gather_Total_Count = 0;
render.cpp:1185:      if ( Radiosity_Gather_Total_Count )
render.cpp:1187:        VInverseScale(avg_gather, 
Radiosity_Gather_Total,  (DBL)Radiosity_Gather_Total_Count);

$ grep -n 'Radiosity_Gather_Total' *.h
radiosit.h:89:extern COLOUR Radiosity_Gather_Total;
radiosit.h:90:extern long Radiosity_Gather_Total_Count;

$ grep -n 'avg_gather' *.cpp
render.cpp:957:  COLOUR Colour, avg_gather;
render.cpp:1187:        VInverseScale(avg_gather, 
Radiosity_Gather_Total,  (DBL)Radiosity_Gather_Total_Count);
render.cpp:1188:        gather_grey  = avg_gather[pRED]  +
avg_gather[pGREEN]  + avg_gather[pBLUE];

$ grep -n 'gather_grey' *.cpp
render.cpp:956:  DBL grey, gather_grey;
render.cpp:1188:        gather_grey  = avg_gather[pRED]  +
avg_gather[pGREEN]  + avg_gather[pBLUE];
render.cpp:1189:        if ( gather_grey > 0. )
render.cpp:1193:          /*opts.Radiosity_Brightness = 3. /
gather_grey; */

Looking at the code I can not see that these variables do anything. Am I
wrong?

Could someone please tell me what does effect the automatic radiosity
brightness adjustment?

A very puzzled,
	Mike Andrews.


Post a reply to this message

From: Nathan Kopp
Subject: Re: Related question concerning radiosity code
Date: 3 Sep 2002 22:45:22
Message: <3d7573c2$1@news.povray.org>
Two words:

Legacy code.

-Nathan

"Michael Andrews" <m.c### [at] readingacuk> wrote...
> Michael Andrews wrote:
> > On a related theme, in the same function there is a block starting at
> > line 1179 which calculates 'gather_grey' from 'Radiosity_Gather_Total'
> > and 'Radiosity_Gather_Total_Count'.
>
> OK, now I'm confused.
>
> I had a look for these variables in the source:
>
> $ grep -n 'Radiosity_Gather_Total' *.cpp
> octree.cpp:1082:    Make_Colour(Radiosity_Gather_Total, 0., 0., 0.);
> octree.cpp:1083:    Radiosity_Gather_Total_Count = 0;
> radiosit.cpp:110:COLOUR Radiosity_Gather_Total;
> radiosit.cpp:111:long Radiosity_Gather_Total_Count;
> radiosit.cpp:837:    VAddEq(Radiosity_Gather_Total, Illuminance);
> radiosit.cpp:838:    Radiosity_Gather_Total_Count++;
> render.cpp:967:  Make_Colour(Radiosity_Gather_Total, 0.0, 0.0, 0.0);
> render.cpp:968:  Radiosity_Gather_Total_Count = 0;
> render.cpp:1185:      if ( Radiosity_Gather_Total_Count )
> render.cpp:1187:        VInverseScale(avg_gather,
> Radiosity_Gather_Total,  (DBL)Radiosity_Gather_Total_Count);
>
> $ grep -n 'Radiosity_Gather_Total' *.h
> radiosit.h:89:extern COLOUR Radiosity_Gather_Total;
> radiosit.h:90:extern long Radiosity_Gather_Total_Count;
>
> $ grep -n 'avg_gather' *.cpp
> render.cpp:957:  COLOUR Colour, avg_gather;
> render.cpp:1187:        VInverseScale(avg_gather,
> Radiosity_Gather_Total,  (DBL)Radiosity_Gather_Total_Count);
> render.cpp:1188:        gather_grey  = avg_gather[pRED]  +
> avg_gather[pGREEN]  + avg_gather[pBLUE];
>
> $ grep -n 'gather_grey' *.cpp
> render.cpp:956:  DBL grey, gather_grey;
> render.cpp:1188:        gather_grey  = avg_gather[pRED]  +
> avg_gather[pGREEN]  + avg_gather[pBLUE];
> render.cpp:1189:        if ( gather_grey > 0. )
> render.cpp:1193:          /*opts.Radiosity_Brightness = 3. /
> gather_grey; */
>
> Looking at the code I can not see that these variables do anything. Am I
> wrong?
>
> Could someone please tell me what does effect the automatic radiosity
> brightness adjustment?
>
> A very puzzled,
> Mike Andrews.


Post a reply to this message

From: Nathan Kopp
Subject: Re: Question concerning radiosity code
Date: 3 Sep 2002 22:51:58
Message: <3d75754e@news.povray.org>
"Christoph Hormann" <chr### [at] gmxde> wrote...
>
> I was studying the radiosity code and found the following in render.cpp,
> function 'Start_Tracing_Radiosity_Preview()', line 1223:
>
>   opts.Radiosity_Error_Bound /= opts.Radiosity_Low_Error_Factor;
>   opts.Radiosity_Error_Bound = opts.Real_Radiosity_Error_Bound;
>
> Unless i'm finally going mad there is something wrong here.  Maybe someone
> more familiar with the radiosity code (Nathan?) could clear that up (and
> check if there is some hidden problem i did not see).  I have the
> impression it behaves correctly, just the first line is obsolete.

The first line is obsolete.  Actually, either would probably do the job (see
lines 962-963 of the same file).

-Nathan


Post a reply to this message

From: Warp
Subject: Re: Related question concerning radiosity code
Date: 3 Sep 2002 23:20:59
Message: <3d757c1b@news.povray.org>
Nathan Kopp <pov### [at] nkoppmailshellcom> wrote:
> Legacy code.

  Could you explain what does that mean? (I don't know, and I'm curious.)

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Michael Andrews
Subject: Re: Related question concerning radiosity code
Date: 4 Sep 2002 06:24:23
Message: <3D75E214.D1519F1A@reading.ac.uk>
Hi Nathan,

Nathan Kopp wrote:
> 
> Two words:
> 
> Legacy code.
> 
> -Nathan
> 
Ahh, thats OK then. There was a lot of changes going on so I'm not
surprised there's bits left hanging :-)

Can you tell me where the automatic radiosity brightness adjustment code
is then? At first I thought it was to do with the code blocks I was
looking at, but obviously I was wrong and I can't see any other code
blocks which seem relevant.

Thanks,
	Mike Andrews.


Post a reply to this message

From: Nathan Kopp
Subject: Re: Related question concerning radiosity code
Date: 4 Sep 2002 23:35:24
Message: <3d76d0fc$1@news.povray.org>
"Michael Andrews" <m.c### [at] readingacuk> wrote...
>
> Can you tell me where the automatic radiosity brightness adjustment code
> is then? At first I thought it was to do with the code blocks I was
> looking at, but obviously I was wrong and I can't see any other code
> blocks which seem relevant.

It no longer exists.  It was completely unrealistic.

-Nathan


Post a reply to this message

From: Nathan Kopp
Subject: Re: Related question concerning radiosity code
Date: 4 Sep 2002 23:37:27
Message: <3d76d177@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote...
> Nathan Kopp <pov### [at] nkoppmailshellcom> wrote:
> > Legacy code.
>
>   Could you explain what does that mean? (I don't know, and I'm curious.)

I've heard the term "legacy code" used to refer to old code that formerly
had meaning, but now serves no purpose except to eat CPU cycles.

-Nathan


Post a reply to this message

From: Michael Andrews
Subject: Re: Related question concerning radiosity code
Date: 5 Sep 2002 05:55:24
Message: <3D772CCC.11C85853@reading.ac.uk>
Nathan Kopp wrote:
> 
> "Michael Andrews" <m.c### [at] readingacuk> wrote...
> >
> > Can you tell me where the automatic radiosity brightness adjustment code
> > is then? At first I thought it was to do with the code blocks I was
> > looking at, but obviously I was wrong and I can't see any other code
> > blocks which seem relevant.
> 
> It no longer exists.  It was completely unrealistic.
> 
OK, I agree with that. It was useful to an extent back when the
radiosity code was ambient-only.

But hasn't this been the main argument against doing distributed
rendering of image pieces (either tiles or strips) when using radiosity?
Maybe I've misunderstood the problem ...

> -Nathan

Bye for now,
	Mike Andrews.


Post a reply to this message

From: Christopher James Huff
Subject: Re: Related question concerning radiosity code
Date: 5 Sep 2002 08:47:17
Message: <chrishuff-522F77.08464105092002@netplex.aussie.org>
In article <3d76d177@news.povray.org>,
 "Nathan Kopp" <pov### [at] nkoppmailshellcom> wrote:

> >   Could you explain what does that mean? (I don't know, and I'm curious.)
> 
> I've heard the term "legacy code" used to refer to old code that formerly
> had meaning, but now serves no purpose except to eat CPU cycles.

I have also heard it used to mean an existing codebase...for example, 
when moving from Windows to Linux, code that depends on Windows would be 
legacy code.

This, I'd just call "code rot".

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Christopher James Huff
Subject: Re: Related question concerning radiosity code
Date: 5 Sep 2002 09:40:21
Message: <chrishuff-2DAB90.09394605092002@netplex.aussie.org>
In article <3D772CCC.11C85853@reading.ac.uk>,
 Michael Andrews <m.c### [at] readingacuk> wrote:

> But hasn't this been the main argument against doing distributed
> rendering of image pieces (either tiles or strips) when using radiosity?
> Maybe I've misunderstood the problem ...

Sounds like you misunderstand it, since I've never heard about 
brightness adjustment being a problem. The radiosity data doesn't stay 
constant through the render, it is constantly added to. The problem is 
keeping the data up to date between multiple threads, with each thread 
constantly modifying the same data.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

<<< Previous 5 Messages Goto Initial 10 Messages

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