Skip to content

Commit 45b4ef2

Browse files
fix(ibl): blown out main menu (#2596)
Co-authored-by: doodlum <15017472+doodlum@users.noreply.github.com>
1 parent 7099531 commit 45b4ef2

6 files changed

Lines changed: 1 addition & 30 deletions

File tree

package/Shaders/Common/SharedData.hlsli

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ namespace SharedData
99
cbuffer SharedData : register(b5)
1010
{
1111
float4 WaterData[25];
12-
row_major float3x4 DirectionalAmbient;
1312
float4 DirLightDirection;
1413
float4 DirLightColor;
1514
float4 SunDirection;

package/Shaders/Lighting.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2969,7 +2969,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace : SV_IsFrontFace)
29692969
}
29702970
# endif
29712971

2972-
float3 directionalAmbientColor = Color::Ambient(max(0, SharedData::GetAmbient(ambientNormal)));
2972+
float3 directionalAmbientColor = Color::Ambient(max(0, mul(DirectionalAmbient, float4(ambientNormal, 1.0))));
29732973

29742974
# if defined(IBL)
29752975
if (SharedData::iblSettings.EnableIBL) {

src/State.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,6 @@ void State::UpdateSharedData([[maybe_unused]] bool a_inWorld, [[maybe_unused]] b
991991

992992
const auto shaderManager = globals::game::smState;
993993
const RE::NiTransform& dalcTransform = shaderManager->directionalAmbientTransform;
994-
Util::StoreTransform3x4NoScale(data.DirectionalAmbient, dalcTransform);
995994

996995
auto shadowSceneNode = shaderManager->shadowSceneNode[0];
997996
auto dirLight = skyrim_cast<RE::NiDirectionalLight*>(shadowSceneNode->GetRuntimeData().sunLight->light.get());

src/State.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ class State
330330
struct alignas(16) SharedDataCB
331331
{
332332
float4 WaterData[25];
333-
DirectX::XMFLOAT3X4 DirectionalAmbient;
334333
float4 DirLightDirection;
335334
float4 DirLightColor;
336335
float4 SunDirection;

src/Utils/Game.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,6 @@
55

66
namespace Util
77
{
8-
void StoreTransform3x4NoScale(DirectX::XMFLOAT3X4& Dest, const RE::NiTransform& Source)
9-
{
10-
//
11-
// Shove a Matrix3+Point3 directly into a float[3][4] with no modifications
12-
//
13-
// Dest[0][#] = Source.m_Rotate.m_pEntry[0][#];
14-
// Dest[0][3] = Source.m_Translate.x;
15-
// Dest[1][#] = Source.m_Rotate.m_pEntry[1][#];
16-
// Dest[1][3] = Source.m_Translate.x;
17-
// Dest[2][#] = Source.m_Rotate.m_pEntry[2][#];
18-
// Dest[2][3] = Source.m_Translate.x;
19-
//
20-
static_assert(sizeof(RE::NiTransform::rotate) == 3 * 3 * sizeof(float)); // NiMatrix3
21-
static_assert(sizeof(RE::NiTransform::translate) == 3 * sizeof(float)); // NiPoint3
22-
static_assert(offsetof(RE::NiTransform, translate) > offsetof(RE::NiTransform, rotate));
23-
24-
_mm_store_ps(Dest.m[0], _mm_loadu_ps(Source.rotate.entry[0]));
25-
_mm_store_ps(Dest.m[1], _mm_loadu_ps(Source.rotate.entry[1]));
26-
_mm_store_ps(Dest.m[2], _mm_loadu_ps(Source.rotate.entry[2]));
27-
Dest.m[0][3] = Source.translate.x;
28-
Dest.m[1][3] = Source.translate.y;
29-
Dest.m[2][3] = Source.translate.z;
30-
}
31-
328
float4 TryGetWaterData(float offsetX, float offsetY)
339
{
3410
if (globals::game::shadowState) {

src/Utils/Game.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
namespace Util
66
{
7-
void StoreTransform3x4NoScale(DirectX::XMFLOAT3X4& Dest, const RE::NiTransform& Source);
8-
97
float4 TryGetWaterData(float offsetX, float offsetY);
108
float4 GetCameraData();
119
bool GetTemporal();

0 commit comments

Comments
 (0)