diff --git a/cmake/sourcelist.cmake b/cmake/sourcelist.cmake index 3421503e6..9a8e386ab 100644 --- a/cmake/sourcelist.cmake +++ b/cmake/sourcelist.cmake @@ -219,6 +219,7 @@ set(SOURCES include/RE/B/BSCullingProcess.h include/RE/B/BSDirectInputManager.h include/RE/B/BSDismemberSkinInstance.h + include/RE/B/BSDistantTreeShaderProperty.h include/RE/B/BSDynamicTriShape.h include/RE/B/BSEffectShaderData.h include/RE/B/BSEffectShaderMaterial.h @@ -237,6 +238,7 @@ set(SOURCES include/RE/B/BSGameSound.h include/RE/B/BSGamepadDevice.h include/RE/B/BSGeometry.h + include/RE/B/BSGrassShaderProperty.h include/RE/B/BSHandleRefObject.h include/RE/B/BSIInputDevice.h include/RE/B/BSIMusicTrack.h @@ -298,6 +300,8 @@ set(SOURCES include/RE/B/BSParticleShaderEmitter.h include/RE/B/BSParticleShaderObjectEmitter.h include/RE/B/BSParticleShaderProperty.h + include/RE/B/BSParticleShaderRainEmitter.h + include/RE/B/BSParticleShaderSnowEmitter.h include/RE/B/BSPathingCell.h include/RE/B/BSPointerHandle.h include/RE/B/BSPointerHandleManager.h @@ -325,6 +329,7 @@ set(SOURCES include/RE/B/BSShaderTextureSet.h include/RE/B/BSShadowLight.h include/RE/B/BSSimpleScaleController.h + include/RE/B/BSSkyShaderProperty.h include/RE/B/BSSmallBlockAllocator.h include/RE/B/BSSoundHandle.h include/RE/B/BSStorage.h @@ -366,6 +371,7 @@ set(SOURCES include/RE/B/BSTriShape.h include/RE/B/BSUIMessageData.h include/RE/B/BSUIScaleformData.h + include/RE/B/BSUtilityShader.h include/RE/B/BSValueNode.h include/RE/B/BSVirtualKeyboardDevice.h include/RE/B/BSVisit.h diff --git a/include/RE/B/BSBatchRenderer.h b/include/RE/B/BSBatchRenderer.h index 5ed514ff7..51e15fbe9 100644 --- a/include/RE/B/BSBatchRenderer.h +++ b/include/RE/B/BSBatchRenderer.h @@ -5,10 +5,38 @@ namespace RE { + class BSRenderPass; + class BSBatchRenderer { public: inline static constexpr auto RTTI = RTTI_BSBatchRenderer; + inline static constexpr auto VTABLE = VTABLE_BSBatchRenderer; + + struct PersistentPassList + { + BSRenderPass* head; // 000 + BSRenderPass* tail; // 008 + }; + static_assert(sizeof(PersistentPassList) == 0x10); + + struct GeometryGroup + { + BSBatchRenderer* batchRenderer; // 000 + PersistentPassList passList; // 008 + std::uintptr_t UnkPtr4; // 018 + float depth; // 020 Distance from geometry to camera location + std::uint16_t count; // 024 + std::uint8_t flags; // 026 + }; + static_assert(sizeof(GeometryGroup) == 0x28); + + struct PassGroup + { + BSRenderPass* passes[5]; // 000 + std::uint32_t validPassBits; // 028 OR'd with (1 << PassIndex) + }; + static_assert(sizeof(PassGroup) == 0x30); virtual ~BSBatchRenderer(); // 00 @@ -18,16 +46,16 @@ namespace RE virtual void Unk_03(void); // 03 // members - BSTArray unk008; // 008 - BSTHashMap unk020; // 020 - std::uint64_t unk050; // 050 - std::uint64_t unk058; // 058 - std::uint64_t unk060; // 060 - std::uint64_t unk068; // 068 - void* unk070[16]; // 070 - std::uint64_t unk0F0; // 0F0 - std::uint64_t unk0F8; // 0F8 - std::uint64_t unk100; // 100 + BSTArray unk008; // 008 + BSTHashMap unk020; // 020 + std::uint64_t unk050; // 050 + std::uint64_t unk058; // 058 + std::uint64_t unk060; // 060 + std::uint64_t unk068; // 068 + GeometryGroup* geometryGroups[16]; // 070 + GeometryGroup* alphaGroup; // 0F0 + void* unk0F8; // 0F8 + void* unk100; // 100 }; static_assert(sizeof(BSBatchRenderer) == 0x108); } diff --git a/include/RE/B/BSBloodSplatterShaderProperty.h b/include/RE/B/BSBloodSplatterShaderProperty.h index 3e839719f..3b2ea3e32 100644 --- a/include/RE/B/BSBloodSplatterShaderProperty.h +++ b/include/RE/B/BSBloodSplatterShaderProperty.h @@ -14,6 +14,7 @@ namespace RE public: inline static constexpr auto RTTI = RTTI_BSBloodSplatterShaderProperty; inline static constexpr auto Ni_RTTI = NiRTTI_BSBloodSplatterShaderProperty; + inline static constexpr auto VTABLE = VTABLE_BSBloodSplatterShaderProperty; enum : std::uint32_t { diff --git a/include/RE/B/BSDistantTreeShaderProperty.h b/include/RE/B/BSDistantTreeShaderProperty.h new file mode 100644 index 000000000..b427cb22d --- /dev/null +++ b/include/RE/B/BSDistantTreeShaderProperty.h @@ -0,0 +1,32 @@ +#pragma once + +#include "RE/B/BSShaderProperty.h" + +namespace RE +{ + class BSDistantTreeShaderProperty : public BSShaderProperty + { + public: + inline static constexpr auto RTTI = RTTI_BSDistantTreeShaderProperty; + inline static constexpr auto Ni_RTTI = NiRTTI_BSDistantTreeShaderProperty; + inline static constexpr auto VTABLE = VTABLE_BSDistantTreeShaderProperty; + + ~BSDistantTreeShaderProperty() override; // 00 + + // override (BSShaderProperty) + const NiRTTI* GetRTTI() const override; // 02 + RenderPassArray* GetRenderPasses(BSGeometry* a_geometry, std::uint32_t a_arg2, BSShaderAccumulator* a_accumulator) override; // 2A + void Unk_2B(void) override; // 2B + void Unk_2F(void) override; // 2F + std::int32_t ForEachTexture(ForEachVisitor& a_visitor) override; // 33 + [[nodiscard]] NiSourceTexture* GetBaseTexture() override; // 37 + + // members + std::uint64_t unk88; // 88 + std::uint64_t unk90; // 90 + std::uint64_t unk98; // 98 + std::uint64_t unkA0; // A0 + std::uint64_t unkA8; // A8 + }; + static_assert(sizeof(BSDistantTreeShaderProperty) == 0xB0); +} diff --git a/include/RE/B/BSEffectShaderProperty.h b/include/RE/B/BSEffectShaderProperty.h index 3cc6f9f20..ed53362b9 100644 --- a/include/RE/B/BSEffectShaderProperty.h +++ b/include/RE/B/BSEffectShaderProperty.h @@ -11,6 +11,7 @@ namespace RE public: inline static constexpr auto RTTI = RTTI_BSEffectShaderProperty; inline static constexpr auto Ni_RTTI = NiRTTI_BSEffectShaderProperty; + inline static constexpr auto VTABLE = VTABLE_BSEffectShaderProperty; ~BSEffectShaderProperty() override; // 00 diff --git a/include/RE/B/BSGrassShaderProperty.h b/include/RE/B/BSGrassShaderProperty.h new file mode 100644 index 000000000..c1c89458b --- /dev/null +++ b/include/RE/B/BSGrassShaderProperty.h @@ -0,0 +1,51 @@ +#pragma once + +#include "RE/B/BSLightingShaderProperty.h" + +namespace RE +{ + class BSGrassShaderProperty : public BSLightingShaderProperty + { + public: + inline static constexpr auto RTTI = RTTI_BSGrassShaderProperty; + inline static constexpr auto Ni_RTTI = NiRTTI_BSGrassShaderProperty; + inline static constexpr auto VTABLE = VTABLE_BSGrassShaderProperty; + + virtual ~BSGrassShaderProperty(); // 00 + + // override (BSLightingShaderProperty) + const NiRTTI* GetRTTI() const override; // 02 + NiObject* CreateClone(NiCloningProcess& a_cloning) override; // 17 + void LoadBinary(NiStream& a_stream) override; // 18 + void LinkObject(NiStream& a_stream) override; // 19 + bool RegisterStreamables(NiStream& a_stream) override; // 1A + void SaveBinary(NiStream& a_stream) override; // 1B + bool IsEqual(NiObject* a_object) override; // 1C + bool SetupGeometry(BSGeometry* a_geometry) override; // 27 + RenderPassArray* GetRenderPasses(BSGeometry* a_geometry, std::uint32_t a_arg2, BSShaderAccumulator* a_accumulator) override; // 2A + void Unk_2B(void) override; // 2B + void Unk_2F(void) override; // 2F + std::int32_t QShader() override; // 35 + + // add + void Unk_3F(void); // 3F + void Unk_40(void); // 40 + + // members + std::uint64_t unk160; // 160 + std::uint64_t unk168; // 168 + std::uint64_t unk170; // 170 + std::uint64_t unk178; // 178 + std::uint64_t unk180; // 180 + std::uint64_t unk188; // 188 + std::uint64_t unk190; // 190 + std::uint64_t unk198; // 198 + std::uint64_t unk1A0; // 1A0 + std::uint64_t unk1A8; // 1A8 + std::uint64_t unk1B0; // 1B0 + std::uint64_t unk1B8; // 1B8 + std::uint64_t unk1C0; // 1C0 + std::uint64_t unk1C8; // 1C8 + }; + static_assert(sizeof(BSGrassShaderProperty) == 0x1D0); +} diff --git a/include/RE/B/BSLightingShaderProperty.h b/include/RE/B/BSLightingShaderProperty.h index db3cc0301..6cd654d64 100644 --- a/include/RE/B/BSLightingShaderProperty.h +++ b/include/RE/B/BSLightingShaderProperty.h @@ -11,6 +11,7 @@ namespace RE public: inline static constexpr auto RTTI = RTTI_BSLightingShaderProperty; inline static constexpr auto Ni_RTTI = NiRTTI_BSLightingShaderProperty; + inline static constexpr auto VTABLE = VTABLE_BSLightingShaderProperty; struct Data { diff --git a/include/RE/B/BSParticleShaderCubeEmitter.h b/include/RE/B/BSParticleShaderCubeEmitter.h index c0d72e331..867768a3d 100644 --- a/include/RE/B/BSParticleShaderCubeEmitter.h +++ b/include/RE/B/BSParticleShaderCubeEmitter.h @@ -11,6 +11,7 @@ namespace RE { public: inline static constexpr auto RTTI = RTTI_BSParticleShaderCubeEmitter; + inline static constexpr auto VTABLE = VTABLE_BSParticleShaderCubeEmitter; ~BSParticleShaderCubeEmitter() override; // 00 diff --git a/include/RE/B/BSParticleShaderEmitter.h b/include/RE/B/BSParticleShaderEmitter.h index ee3a4a81f..f3bedef18 100644 --- a/include/RE/B/BSParticleShaderEmitter.h +++ b/include/RE/B/BSParticleShaderEmitter.h @@ -11,6 +11,7 @@ namespace RE { public: inline static constexpr auto RTTI = RTTI_BSParticleShaderEmitter; + inline static constexpr auto VTABLE = VTABLE_BSParticleShaderEmitter; enum class EMITTER_TYPE { diff --git a/include/RE/B/BSParticleShaderObjectEmitter.h b/include/RE/B/BSParticleShaderObjectEmitter.h index 668912ba0..1ac9c8102 100644 --- a/include/RE/B/BSParticleShaderObjectEmitter.h +++ b/include/RE/B/BSParticleShaderObjectEmitter.h @@ -8,6 +8,7 @@ namespace RE { public: inline static constexpr auto RTTI = RTTI_BSParticleShaderObjectEmitter; + inline static constexpr auto VTABLE = VTABLE_BSParticleShaderObjectEmitter; ~BSParticleShaderObjectEmitter() override; // 00 diff --git a/include/RE/B/BSParticleShaderProperty.h b/include/RE/B/BSParticleShaderProperty.h index 3124e03b9..84af155d0 100644 --- a/include/RE/B/BSParticleShaderProperty.h +++ b/include/RE/B/BSParticleShaderProperty.h @@ -16,6 +16,7 @@ namespace RE public: inline static constexpr auto RTTI = RTTI_BSParticleShaderProperty; inline static constexpr auto Ni_RTTI = NiRTTI_BSParticleShaderProperty; + inline static constexpr auto VTABLE = VTABLE_BSParticleShaderProperty; virtual ~BSParticleShaderProperty(); // 00 diff --git a/include/RE/B/BSParticleShaderRainEmitter.h b/include/RE/B/BSParticleShaderRainEmitter.h new file mode 100644 index 000000000..5fa67fb2e --- /dev/null +++ b/include/RE/B/BSParticleShaderRainEmitter.h @@ -0,0 +1,16 @@ +#pragma once + +#include "RE/B/BSParticleShaderCubeEmitter.h" + +namespace RE +{ + class BSParticleShaderRainEmitter : public BSParticleShaderCubeEmitter + { + public: + inline static constexpr auto RTTI = RTTI_BSParticleShaderRainEmitter; + inline static constexpr auto VTABLE = VTABLE_BSParticleShaderRainEmitter; + + ~BSParticleShaderRainEmitter() override; // 00 + }; + static_assert(sizeof(BSParticleShaderRainEmitter) == 0xFE0); +} diff --git a/include/RE/B/BSParticleShaderSnowEmitter.h b/include/RE/B/BSParticleShaderSnowEmitter.h new file mode 100644 index 000000000..54e592255 --- /dev/null +++ b/include/RE/B/BSParticleShaderSnowEmitter.h @@ -0,0 +1,16 @@ +#pragma once + +#include "RE/B/BSParticleShaderCubeEmitter.h" + +namespace RE +{ + class BSParticleShaderSnowEmitter : public BSParticleShaderCubeEmitter + { + public: + inline static constexpr auto RTTI = RTTI_BSParticleShaderSnowEmitter; + inline static constexpr auto VTABLE = VTABLE_BSParticleShaderSnowEmitter; + + ~BSParticleShaderSnowEmitter() override; // 00 + }; + static_assert(sizeof(BSParticleShaderSnowEmitter) == 0xFE0); +} diff --git a/include/RE/B/BSShaderProperty.h b/include/RE/B/BSShaderProperty.h index c328d5e58..4595e6a86 100644 --- a/include/RE/B/BSShaderProperty.h +++ b/include/RE/B/BSShaderProperty.h @@ -12,6 +12,8 @@ namespace RE class BSShaderMaterial; class BSShaderPropertyLightData; class NiSourceTexture; + class BSShader; + class BSLight; class BSShaderProperty : public NiShadeProperty { @@ -21,6 +23,7 @@ namespace RE public: inline static constexpr auto RTTI = RTTI_BSShaderProperty; inline static constexpr auto Ni_RTTI = NiRTTI_BSShaderProperty; + inline static constexpr auto VTABLE = VTABLE_BSShaderProperty; class ForEachVisitor { @@ -35,7 +38,14 @@ namespace RE struct RenderPassArray { - BSRenderPass* head; // 0 + BSRenderPass* MakeRenderPass(BSShader* a_shader, BSShaderProperty* a_property, BSGeometry* a_geometry, uint32_t a_technique, uint8_t a_numLights, BSLight** a_lights); + void ClearRenderPass(BSRenderPass* a_pass); + void Clear(); + BSRenderPass* EmplacePass(BSShader* a_shader, BSShaderProperty* a_property, BSGeometry* a_geometry, + uint32_t a_technique, uint8_t a_numLights = 0, BSLight* a_light0 = nullptr, BSLight* a_light1 = nullptr, + BSLight* a_light2 = nullptr, BSLight* a_light3 = nullptr); + + BSRenderPass* head; // 00 }; static_assert(sizeof(RenderPassArray) == 0x8); @@ -215,6 +225,7 @@ namespace RE void SetEffectShaderData(const BSTSmartPointer& a_data); void SetMaterial(BSShaderMaterial* a_material, bool a_unk1); void SetFlags(EShaderPropertyFlag8 a_flag, bool a_set); + void LinkMaterial(BSShaderMaterial* a_material, bool a_unk1); // members float alpha; // 30 diff --git a/include/RE/B/BSSkyShaderProperty.h b/include/RE/B/BSSkyShaderProperty.h new file mode 100644 index 000000000..fede9eab3 --- /dev/null +++ b/include/RE/B/BSSkyShaderProperty.h @@ -0,0 +1,53 @@ +#pragma once + +#include "RE/B/BSShaderProperty.h" + +namespace RE +{ + class BSSkyShaderProperty : public BSShaderProperty + { + public: + inline static constexpr auto RTTI = RTTI_BSSkyShaderProperty; + inline static auto Ni_RTTI = NiRTTI_BSSkyShaderProperty; + inline static auto VTABLE = VTABLE_BSSkyShaderProperty; + + ~BSSkyShaderProperty() override; // 00 + + // override (BSShaderProperty) + const NiRTTI* GetRTTI() const override; // 02 + NiObject* CreateClone(NiCloningProcess& a_cloning) override; // 17 + void LoadBinary(NiStream& a_stream) override; // 18 + void LinkObject(NiStream& a_stream) override; // 19 + bool RegisterStreamables(NiStream& a_stream) override; // 1A + void SaveBinary(NiStream& a_stream) override; // 1B + bool IsEqual(NiObject* a_object) override; // 1C + void PostLinkObject(NiStream& a_stream) override; // 1E + RenderPassArray* GetRenderPasses(BSGeometry* a_geometry, std::uint32_t a_arg2, BSShaderAccumulator* a_accumulator) override; // 2A + std::int32_t ForEachTexture(ForEachVisitor& a_visitor) override; // 33 + virtual std::int32_t QShader() override; // 35 + [[nodiscard]] virtual NiSourceTexture* GetBaseTexture() override; // 37 + + enum SkyObject + { + SO_SUN = 0x0, + SO_SUN_GLARE = 0x1, + SO_ATMOSPHERE = 0x2, + SO_CLOUDS = 0x3, + SO_SKYQUAD = 0x4, + SO_STARS = 0x5, + SO_MOON = 0x6, + SO_MOON_SHADOW = 0x7, + }; + + // members + RE::NiColorA kBlendColor; // 088 + RE::NiSourceTexture* pBaseTexture; // 098 + RE::NiSourceTexture* pBlendTexture; // 0A0 + std::uint8_t unk0A8[0x10]; // 0A8 + float fBlendValue; // 0B8 + std::uint16_t usCloudLayer; // 0BC + bool bFadeSecondTexture; // 0BE + stl::enumeration uiSkyObjectType; // 0BF + }; + static_assert(sizeof(BSSkyShaderProperty) == 0xC8); +} diff --git a/include/RE/B/BSUtilityShader.h b/include/RE/B/BSUtilityShader.h new file mode 100644 index 000000000..ca7fe3cc6 --- /dev/null +++ b/include/RE/B/BSUtilityShader.h @@ -0,0 +1,65 @@ +#pragma once + +#include "RE/B/BSShader.h" + +namespace RE +{ + class BSUtilityShader : public BSShader + { + public: + inline static constexpr auto RTTI = RTTI_BSUtilityShader; + inline static constexpr auto VTABLE = VTABLE_BSUtilityShader; + + enum class Flags + { + None = 0, + Vc = 1 << 0, + Texture = 1 << 1, + Skinned = 1 << 2, + Normals = 1 << 3, + BinormalTangent = 1 << 4, + AlphaTest = 1 << 7, + LodLandscape = 1 << 8, + RenderNormal = 1 << 9, + RenderNormalFalloff = 1 << 10, + RenderNormalClamp = 1 << 11, + RenderNormalClear = 1 << 12, + RenderDepth = 1 << 13, + RenderShadowmap = 1 << 14, + RenderShadowmapClamped = 1 << 15, + GrayscaleToAlpha = 1 << 15, + RenderShadowmapPb = 1 << 16, + AdditionalAlphaMask = 1 << 16, + DepthWriteDecals = 1 << 17, + DebugShadowSplit = 1 << 18, + DebugColor = 1 << 19, + GrayscaleMask = 1 << 20, + RenderShadowmask = 1 << 21, + RenderShadowmaskSpot = 1 << 22, + RenderShadowmaskPb = 1 << 23, + RenderShadowmaskDpb = 1 << 24, + RenderBaseTexture = 1 << 25, + TreeAnim = 1 << 26, + LodObject = 1 << 27, + LocalMapFogOfWar = 1 << 28, + OpaqueEffect = 1 << 29, + }; + + static BSUtilityShader* GetSingleton() + { + REL::Relocation singleton{ RELOCATION_ID(528354, 415300) }; + return *singleton; + } + ~BSUtilityShader() override; // 00 + + // override (BSShader) + bool SetupTechnique(std::uint32_t globalTechnique) override; // 02 + void RestoreTechnique(std::uint32_t globalTechnique) override; // 03 + void SetupGeometry(BSRenderPass* pass, uint32_t flags) override; // 06 + void RestoreGeometry(BSRenderPass* pass, uint32_t flags) override; // 07 + + // members + std::uint64_t unk90; // 90 + }; + static_assert(sizeof(BSUtilityShader) == 0x98); +} diff --git a/include/RE/B/BSWaterShaderProperty.h b/include/RE/B/BSWaterShaderProperty.h index 46f3d7b50..dfd98f4d3 100644 --- a/include/RE/B/BSWaterShaderProperty.h +++ b/include/RE/B/BSWaterShaderProperty.h @@ -11,6 +11,7 @@ namespace RE public: inline static constexpr auto RTTI = RTTI_BSWaterShaderProperty; inline static constexpr auto Ni_RTTI = NiRTTI_BSWaterShaderProperty; + inline static constexpr auto VTABLE = VTABLE_BSWaterShaderProperty; enum class WaterFlag { diff --git a/include/RE/H/hkpListShape.h b/include/RE/H/hkpListShape.h index f778c6ffb..4ae189348 100644 --- a/include/RE/H/hkpListShape.h +++ b/include/RE/H/hkpListShape.h @@ -47,7 +47,7 @@ namespace RE void CastRayWithCollectorImpl(const hkpShapeRayCastInput& a_input, const hkpCdBody& a_cdBody, hkpRayHitCollector& a_collector) const override; // 09 // override (hkpShapeContainer) - std::int32_t GetNumChildShapes() const override; // 01 - { return m_childInfo.getSize() - m_numDisabledChildren; } + std::int32_t GetNumChildShapes() const override; // 01 - { return childInfo.getSize() - numDisabledChildren; } hkpShapeKey GetFirstKey() const override; // 02 - { return hkpListShape::getNextKey(hkpShapeKey(-1)); } hkpShapeKey GetNextKey(hkpShapeKey a_oldKey) const override; // 03 std::uint32_t GetCollisionFilterInfo(hkpShapeKey a_key) const override; // 04 diff --git a/include/RE/N/NiGeometry.h b/include/RE/N/NiGeometry.h index 3c9ec8c18..cff754517 100644 --- a/include/RE/N/NiGeometry.h +++ b/include/RE/N/NiGeometry.h @@ -39,16 +39,16 @@ namespace RE virtual void Unk_35(void); // 35 - call controller vtbl+0xA0? virtual void Unk_36(void); // 36 - ret 0 virtual void Unk_37(void); // 37 - same as Unk_33 - virtual void* Unk_38(void); // 38 - ret call m_spModelData vtbl+0x9C + virtual void* Unk_38(void); // 38 - ret call spModelData vtbl+0x9C virtual void SetGeometryData(NiGeometryData* unk1); // 39 - set and AddRef geometry data - virtual void* Unk_3A(void); // 3A - ret call m_spModelData vtbl+0x94 + virtual void* Unk_3A(void); // 3A - ret callspModelData vtbl+0x94 // members - NiPointer m_spPropertyState; // 110 - NiPointer m_spEffectState; // 118 - NiPointer m_spSkinInstance; // 120 - NiPointer m_spModelData; // 128 - std::uint64_t unk130; // 130 + NiPointer spPropertyState; // 110 + NiPointer spEffectState; // 118 + NiPointer spSkinInstance; // 120 + NiPointer spModelData; // 128 + std::uint64_t unk130; // 130 }; static_assert(sizeof(NiGeometry) == 0x138); } diff --git a/include/RE/P/Precipitation.h b/include/RE/P/Precipitation.h index 7e7dcf9dc..7df833e5e 100644 --- a/include/RE/P/Precipitation.h +++ b/include/RE/P/Precipitation.h @@ -9,6 +9,7 @@ namespace RE { class BSCullingProcess; class BSGeometry; + class BSParticleShaderRainEmitter; class BSShaderAccumulator; class NiCamera; @@ -37,6 +38,20 @@ namespace RE return *precipDirection; } + void SetupMask() + { + using func_t = decltype(&Precipitation::SetupMask); + REL::Relocation func{ RELOCATION_ID(25641, 26183) }; + func(this); + } + + void RenderMask(BSParticleShaderRainEmitter* a_emitter) + { + using func_t = decltype(&Precipitation::RenderMask); + REL::Relocation func{ RELOCATION_ID(25642, 26184) }; + func(this, a_emitter); + } + // members OcclusionMapData occlusionData; // 10 NiPointer currentPrecip; // 70 diff --git a/include/RE/Skyrim.h b/include/RE/Skyrim.h index 0a0cd80cd..dc41f2520 100644 --- a/include/RE/Skyrim.h +++ b/include/RE/Skyrim.h @@ -221,6 +221,7 @@ #include "RE/B/BSCullingProcess.h" #include "RE/B/BSDirectInputManager.h" #include "RE/B/BSDismemberSkinInstance.h" +#include "RE/B/BSDistantTreeShaderProperty.h" #include "RE/B/BSDynamicTriShape.h" #include "RE/B/BSEffectShaderData.h" #include "RE/B/BSEffectShaderMaterial.h" @@ -239,6 +240,7 @@ #include "RE/B/BSGameSound.h" #include "RE/B/BSGamepadDevice.h" #include "RE/B/BSGeometry.h" +#include "RE/B/BSGrassShaderProperty.h" #include "RE/B/BSHandleRefObject.h" #include "RE/B/BSIInputDevice.h" #include "RE/B/BSIMusicTrack.h" @@ -300,6 +302,8 @@ #include "RE/B/BSParticleShaderEmitter.h" #include "RE/B/BSParticleShaderObjectEmitter.h" #include "RE/B/BSParticleShaderProperty.h" +#include "RE/B/BSParticleShaderRainEmitter.h" +#include "RE/B/BSParticleShaderSnowEmitter.h" #include "RE/B/BSPathingCell.h" #include "RE/B/BSPointerHandle.h" #include "RE/B/BSPointerHandleManager.h" @@ -327,6 +331,7 @@ #include "RE/B/BSShaderTextureSet.h" #include "RE/B/BSShadowLight.h" #include "RE/B/BSSimpleScaleController.h" +#include "RE/B/BSSkyShaderProperty.h" #include "RE/B/BSSmallBlockAllocator.h" #include "RE/B/BSSoundHandle.h" #include "RE/B/BSStorage.h" @@ -368,6 +373,7 @@ #include "RE/B/BSTriShape.h" #include "RE/B/BSUIMessageData.h" #include "RE/B/BSUIScaleformData.h" +#include "RE/B/BSUtilityShader.h" #include "RE/B/BSValueNode.h" #include "RE/B/BSVirtualKeyboardDevice.h" #include "RE/B/BSVisit.h" diff --git a/src/RE/B/BSShaderProperty.cpp b/src/RE/B/BSShaderProperty.cpp index 4e239909b..15e1f5699 100644 --- a/src/RE/B/BSShaderProperty.cpp +++ b/src/RE/B/BSShaderProperty.cpp @@ -1,5 +1,7 @@ #include "RE/B/BSShaderProperty.h" +#include "RE/B/BSRenderPass.h" + namespace RE { void BSShaderProperty::SetEffectShaderData(const BSTSmartPointer& a_data) @@ -21,4 +23,64 @@ namespace RE REL::Relocation func{ RELOCATION_ID(98893, 105540) }; return func(this, a_flag, a_set); } + + void BSShaderProperty::LinkMaterial(BSShaderMaterial* a_material, bool a_unk1) + { + using func_t = decltype(&BSShaderProperty::LinkMaterial); + REL::Relocation func{ RELOCATION_ID(98897, 105544) }; + return func(this, a_material, a_unk1); + } + + void BSShaderProperty::LoadBinary(NiStream& a_stream) + { + auto vtable = REL::Relocation(BSShaderProperty::VTABLE[0]); + auto baseMethod = reinterpret_cast((vtable.get()[0x18])); + return baseMethod(this, a_stream); + } + + BSRenderPass* BSShaderProperty::RenderPassArray::MakeRenderPass(BSShader* a_shader, BSShaderProperty* a_property, BSGeometry* a_geometry, uint32_t a_technique, uint8_t a_numLights, BSLight** a_lights) + { + using func_t = decltype(&BSShaderProperty::RenderPassArray::MakeRenderPass); + REL::Relocation func{ RELOCATION_ID(100717, 107497) }; + return func(this, a_shader, a_property, a_geometry, a_technique, a_numLights, a_lights); + } + + void BSShaderProperty::RenderPassArray::ClearRenderPass(BSRenderPass* a_pass) + { + using func_t = decltype(&RenderPassArray::ClearRenderPass); + REL::Relocation func{ RELOCATION_ID(100718, 107498) }; + func(this, a_pass); + } + + void BSShaderProperty::RenderPassArray::Clear() + { + while (head != nullptr) { + BSRenderPass* next = head->next; + ClearRenderPass(head); + head = next; + } + head = nullptr; + } + + BSRenderPass* BSShaderProperty::RenderPassArray::EmplacePass(BSShader* a_shader, BSShaderProperty* a_property, BSGeometry* a_geometry, + uint32_t a_technique, uint8_t a_numLights, BSLight* a_light0, BSLight* a_light1, BSLight* a_light2, BSLight* a_light3) + { + BSLight* lights[4]{ + a_light0, + a_light1, + a_light2, + a_light3 + }; + auto* newPass = MakeRenderPass(a_shader, a_property, a_geometry, a_technique, a_numLights, lights); + if (head != nullptr) { + RE::BSRenderPass* lastPass = head; + while (lastPass->next != nullptr) { + lastPass = lastPass->next; + } + lastPass->next = newPass; + } else { + head = newPass; + } + return newPass; + } }