Skip to content

Commit

Permalink
Fix an off by one error
Browse files Browse the repository at this point in the history
  • Loading branch information
llde committed Feb 25, 2024
1 parent 02011da commit bcabffc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
1 change: 0 additions & 1 deletion TESReloaded/Core/ShadowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,6 @@ D3DXMATRIX ShadowManager::GetCascadeViewProj(ShadowMapTypeEnum ShadowMapType, ff

float ar = h / w;

Logger::Log("fov %f %f %f", WorldSceneGraph->cameraFOV, Player->GetFoV(false), Player->GetFoV(true));
float fov = TheRenderManager->FOVData.z;
float fovY = TheRenderManager->FOVData.w;

Expand Down
17 changes: 10 additions & 7 deletions TESReloaded/Core/ShadowManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ class ShadowManager { // Never disposed
public:
static void Initialize();

#define ShadowMapsNumber ShadowMapTypeEnum::MapOrtho +1
#define BlurShadowMaps ShadowMapTypeEnum::MapOrtho

enum ShadowMapTypeEnum {
MapNear = 0,
MapMiddle = 1,
Expand Down Expand Up @@ -45,8 +48,8 @@ class ShadowManager { // Never disposed

ShaderRecordVertex* ShadowMapVertex;
ShaderRecordPixel* ShadowMapPixel;
D3DVIEWPORT9 ShadowMapViewPort[5];
D3DXPLANE ShadowMapFrustum[5][6];
D3DVIEWPORT9 ShadowMapViewPort[ShadowMapsNumber];
D3DXPLANE ShadowMapFrustum[ShadowMapsNumber][6];
NiVector4 BillboardRight;
NiVector4 BillboardUp;
ShaderRecordVertex* ShadowCubeMapVertex;
Expand All @@ -56,12 +59,12 @@ class ShadowManager { // Never disposed

ShaderRecordVertex* ShadowMapBlurVertex;
ShaderRecordPixel* ShadowMapBlurPixel;
IDirect3DVertexBuffer9* BlurShadowVertex[4];
float ShadowMapInverseResolution[5];
float ShadowMapRadius[ShadowMapTypeEnum::MapOrtho];
ShadowMapFeatures ShadowMapsFeatures[ShadowMapTypeEnum::MapOrtho];
IDirect3DVertexBuffer9* BlurShadowVertex[BlurShadowMaps];
float ShadowMapInverseResolution[ShadowMapsNumber];
float ShadowMapRadius[ShadowMapsNumber];
ShadowMapFeatures ShadowMapsFeatures[ShadowMapsNumber];
D3DVIEWPORT9 ShadowCubeMapViewPort;
NiPointLight* ShadowCubeMapLights[4];
NiPointLight* ShadowCubeMapLights[BlurShadowMaps];
ShaderRecordVertex* CurrentVertex;
ShaderRecordPixel* CurrentPixel;
bool AlphaEnabled;
Expand Down

0 comments on commit bcabffc

Please sign in to comment.