mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-20 19:39:41 +00:00
Use three shadow maps per light
This commit is contained in:
parent
715f29165b
commit
3403205231
2 changed files with 6 additions and 5 deletions
|
@ -420,11 +420,11 @@ namespace MWRender
|
|||
previous_sdl.swap(sdl);
|
||||
|
||||
unsigned int numShadowMapsPerLight = settings->getNumShadowMapsPerLight();
|
||||
if (numShadowMapsPerLight>2)
|
||||
/*if (numShadowMapsPerLight>2)
|
||||
{
|
||||
OSG_NOTICE << "numShadowMapsPerLight of " << numShadowMapsPerLight << " is greater than maximum supported, falling back to 2." << std::endl;
|
||||
numShadowMapsPerLight = 2;
|
||||
}
|
||||
}*/
|
||||
|
||||
LightDataList& pll = vdd->getLightDataList();
|
||||
for (LightDataList::iterator itr = pll.begin();
|
||||
|
@ -596,14 +596,15 @@ namespace MWRender
|
|||
if (numShadowMapsPerLight>1)
|
||||
{
|
||||
// compute the start and end range in non-dimensional coords
|
||||
#if 0
|
||||
#if 1
|
||||
double r_start = (sm_i == 0) ? -1.0 : (double(sm_i) / double(numShadowMapsPerLight)*2.0 - 1.0);
|
||||
double r_end = (sm_i + 1 == numShadowMapsPerLight) ? 1.0 : (double(sm_i + 1) / double(numShadowMapsPerLight)*2.0 - 1.0);
|
||||
#endif
|
||||
#else
|
||||
|
||||
// hardwired for 2 splits
|
||||
double r_start = (sm_i == 0) ? -1.0 : splitPoint;
|
||||
double r_end = (sm_i + 1 == numShadowMapsPerLight) ? 1.0 : splitPoint;
|
||||
#endif
|
||||
|
||||
// for all by the last shadowmap shift the r_end so that it overlaps slightly with the next shadowmap
|
||||
// to prevent a seam showing through between the shadowmaps
|
||||
|
|
|
@ -8,7 +8,7 @@ namespace MWRender
|
|||
class MWShadow : public osgShadow::ViewDependentShadowMap
|
||||
{
|
||||
public:
|
||||
static const int numberOfShadowMapsPerLight = 2;
|
||||
static const int numberOfShadowMapsPerLight = 3;
|
||||
static const bool debugHud = true;
|
||||
|
||||
MWShadow();
|
||||
|
|
Loading…
Reference in a new issue