- Bug fixes for radio render (yes, releasing gives more reports!)

1. Rendering with material without radio flag sometimes caused scanline
   errors. The 'rad' value for rendercore loop wasn't reset in all cases
2. The color didn't truely match the color when using 'radio tool'.
   Cleaned up a few old lines in rendercore loop... accidentally one
   calculation was done double.
3. When adding new radiosity block, 'max iterations' is set at 120. this
   prevents noobies/experiment from going into radio-solving with a long
   itteration time (it exits at convergence < 0.1)
This commit is contained in:
Ton Roosendaal 2003-09-27 09:38:09 +00:00
parent 0dce5a6fbe
commit 3cf1cacd5d
3 changed files with 3 additions and 8 deletions

@ -264,6 +264,7 @@ void add_radio()
rad->elmi= 20;
rad->nodelim= 0;
rad->maxnode= 10000;
rad->maxiter= 120; // arbitrary
rad->flag= 2;
set_radglobal();
}

@ -498,7 +498,7 @@ void make_vertex_rad_values()
/* make vertex colors */
RG.igamma= 1.0/RG.gamma;
RG.radfactor= RG.radfac*pow(64*64, RG.igamma)/256.0; /* compatible with radio-tool */
RG.radfactor= RG.radfac*pow(64*64, RG.igamma)/128.0; /* compatible with radio-tool */
for(a=0; a<R.totvert; a++) {
if((a & 255)==0) v1= R.blove[a>>8]; else v1++;

@ -1897,13 +1897,6 @@ void shade_lamp_loop()
}
}
if( ma->mode & MA_RADIO) {
ir+= ma->amb*R.rad[0];
ig+= ma->amb*R.rad[1];
ib+= ma->amb*R.rad[2];
}
if(R.refcol[0]==0.0) {
a= 65535.0*( ma->r*ir +ma->ambr +isr +ma->amb*R.rad[0]);
if(a>65535) a=65535; else if(a<0) a= 0;
@ -2327,6 +2320,7 @@ void shadepixel(float x, float y, int vlaknr)
}
else {
VECCOPY(R.vn, vlr->n);
R.rad[0]= R.rad[1]= R.rad[2]= 0.0;
}
if(R.matren->texco & TEXCO_WINDOW) {
R.winco[0]= (x+(R.xstart))/(float)R.afmx;