CommonLibSSE (powerof3)
BSShaderProperty.h
Go to the documentation of this file.
1 #pragma once
2 
5 #include "RE/B/BSTSmartPointer.h"
6 #include "RE/N/NiShadeProperty.h"
7 
8 namespace RE
9 {
10  class BSRenderPass;
11  class BSShaderAccumulator;
12  class BSShaderMaterial;
13  class BSShaderPropertyLightData;
14  class NiSourceTexture;
15 
17  {
18  private:
19  static constexpr auto BIT64 = static_cast<std::uint64_t>(1);
20 
21  public:
22  inline static constexpr auto RTTI = RTTI_BSShaderProperty;
23  inline static constexpr auto Ni_RTTI = NiRTTI_BSShaderProperty;
24  inline static constexpr auto VTABLE = VTABLE_BSShaderProperty;
25 
27  {
28  public:
29  inline static constexpr auto RTTI = RTTI_BSShaderProperty__ForEachVisitor;
30  inline static constexpr auto VTABLE = VTABLE_BSShaderProperty__ForEachVisitor;
31 
32  virtual ~ForEachVisitor(); // 00
33 
34  // add
35  virtual std::uint32_t Accept(NiSourceTexture* a_texture) = 0; // 01
36  };
37 
39  {
41  };
42  static_assert(sizeof(RenderPassArray) == 0x8);
43 
44  enum class EShaderPropertyFlag : std::uint64_t
45  {
46  kSpecular = BIT64 << 0,
47  kSkinned = BIT64 << 1,
48  kTempRefraction = BIT64 << 2,
49  kVertexAlpha = BIT64 << 3,
50  kGrayscaleToPaletteColor = BIT64 << 4,
51  kGrayscaleToPaletteAlpha = BIT64 << 5,
52  kFalloff = BIT64 << 6,
53  kEnvMap = BIT64 << 7,
54  kReceiveShadows = BIT64 << 8,
55  kCastShadows = BIT64 << 9,
56  kFace = BIT64 << 10,
57  kParallax = BIT64 << 11,
58  kModelSpaceNormals = BIT64 << 12,
59  kNonProjectiveShadows = BIT64 << 13,
60  kMultiTextureLandscape = BIT64 << 14,
61  kRefraction = BIT64 << 15,
62  kRefractionFalloff = BIT64 << 16,
63  kEyeReflect = BIT64 << 17,
64  kHairTint = BIT64 << 18,
65  kScreendoorAlphaFade = BIT64 << 19,
66  kLocalMapClear = BIT64 << 20,
67  kFaceGenRGBTint = BIT64 << 21,
68  kOwnEmit = BIT64 << 22,
69  kProjectedUV = BIT64 << 23,
70  kMultipleTextures = BIT64 << 24,
71  kRemappableTextures = BIT64 << 25,
72  kDecal = BIT64 << 26,
73  kDynamicDecal = BIT64 << 27,
74  kParallaxOcclusion = BIT64 << 28,
75  kExternalEmittance = BIT64 << 29,
76  kSoftEffect = BIT64 << 30,
77  kZBufferTest = BIT64 << 31,
78  kZBufferWrite = BIT64 << 32,
79  kLODLandscape = BIT64 << 33,
80  kLODObjects = BIT64 << 34,
81  kNoFade = BIT64 << 35,
82  kTwoSided = BIT64 << 36,
83  kVertexColors = BIT64 << 37,
84  kGlowMap = BIT64 << 38,
85  kAssumeShadowmask = BIT64 << 39,
86  kCharacterLighting = BIT64 << 40,
87  kMultiIndexSnow = BIT64 << 41,
88  kVertexLighting = BIT64 << 42,
89  kUniformScale = BIT64 << 43,
90  kFitSlope = BIT64 << 44,
91  kBillboard = BIT64 << 45,
92  kNoLODLandBlend = BIT64 << 46,
93  kEnvmapLightFade = BIT64 << 47,
94  kWireframe = BIT64 << 48,
95  kWeaponBlood = BIT64 << 49,
96  kHideOnLocalMap = BIT64 << 50,
97  kPremultAlpha = BIT64 << 51,
98  kCloudLOD = BIT64 << 52,
99  kAnisotropicLighting = BIT64 << 53,
100  kNoTransparencyMultiSample = BIT64 << 54,
101  kMenuScreen = BIT64 << 55,
102  kMultiLayerParallax = BIT64 << 56,
103  kSoftLighting = BIT64 << 57,
104  kRimLighting = BIT64 << 58,
105  kBackLighting = BIT64 << 59,
106  kSnow = BIT64 << 60,
107  kTreeAnim = BIT64 << 61,
108  kEffectLighting = BIT64 << 62,
109  kHDLODObjects = BIT64 << 63
110  };
111 
112  enum class EShaderPropertyFlag8 : std::uint8_t
113  {
114  kSpecular = 0,
115  kSkinned = 1,
116  kTempRefraction = 2,
117  kVertexAlpha = 3,
120  kFalloff = 6,
121  kEnvMap = 7,
122  kReceiveShadows = 8,
123  kCastShadows = 9,
124  kFace = 10,
125  kParallax = 11,
126  kModelSpaceNormals = 12,
129  kRefraction = 15,
130  kRefractionFalloff = 16,
131  kEyeReflect = 17,
132  kHairTint = 18,
134  kLocalMapClear = 20,
135  kFaceGenRGBTint = 21,
136  kOwnEmit = 22,
137  kProjectedUV = 23,
138  kMultipleTextures = 24,
139  kRemappableTextures = 25,
140  kDecal = 26,
141  kDynamicDecal = 27,
142  kParallaxOcclusion = 28,
143  kExternalEmittance = 29,
144  kSoftEffect = 30,
145  kZBufferTest = 31,
146  kZBufferWrite = 32,
147  kLODLandscape = 33,
148  kLODObjects = 34,
149  kNoFade = 35,
150  kTwoSided = 36,
151  kVertexColors = 37,
152  kGlowMap = 38,
153  kAssumeShadowmask = 39,
154  kCharacterLighting = 40,
155  kMultiIndexSnow = 41,
156  kVertexLighting = 42,
157  kUniformScale = 43,
158  kFitSlope = 44,
159  kBillboard = 45,
160  kNoLODLandBlend = 46,
161  kEnvmapLightFade = 47,
162  kWireframe = 48,
163  kWeaponBlood = 49,
164  kHideOnLocalMap = 50,
165  kPremultAlpha = 51,
166  kCloudLOD = 52,
169  kMenuScreen = 55,
170  kMultiLayerParallax = 56,
171  kSoftLighting = 57,
172  kRimLighting = 58,
173  kBackLighting = 59,
174  kSnow = 60,
175  kTreeAnim = 61,
176  kEffectLighting = 62,
177  kHDLODObjects = 63
178  };
179 
180  ~BSShaderProperty() override; // 00
181 
182  // override (NiShadeProperty)
183  const NiRTTI* GetRTTI() const override; // 02
184  NiObject* CreateClone(NiCloningProcess& a_cloning) override; // 17 - { return 0; }
185  void LoadBinary(NiStream& a_stream) override; // 18
186  void LinkObject(NiStream& a_stream) override; // 19 - { NiShadeProperty::LinkObject(a_stream); }
187  bool RegisterStreamables(NiStream& a_stream) override; // 1A - { return NiShadeProperty::RegisterStreamables(a_stream); }
188  void SaveBinary(NiStream& a_stream) override; // 1B
189  bool IsEqual(NiObject* a_object) override; // 1C - { return false; }
190  void PostLinkObject(NiStream& a_stream) override; // 1E - { NiObjectNET::PostLinkObject(a_stream); }
191  bool SetupGeometry(BSGeometry* a_geometry) override; // 27 - { return 1; }
192  void Unk_29(void) override; // 29
193 
194  // add
195  virtual RenderPassArray* GetRenderPasses(BSGeometry* a_geometry, std::uint32_t a_arg2, BSShaderAccumulator* a_accumulator) = 0; // 2A
196  virtual void Unk_2B(void); // 2B - { return 0; }
197  virtual void Unk_2C(void); // 2C - { return 0; }
198  virtual void Unk_2D(void); // 2D - { return 0; }
199  virtual void Unk_2E(void); // 2E - { return 1; }
200  virtual void Unk_2F(void); // 2F - { return 0; }
201  virtual bool CanMerge(const BSShaderProperty* a_other); // 30
202  virtual void SetMaterialAlpha(float a_alpha); // 31 - { return; }
203  [[nodiscard]] virtual float QMaterialAlpha(); // 32 - { return 1.0; }
204  virtual std::int32_t ForEachTexture(ForEachVisitor& a_visitor); // 33 - { return 1; }
205  virtual void DoClearRenderPasses(); // 34
206  virtual std::int32_t QShader(); // 35 - { return 0; }
207  virtual void Unk_36(void); // 36 - { return 0; }
208  [[nodiscard]] virtual NiSourceTexture* GetBaseTexture(); // 37 - { return 0; }
209  virtual void Unk_38(void); // 38 - { return 0; }
210  [[nodiscard]] virtual bool AcceptsEffectData() const; // 39 - { return false; }
211  virtual void Unk_3A(void); // 3A - { return; }
212  virtual void Unk_3B(void); // 3B - { return; }
213  virtual void Unk_3C(void); // 3C - { return 0; }
214  virtual std::uint32_t DetermineUtilityShaderDecl(); // 3D - { return 0; }
215  virtual BSShaderMaterial::Type GetMaterialType(); // 3E - { return 0; }
216 
218  void SetMaterial(BSShaderMaterial* a_material, bool a_unk1);
219  void SetFlags(EShaderPropertyFlag8 a_flag, bool a_set);
220  void LinkMaterial(BSShaderMaterial* a_material, bool a_unk1);
221 
222  // members
223  float alpha; // 30
224  std::int32_t lastRenderPassState; // 34
227  std::uint64_t unk48; // 48
229  std::uint64_t unk58; // 58
234  std::uint64_t unk80; // 80
235  };
236  static_assert(sizeof(BSShaderProperty) == 0x88);
237 }
Definition: BSFadeNode.h:11
Definition: BSGeometry.h:15
Definition: BSRenderPass.h:11
Definition: BSShaderMaterial.h:9
Type
Definition: BSShaderMaterial.h:39
Definition: BSShaderPropertyLightData.h:10
Definition: BSShaderProperty.h:27
static constexpr auto VTABLE
Definition: BSShaderProperty.h:30
virtual std::uint32_t Accept(NiSourceTexture *a_texture)=0
static constexpr auto RTTI
Definition: BSShaderProperty.h:29
Definition: BSShaderProperty.h:17
virtual std::int32_t ForEachTexture(ForEachVisitor &a_visitor)
NiObject * CreateClone(NiCloningProcess &a_cloning) override
void LoadBinary(NiStream &a_stream) override
BSTSmartPointer< BSEffectShaderData > effectData
Definition: BSShaderProperty.h:231
RenderPassArray debugRenderPassList
Definition: BSShaderProperty.h:228
float alpha
Definition: BSShaderProperty.h:223
std::int32_t lastRenderPassState
Definition: BSShaderProperty.h:224
virtual std::uint32_t DetermineUtilityShaderDecl()
BSShaderPropertyLightData * lightData
Definition: BSShaderProperty.h:232
virtual void Unk_38(void)
bool SetupGeometry(BSGeometry *a_geometry) override
virtual void SetMaterialAlpha(float a_alpha)
void LinkObject(NiStream &a_stream) override
std::uint64_t unk48
Definition: BSShaderProperty.h:227
void SetFlags(EShaderPropertyFlag8 a_flag, bool a_set)
virtual void Unk_2F(void)
virtual void Unk_3B(void)
const NiRTTI * GetRTTI() const override
EShaderPropertyFlag
Definition: BSShaderProperty.h:45
virtual float QMaterialAlpha()
virtual bool CanMerge(const BSShaderProperty *a_other)
virtual void Unk_3A(void)
REX::EnumSet< EShaderPropertyFlag, std::uint64_t > flags
Definition: BSShaderProperty.h:225
BSFadeNode * fadeNode
Definition: BSShaderProperty.h:230
static constexpr auto RTTI
Definition: BSShaderProperty.h:22
~BSShaderProperty() override
void LinkMaterial(BSShaderMaterial *a_material, bool a_unk1)
void PostLinkObject(NiStream &a_stream) override
virtual void Unk_2C(void)
BSShaderMaterial * material
Definition: BSShaderProperty.h:233
static constexpr auto Ni_RTTI
Definition: BSShaderProperty.h:23
virtual void Unk_3C(void)
RenderPassArray renderPassList
Definition: BSShaderProperty.h:226
virtual BSShaderMaterial::Type GetMaterialType()
std::uint64_t unk80
Definition: BSShaderProperty.h:234
void Unk_29(void) override
void SetEffectShaderData(const BSTSmartPointer< BSEffectShaderData > &a_data)
bool IsEqual(NiObject *a_object) override
virtual void Unk_2B(void)
void SetMaterial(BSShaderMaterial *a_material, bool a_unk1)
void SaveBinary(NiStream &a_stream) override
virtual bool AcceptsEffectData() const
virtual NiSourceTexture * GetBaseTexture()
virtual void Unk_2E(void)
EShaderPropertyFlag8
Definition: BSShaderProperty.h:113
std::uint64_t unk58
Definition: BSShaderProperty.h:229
static constexpr auto VTABLE
Definition: BSShaderProperty.h:24
virtual std::int32_t QShader()
virtual void Unk_2D(void)
bool RegisterStreamables(NiStream &a_stream) override
virtual RenderPassArray * GetRenderPasses(BSGeometry *a_geometry, std::uint32_t a_arg2, BSShaderAccumulator *a_accumulator)=0
virtual void DoClearRenderPasses()
virtual void Unk_36(void)
Definition: BSTSmartPointer.h:37
Definition: NiCloningProcess.h:10
Definition: NiObject.h:37
Definition: NiRTTI.h:6
Definition: NiShadeProperty.h:8
Definition: NiSourceTexture.h:21
Definition: NiStream.h:29
Definition: AbsorbEffect.h:6
constexpr std::array< REL::ID, 1 > VTABLE_BSShaderProperty__ForEachVisitor
Definition: Offsets_VTABLE.h:9837
constexpr std::array< REL::ID, 1 > VTABLE_BSShaderProperty
Definition: Offsets_VTABLE.h:9836
constexpr REL::ID RTTI_BSShaderProperty(static_cast< std::uint64_t >(691873))
constexpr REL::ID NiRTTI_BSShaderProperty(static_cast< std::uint64_t >(527634))
constexpr REL::ID RTTI_BSShaderProperty__ForEachVisitor(static_cast< std::uint64_t >(684927))
Definition: BSShaderProperty.h:39
BSRenderPass * head
Definition: BSShaderProperty.h:40