Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package/Shaders/Common/SharedData.hlsli
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace SharedData
cbuffer SharedData : register(b5)
{
float4 WaterData[25];
row_major float3x4 DirectionalAmbient;
float4 DirLightDirection;
float4 DirLightColor;
float4 SunDirection;
Expand Down
2 changes: 1 addition & 1 deletion package/Shaders/Lighting.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -2969,7 +2969,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace : SV_IsFrontFace)
}
# endif

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

# if defined(IBL)
if (SharedData::iblSettings.EnableIBL) {
Expand Down
1 change: 0 additions & 1 deletion src/State.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,6 @@ void State::UpdateSharedData([[maybe_unused]] bool a_inWorld, [[maybe_unused]] b

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

auto shadowSceneNode = shaderManager->shadowSceneNode[0];
auto dirLight = skyrim_cast<RE::NiDirectionalLight*>(shadowSceneNode->GetRuntimeData().sunLight->light.get());
Expand Down
1 change: 0 additions & 1 deletion src/State.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ class State
struct alignas(16) SharedDataCB
{
float4 WaterData[25];
DirectX::XMFLOAT3X4 DirectionalAmbient;
float4 DirLightDirection;
float4 DirLightColor;
float4 SunDirection;
Expand Down
24 changes: 0 additions & 24 deletions src/Utils/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,6 @@

namespace Util
{
void StoreTransform3x4NoScale(DirectX::XMFLOAT3X4& Dest, const RE::NiTransform& Source)
{
//
// Shove a Matrix3+Point3 directly into a float[3][4] with no modifications
//
// Dest[0][#] = Source.m_Rotate.m_pEntry[0][#];
// Dest[0][3] = Source.m_Translate.x;
// Dest[1][#] = Source.m_Rotate.m_pEntry[1][#];
// Dest[1][3] = Source.m_Translate.x;
// Dest[2][#] = Source.m_Rotate.m_pEntry[2][#];
// Dest[2][3] = Source.m_Translate.x;
//
static_assert(sizeof(RE::NiTransform::rotate) == 3 * 3 * sizeof(float)); // NiMatrix3
static_assert(sizeof(RE::NiTransform::translate) == 3 * sizeof(float)); // NiPoint3
static_assert(offsetof(RE::NiTransform, translate) > offsetof(RE::NiTransform, rotate));

_mm_store_ps(Dest.m[0], _mm_loadu_ps(Source.rotate.entry[0]));
_mm_store_ps(Dest.m[1], _mm_loadu_ps(Source.rotate.entry[1]));
_mm_store_ps(Dest.m[2], _mm_loadu_ps(Source.rotate.entry[2]));
Dest.m[0][3] = Source.translate.x;
Dest.m[1][3] = Source.translate.y;
Dest.m[2][3] = Source.translate.z;
}

float4 TryGetWaterData(float offsetX, float offsetY)
{
if (globals::game::shadowState) {
Expand Down
2 changes: 0 additions & 2 deletions src/Utils/Game.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

namespace Util
{
void StoreTransform3x4NoScale(DirectX::XMFLOAT3X4& Dest, const RE::NiTransform& Source);

float4 TryGetWaterData(float offsetX, float offsetY);
float4 GetCameraData();
bool GetTemporal();
Expand Down
Loading