Skip to content

Commit 8c79f0f

Browse files
authored
Merge pull request #49 from cse-sim/shadeFix
Fix shade calc errors caused by insufficient pixel count
2 parents 0d288d9 + 332fafe commit 8c79f0f

File tree

3 files changed

+704
-704
lines changed

3 files changed

+704
-704
lines changed

src/SHADING.CPP

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -590,10 +590,10 @@ int SURFGEOM::gx_CalcBeamShading( // beam shading for current hour
590590
else
591591
{ float PSSF = PUMBRA( calculatePSSF)( gx_pnIdx);
592592
fBeam = PSSF / (cosi*gx_area);
593+
// PUMBRA(renderScene)(gx_pnIdx);
594+
593595
if (fBeam > 1.f)
594-
{
595-
#if 1
596-
if (fBeam > 1.05f && cosi > .01f)
596+
{ if (fBeam > 1.05f && cosi > .01f)
597597
{ // report some errors > 5% and all errors > 10%
598598
// ignore if low sun angles
599599
static const int MAXFBEAMMSGS = 20;
@@ -603,10 +603,9 @@ int SURFGEOM::gx_CalcBeamShading( // beam shading for current hour
603603
: "";
604604
rWarn( "%s: calculated sunlit fraction (=%0.4f) s/b <= 1.%s",
605605
gx_pParent->classObjTx( 1), fBeam, noMore);
606-
PUMBRA(renderScene)(gx_pnIdx);
606+
// PUMBRA(renderScene)(gx_pnIdx);
607607
}
608608
}
609-
#endif
610609
fBeam = 1.; // limit to 1
611610
}
612611
// round to nearest thousandth to minimize pixel precision
@@ -700,7 +699,8 @@ static void PenumbraMessageHandler(
700699
RC TOPRAT::tp_PumbraInit()
701700
{ RC rc = RCOK;
702701
if (!tp_pPumbra)
703-
{ const int size = 512; // context size (=# of pixels)
702+
{ const int size = 4096; // context size (=# of x and y pixels of gpu buffer)
703+
// 500->4096 1-2019 after inaccurate cases found
704704
tp_pPumbra = new Pumbra::Penumbra( PenumbraMessageHandler, this, size);
705705
if (!tp_pPumbra)
706706
rc = RCBAD; // not expected

0 commit comments

Comments
 (0)