From 7bfd5bc28db2a0d816bead8a9db65338c22f1791 Mon Sep 17 00:00:00 2001 From: powerof3 <32599957+powerof3@users.noreply.github.com> Date: Tue, 20 Aug 2024 18:29:28 +0530 Subject: [PATCH] Lighting RE --- include/RE/B/BSLight.h | 11 +-- include/RE/B/BSShadowLight.h | 4 +- include/RE/H/HighProcessData.h | 8 +-- include/RE/N/NiCloningProcess.h | 4 +- include/RE/S/ShadowSceneNode.h | 123 ++++++++++++++++---------------- include/RE/S/Sky.h | 3 +- include/RE/T/TESWaterSystem.h | 100 +++++++++++++------------- 7 files changed, 128 insertions(+), 125 deletions(-) diff --git a/include/RE/B/BSLight.h b/include/RE/B/BSLight.h index 871df48d1..145a88ec0 100644 --- a/include/RE/B/BSLight.h +++ b/include/RE/B/BSLight.h @@ -7,6 +7,7 @@ namespace RE { + class BSCullingProcess; class BSPortalGraph; class BSTriShape; class NiAVObject; @@ -39,11 +40,11 @@ namespace RE ~BSLight() override; // 00 // add - virtual bool Unk_02(NiLight* a_light); // 02 - virtual bool Unk_03(); // 03 + virtual bool SetLight(NiLight* a_light); // 02 + virtual bool IsShadowLight(); // 03 // members - std::uint32_t unk010; // 010 + float luminance; // 010 float lodDimmer; // 014 Data unk018; // 018 std::uint64_t unk038; // 038 @@ -54,7 +55,7 @@ namespace RE bool portalStrict; // 047 NiPointer light; // 048 NiPoint3 worldTranslate; // 050 - std::uint32_t unk05C; // 05C + std::uint32_t frustrumCull; // 05C std::uint8_t unk060; // 060 bool affectLand; // 061 bool affectWater; // 062 @@ -70,7 +71,7 @@ namespace RE BSTArray unk0F0; // 0F0 BSTArray unk108; // 108 BSPortalGraph* portalGraph; // 120 - std::uint64_t unk128; // 128 + BSCullingProcess* cullingProcess; // 128 NiPointer objectNode; // 130 BSLensFlareRenderData* lensFlareData; // 138 }; diff --git a/include/RE/B/BSShadowLight.h b/include/RE/B/BSShadowLight.h index bb70d9ed8..725abf849 100644 --- a/include/RE/B/BSShadowLight.h +++ b/include/RE/B/BSShadowLight.h @@ -52,11 +52,11 @@ namespace RE std::uint32_t unk144; // 144 BSTArray unk148; // 148 Data unk160[4]; // 161 - std::uint32_t unk520; // 520 + std::uint32_t maskIndex; // 520 std::uint32_t unk524; // 524 BSTArray unk528; // 528 float shadowBiasScale; // 540 - std::uint32_t unk544; // 544 + std::uint32_t sceneGraphIndex; // 544 std::uint32_t unk548; // 548 std::uint32_t unk54C; // 54C std::uint32_t unk550; // 550 diff --git a/include/RE/H/HighProcessData.h b/include/RE/H/HighProcessData.h index 1786c15a7..ee572abfd 100644 --- a/include/RE/H/HighProcessData.h +++ b/include/RE/H/HighProcessData.h @@ -152,11 +152,11 @@ namespace RE { public: // members - bool unk00; // 00 - bool unk01; // 01 - bool unk02; // 02 + bool enabled; // 00 + bool mpsEnabled; // 01 + bool updateLight; // 02 bool unk03; // 03 - float unk04; // 04 + float enableTimer; // 04 float muzzleFlashDuration; // 08 std::uint32_t unk0C; // 0C NiPointer projectile3D; // 10 diff --git a/include/RE/N/NiCloningProcess.h b/include/RE/N/NiCloningProcess.h index 3318cdb3a..8e1d8b976 100644 --- a/include/RE/N/NiCloningProcess.h +++ b/include/RE/N/NiCloningProcess.h @@ -14,8 +14,8 @@ namespace RE BSTHashMap processMap; // 30 std::uint32_t copyType; // 60 char appendChar; // 64 - std::uint16_t unk65; // 65 - NiPoint3 unk68; // 68 + std::uint16_t pad65; // 65 + NiPoint3 scale; // 68 }; static_assert(sizeof(NiCloningProcess) == 0x78); } diff --git a/include/RE/S/ShadowSceneNode.h b/include/RE/S/ShadowSceneNode.h index fd1bfeae2..23b8e75a4 100644 --- a/include/RE/S/ShadowSceneNode.h +++ b/include/RE/S/ShadowSceneNode.h @@ -24,19 +24,19 @@ namespace RE { public: // members - bool dynamic; // 00 - bool shadowLight; // 01 - bool portalStrict; // 02 - bool affectLand; // 03 - bool affectWater; // 04 - bool neverFades; // 05 - float fov; // 08 - float falloff; // 0C - float nearDistance; // 10 - float depthBias; // 14 - std::uint32_t unk18; // 18 - NiAVObject* restrictedNode; // 20 - BSLensFlareRenderData* lensFlareData; // 28 + bool dynamic; // 00 + bool shadowLight; // 01 + bool portalStrict; // 02 + bool affectLand; // 03 + bool affectWater; // 04 + bool neverFades; // 05 + float fov; // 08 + float falloff; // 0C + float nearDistance; // 10 + float depthBias; // 14 + std::uint32_t sceneGraphIndex; // 18 + NiAVObject* restrictedNode; // 20 + BSLensFlareRenderData* lensFlareData; // 28 }; ~ShadowSceneNode() override; // 00 @@ -53,54 +53,55 @@ namespace RE } // members - std::uint64_t unk128; // 128 - BSTArray> activeLights; // 130 - BSTArray> unk148; // 148 - BSTArray> unk160; // 160 - BSTArray unk178; // 178 - BSTArray> unk190; // 190 - mutable BSSpinLock unk1A8; // 1A8 - BSTArray> geometries; // 1B0 - BSTArray> particleNodes; // 1C8 - BSTArray> actorRootNodes; // 1E0 - mutable BSSpinLock unk1F8; // 1F8 - BSLight* sunLight; // 200 - BSLight* cloudLight; // 208 - BSShadowDirectionalLight* shadowDirLight; // 210 - std::uint8_t unk218; // 218 - std::uint8_t unk219; // 219 - std::uint8_t unk21A; // 21A - std::uint8_t unk21B; // 21B - std::uint32_t pad21C; // 21C - NiPointer fogProperty; // 220 - BSPortalGraph* portalGraph; // 228 - BSTArray shadowCasterLights; // 230 - std::uint64_t unk248; // 248 - std::uint64_t unk250; // 250 - std::uint64_t unk258; // 258 - std::uint64_t unk260; // 260 - std::uint64_t unk268; // 268 - std::uint64_t unk270; // 270 - std::uint64_t unk278; // 278 - std::uint64_t unk280; // 280 - std::uint64_t unk288; // 288 - std::uint64_t unk290; // 290 - std::uint64_t unk298; // 298 - std::uint64_t unk2A0; // 2A0 - std::uint64_t unk2A8; // 2A8 - std::uint64_t unk2B0; // 2B0 - std::uint64_t unk2B8; // 2B8 - std::uint64_t unk2C0; // 2C0 - std::uint64_t unk2C8; // 2C8 - std::uint64_t unk2D0; // 2D0 - std::uint64_t unk2D8; // 2D8 - std::uint64_t unk2E0; // 2E0 - NiPoint3 unk2E8; // 2E8 - NiPoint3 cameraPos; // 2F4 - std::uint8_t unk300; // 300 - std::uint8_t pad301; // 301 - std::uint16_t pad302; // 302 - float unk304; // 304 + std::uint64_t unk128; // 128 + BSTArray> activeLights; // 130 + BSTArray> activeShadowLights; // 148 + BSTArray> lightQueueAdd; // 160 + BSTArray> lightQueueRemove; // 178 + BSTArray> unk190; // 190 - unused? + mutable BSSpinLock lightQueueLock; // 1A8 + BSTArray> litGeometry; // 1B0 + BSTArray> objectList1; // 1C8 + BSTArray> objectList2; // 1E0 + mutable BSSpinLock objectListLock; // 1F8 + BSLight* sunLight; // 200 + BSLight* cloudLight; // 208 + BSShadowDirectionalLight* shadowDirLight; // 210 + std::uint8_t sceneGraphIndex; // 218 + bool disableLightUpdate; // 219 + bool wireframe; // 21A + bool opaqueWireframe; // 21B + std::uint32_t pad21C; // 21C + NiPointer fogProperty; // 220 + BSPortalGraph* portalGraph; // 228 + BSTArray shadowLightsAccum; // 230 + std::uint32_t firstPersonShadowMask; // 248 + std::uint32_t unk24C; // 24C + std::uint64_t unk250; // 250 + std::uint64_t unk258; // 258 + std::uint64_t unk260; // 260 + std::uint64_t unk268; // 268 + std::uint64_t unk270; // 270 + std::uint64_t unk278; // 278 + std::uint64_t unk280; // 280 + std::uint64_t unk288; // 288 + std::uint64_t unk290; // 290 + std::uint64_t unk298; // 298 + std::uint64_t unk2A0; // 2A0 + std::uint64_t unk2A8; // 2A8 + std::uint64_t unk2B0; // 2B0 + std::uint64_t unk2B8; // 2B8 + std::uint64_t unk2C0; // 2C0 + std::uint64_t unk2C8; // 2C8 + std::uint64_t unk2D0; // 2D0 + std::uint64_t unk2D8; // 2D8 + std::uint64_t unk2E0; // 2E0 + NiPoint3 lightingOffset; // 2E8 + NiPoint3 cameraPos; // 2F4 + bool allowLightRemoveQueues; // 300 + std::uint8_t pad301; // 301 + std::uint16_t pad302; // 302 + float windMagnitude; // 304 }; static_assert(sizeof(ShadowSceneNode) == 0x308); } diff --git a/include/RE/S/Sky.h b/include/RE/S/Sky.h index 6deea10dc..69a794c81 100644 --- a/include/RE/S/Sky.h +++ b/include/RE/S/Sky.h @@ -122,7 +122,8 @@ namespace RE BSSimpleList* skySoundList; // 1C0 float flash; // 1C8 std::uint32_t pad1CC; // 1CC - std::time_t flashTime; // 1D0 + std::uint32_t flashTime; // 1D0 + float windowReflectionTimer; // 1D4 std::uint32_t lastMoonPhaseUpdate; // 1D8 stl::enumeration flags; // 1DC ImageSpaceModifierInstanceForm* currentWeatherImageSpaceMod; // 1E0 diff --git a/include/RE/T/TESWaterSystem.h b/include/RE/T/TESWaterSystem.h index 1bb13b6d7..d93288d62 100644 --- a/include/RE/T/TESWaterSystem.h +++ b/include/RE/T/TESWaterSystem.h @@ -40,56 +40,56 @@ namespace RE } // members - std::uint32_t pad000; // 000 - BSFixedString* type; // 008 - std::uint32_t unk010; // 010 - std::uint32_t pad014; // 014 - float unk018; // 018 - float unk01C; // 01C - BSTArray> waterObjects; // 020 - BSTArray> waterReflections; // 038 - BSTArray> waterDisplacement; // 050 - BSTArray> waterNormals; // 068 - std::uint32_t unk080; // 080 - NiPoint2 unk084; // 084 - std::uint32_t pad08C; // 08C - NiPointer waterRoot; // 090 - TESWaterForm* currentWaterType; // 098 - std::uint32_t reflectionExteriorCount; // 0A0 - std::uint32_t reflectionInteriorCount; // 0A4 - TESWorldSpace* worldSpace; // 0A8 - bool enabled; // 0B0 - std::uint8_t pad0B1; // 0B1 - std::uint16_t pad0B2; // 0B2 - std::uint32_t unk0B4; // 0B4 - bool playerUnderwater; // 0B8 - bool unk0B9; // 0B9 - bool unk0BA; // 0BA - std::uint8_t pad0BB; // 0BB - std::uint32_t unk0BC; // 0BC - float underwaterHeight; // 0C0 - bool waterRadiusState; // 0C4 - std::uint8_t pad0C5; // 0C5 - std::uint8_t unk0C6; // 0C6 - bool showProcedualWater; // 0C7 - std::uint8_t unk0C8; // 0C8 - std::uint8_t padC9; // 0C9 - std::uint16_t padCA; // 0CA - std::uint32_t unk0CC; // 0CC - std::uint32_t unk0D0; // 0D0 - float unk0D4; // 0D4 - NiTPointerMap wadingWaterData; // 0D8 - std::uint64_t unk0F8; // 0F8 - std::uint64_t unk100; // 108 - std::uint32_t unk108; // 108 - std::uint32_t pad10C; // 10C - std::uint8_t unk110; // 110 - std::uint8_t pad111; // 111 - std::uint16_t pad112; // 112 - std::uint32_t pad114; // 114 - TESObjectCELL* unk118; // 118 - mutable BSSpinLock lock; // 120 - NiPointer autoWater; // 128 + std::uint32_t pad000; // 000 + BSFixedString* type; // 008 + std::uint32_t unk010; // 010 + std::uint32_t pad014; // 014 + float unk018; // 018 + float unk01C; // 01C + BSTArray> waterObjects; // 020 + BSTArray> waterReflections; // 038 + BSTArray> waterDisplacement; // 050 + BSTArray> waterNormals; // 068 + std::uint32_t unk080; // 080 + NiPoint2 unk084; // 084 + std::uint32_t pad08C; // 08C + NiPointer waterRoot; // 090 + TESWaterForm* currentWaterType; // 098 + std::uint32_t reflectionExteriorCount; // 0A0 + std::uint32_t reflectionInteriorCount; // 0A4 + TESWorldSpace* worldSpace; // 0A8 + bool enabled; // 0B0 + std::uint8_t pad0B1; // 0B1 + std::uint16_t pad0B2; // 0B2 + std::uint32_t unk0B4; // 0B4 + bool playerUnderwater; // 0B8 + bool unk0B9; // 0B9 + bool unk0BA; // 0BA + std::uint8_t pad0BB; // 0BB + std::uint32_t unk0BC; // 0BC + float underwaterHeight; // 0C0 + bool waterRadiusState; // 0C4 + std::uint8_t pad0C5; // 0C5 + std::uint8_t unk0C6; // 0C6 + bool showProcedualWater; // 0C7 + std::uint8_t unk0C8; // 0C8 + std::uint8_t padC9; // 0C9 + std::uint16_t padCA; // 0CA + std::uint32_t unk0CC; // 0CC + std::uint32_t unk0D0; // 0D0 + float timeSinceLastRipplePlaced; // 0D4 + NiTPointerMap wadingWaterData; // 0D8 + std::uint64_t unk0F8; // 0F8 + std::uint64_t unk100; // 108 + std::uint32_t unk108; // 108 + std::uint32_t pad10C; // 10C + std::uint8_t unk110; // 110 + std::uint8_t pad111; // 111 + std::uint16_t pad112; // 112 + std::uint32_t pad114; // 114 + TESObjectCELL* unk118; // 118 + mutable BSSpinLock lock; // 120 + NiPointer autoWater; // 128 }; static_assert(sizeof(TESWaterSystem) == 0x130); };