POV-Ray : Newsgroups : povray.programming : Question concerning radiosity code Server Time
28 Jul 2024 10:31:04 EDT (-0400)
  Question concerning radiosity code (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: Christoph Hormann
Subject: Question concerning radiosity code
Date: 28 Aug 2002 12:47:05
Message: <3D6CFE87.59F07B9F@gmx.de>
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.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 13 Aug. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: William F  Pokorny
Subject: Re: Question concerning radiosity code
Date: 28 Aug 2002 13:35:58
Message: <3D6D09FE.668A85B7@attglobal.net>
Christoph,  First line looks useless to me, but I really want to ask a question
about reporting bugs. I recently reported a problem with +ER not allowing a
value of row 1. I read the bug.reports opening message and looked through all
the previous messages as it suggested to be sure nothing had yet been reported,
but on seeing this post of yours I wonder if the process for reporting bugs
isn't quite what is documented in the first post to bug.reports?

Should I have put something out here in programming first as you did?
Thanks Bill P.

> 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.
>
> Christoph
>
> --
> POV-Ray tutorials, IsoWood include,
> TransSkin and more: http://www.tu-bs.de/~y0013390/
> Last updated 13 Aug. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Christoph Hormann
Subject: Re: Question concerning radiosity code
Date: 28 Aug 2002 13:51:38
Message: <3D6D0DAA.A1E49838@gmx.de>
"William F. Pokorny" wrote:
> 
> Christoph,  First line looks useless to me, but I really want to ask a question
> about reporting bugs. I recently reported a problem with +ER not allowing a
> value of row 1. I read the bug.reports opening message and looked through all
> the previous messages as it suggested to be sure nothing had yet been reported,
> but on seeing this post of yours I wonder if the process for reporting bugs
> isn't quite what is documented in the first post to bug.reports?
> 
> Should I have put something out here in programming first as you did?
> Thanks Bill P.

My post wasn't a bug report, there is nothing malfunctioning because of
this as far as i can see.  It's postend in .programming because it's
something about the source code of POV-Ray.

If you have observed some behaviour of the program you would expect to
work differently you should port it in povray.general (or
povray.windows/unix/mac for platform specific issues) If it's considered a
bug after some discussion there you can send it to povray.bugreports and
it will be put in by the moderator.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 13 Aug. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Warp
Subject: Re: Question concerning radiosity code
Date: 28 Aug 2002 18:56:13
Message: <3d6d550d@news.povray.org>
Christoph Hormann <chr### [at] gmxde> wrote:
>   opts.Radiosity_Error_Bound /= opts.Radiosity_Low_Error_Factor;
>   opts.Radiosity_Error_Bound = opts.Real_Radiosity_Error_Bound;

  There's obviously some programming mistake here. I can think of three
choices:
  1. The first line is obsolete.
  2. The second line lacks an operator (which?).
  3. The lines are in the wrong order.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Michael Andrews
Subject: Related question concerning radiosity code
Date: 29 Aug 2002 09:31:27
Message: <3D6E24E4.D3D83C0E@reading.ac.uk>
Christoph Hormann wrote:
> 
> I was studying the radiosity code and found the following in render.cpp,
> function 'Start_Tracing_Radiosity_Preview()', line 1223:
> 
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'.

Reading the comments with it:

    /*
     * This adjusts the overall brightness value so that the darkening
     * effect of the radiosity calculation is cancelled out.
     */

and:

    /* Ensure that the average ambient value returned by
compute_ambient() is about
     * the same as the average ambient value setting in the scene file
     */

and where the variables are initialised at the top of the function (line
966):

  /* Initialize the accumulators which will allow us to set average amb
Brightness */

I assume that this is concerned with the problem people are having with
the automatic radiosity brightness adjustment when using distributed
rendering of radiosity traces.

So my question is: Do we still need this automatic radiosity brightness
adjustment?

It was obviously set up for the old style of radiosity where the ambient
was scaled - which generally darkened the ambient values - and not the
new form which _adds_ light by diffuse interaction.

If someone can point out where the automatic radiosity brightness
adjustment is applied I'll do a compile to test the difference ...

Comments please ...

Bye for now,
	Mike Andrews.


Post a reply to this message

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

Goto Latest 10 Messages Next 5 Messages >>>

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