Skip to content

Commit

Permalink
cleanup: removed references to unused SH3Lighting* classes
Browse files Browse the repository at this point in the history
  • Loading branch information
NicSavichev committed Jan 15, 2024
1 parent d9498fb commit 5298f6b
Show file tree
Hide file tree
Showing 14 changed files with 1 addition and 1,471 deletions.
160 changes: 0 additions & 160 deletions prog/dagorInclude/math/dag_SHlight.h

This file was deleted.

15 changes: 0 additions & 15 deletions prog/dagorInclude/scene/dag_sh3LtGrid.h

This file was deleted.

65 changes: 0 additions & 65 deletions prog/dagorInclude/scene/dag_sh3LtGridManager.h

This file was deleted.

98 changes: 0 additions & 98 deletions prog/dagorInclude/scene/dag_sh3LtMgr.h

This file was deleted.

1 change: 0 additions & 1 deletion prog/dagorInclude/shaders/dag_dynSceneRes.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <shaders/dag_IRenderWrapperControl.h>
#include <generic/dag_smallTab.h>
#include <math/dag_TMatrix.h>
#include <math/dag_SHlight.h>
#include <math/dag_bounds3.h>
#include <math/dag_Point4.h>
#include <math/dag_vecMathCompatibility.h>
Expand Down
1 change: 0 additions & 1 deletion prog/dagorInclude/shaders/dag_renderScene.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <shaders/dag_shaderMesh.h>
#include <shaders/dag_IRenderWrapperControl.h>
#include <3d/dag_render.h>
#include <math/dag_SHlight.h>
#include <generic/dag_smallTab.h>
#include <generic/dag_patchTab.h>
#include <math/dag_bounds3.h>
Expand Down
33 changes: 0 additions & 33 deletions prog/engine/math/sHmath.cpp
Original file line number Diff line number Diff line change
@@ -1,41 +1,8 @@
#include <math/dag_SHmath.h>
#include <math/dag_SHlight.h>
#include <math/dag_TMatrix.h>
#include <debug/dag_debug.h>


const SH3Lighting SH3Lighting::ZERO(Color3(0, 0, 0));
const SHDirLighting SHDirLighting::ZERO;

Color3 SH3Lighting::getDiffuseLighting(const Point3 &n) const
{
const real c1 = 0.429043f;
const real c2 = 0.511664f;
const real c3 = 0.743125f;
const real c4 = 0.886227f;
const real c5 = 0.247708f;

return (c1 * (n.x * n.x - n.y * n.y)) * sh[SPHHARM_2p2] + (c3 * n.z * n.z - c5) * sh[SPHHARM_20] + c4 * sh[SPHHARM_00] +
(2 * c1 * n.x * n.z) * sh[SPHHARM_2p1] + (2 * c1 * n.y * n.z) * sh[SPHHARM_2m1] + (2 * c1 * n.x * n.y) * sh[SPHHARM_2m2] +
(2 * c2 * n.x) * sh[SPHHARM_1p1] + (2 * c2 * n.z) * sh[SPHHARM_10] + (2 * c2 * n.y) * sh[SPHHARM_1m1];
}


Color3 SH3Lighting::getSample(const Point3 &n) const
{
return sh[SPHHARM_00] * SPHHARM_COEF_0 + (sh[SPHHARM_1m1] * n.y + sh[SPHHARM_10] * n.z + sh[SPHHARM_1p1] * n.x) * SPHHARM_COEF_1 +
(sh[SPHHARM_2m2] * n.x * n.y + sh[SPHHARM_2m1] * n.y * n.z + sh[SPHHARM_2p1] * n.x * n.z) * SPHHARM_COEF_21 +

sh[SPHHARM_20] * (3 * n.z * n.z - 1) * SPHHARM_COEF_20 + sh[SPHHARM_2p2] * (n.x * n.x - n.y * n.y) * SPHHARM_COEF_22;
}

void SH3StoredLighting::dump()
{
for (int i = 0; i < SPHHARM_NUM3; ++i)
debug(" % f % f % f", sh[i].r, sh[i].g, sh[i].b);
}


void rotate_sphharm(const Color3 worldSH[SPHHARM_NUM3], Color3 localSH[SPHHARM_NUM3], const TMatrix &tm)
{
real x0 = tm[0][0], y0 = tm[0][1], z0 = tm[0][2];
Expand Down
Loading

0 comments on commit 5298f6b

Please sign in to comment.