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
2 changes: 1 addition & 1 deletion extern/CommonLibSSE-NG
Submodule CommonLibSSE-NG updated 363 files
4 changes: 2 additions & 2 deletions src/Features/ExtendedTranslucency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ void ExtendedTranslucency::BSLightingShader_SetupGeometry(RE::BSRenderPass* pass
// Clear the ExtraFeatureDescriptor to disable this effect on default
SetFeatureDescriptor(MaterialModel::DescriptorDisabled);

auto& property0 = pass->geometry->GetGeometryRuntimeData().properties[0];
auto& property1 = pass->geometry->GetGeometryRuntimeData().properties[1];
auto& property0 = pass->geometry->GetGeometryRuntimeData().alphaProperty;
auto& property1 = pass->geometry->GetGeometryRuntimeData().shaderProperty;
auto alphaProperty = property0 && property0->GetRTTI() == globals::rtti::NiAlphaPropertyRTTI.get() ? static_cast<RE::NiAlphaProperty*>(property0.get()) : nullptr;
auto lightProperty = property1 && property1->GetRTTI() == globals::rtti::BSLightingShaderPropertyRTTI.get() ? static_cast<RE::BSLightingShaderProperty*>(property1.get()) : nullptr;

Expand Down
2 changes: 1 addition & 1 deletion src/Features/GrassCollision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void GrassCollision::UpdateCollisions(PerFrame& perFrameData)
actors.push_back(&processLists->highActorHandles); // High actors are in combat or doing something interesting
for (auto array : actors) {
for (auto& actorHandle : *array) {
auto actorPtr = actorHandle.getsafe();
auto actorPtr = actorHandle.get();
if (actorPtr && actorPtr.get() && actorPtr->Is3DLoaded()) {
actorList.push_back(actorPtr);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Features/LinearLighting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ RE::NiColor LinearLighting::ColorToLinear(RE::NiColor inColor, float gamma)

void LinearLighting::BSLightingShader_SetupGeometry(RE::BSRenderPass* a_pass)
{
auto& property1 = a_pass->geometry->GetGeometryRuntimeData().properties[1];
auto& property1 = a_pass->geometry->GetGeometryRuntimeData().shaderProperty;
auto lightProperty = property1 && property1->GetRTTI() == globals::rtti::BSLightingShaderPropertyRTTI.get() ? static_cast<RE::BSLightingShaderProperty*>(property1.get()) : nullptr;

if (lightProperty != nullptr) {
Expand Down
4 changes: 2 additions & 2 deletions src/Features/SkySync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ inline float SkySync::CalculateVisibility(const RE::NiPoint3& dir, const float d

inline void SkySync::SetSunBaseVisibility(const RE::Sun* sun, const float visibility)
{
if (const auto property = skyrim_cast<RE::BSSkyShaderProperty*>(sun->sunBase->GetGeometryRuntimeData().properties[1].get()))
if (const auto property = skyrim_cast<RE::BSSkyShaderProperty*>(sun->sunBase->GetGeometryRuntimeData().shaderProperty.get()))
property->kBlendColor.alpha = visibility;
}

Expand Down Expand Up @@ -489,7 +489,7 @@ void SkySync::Moon_Update::thunk(RE::Moon* moon, RE::Sky* sky)
if (auto& singleton = globals::features::skySync; singleton.settings.Enabled && updateMoonTexture != moon->updateMoonTexture) {
// Gets the texture name of the current moon phase when it changes rather than reading direct global variables
// Allows for compatability with other mods that don't directly update the in-game phase values
const auto moonShaderProperty = skyrim_cast<RE::BSSkyShaderProperty*>(moon->moonMesh->GetGeometryRuntimeData().properties[1].get());
const auto moonShaderProperty = skyrim_cast<RE::BSSkyShaderProperty*>(moon->moonMesh->GetGeometryRuntimeData().shaderProperty.get());

const auto name = moonShaderProperty->GetBaseTexture()->name.c_str();
const size_t len = std::strlen(name);
Expand Down
10 changes: 5 additions & 5 deletions src/Features/Skylighting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ enum class ShaderTechnique

//////////////////////////////////////////////////////////////

RE::BSLightingShaderProperty::Data* Skylighting::BSLightingShaderProperty_GetPrecipitationOcclusionMapRenderPassesImpl::thunk(
RE::BSShaderProperty::RenderPassArray* Skylighting::BSLightingShaderProperty_GetPrecipitationOcclusionMapRenderPassesImpl::thunk(
RE::BSLightingShaderProperty* property,
RE::BSGeometry* geometry,
[[maybe_unused]] uint32_t renderMode,
Expand All @@ -361,7 +361,7 @@ RE::BSLightingShaderProperty::Data* Skylighting::BSLightingShaderProperty_GetPre
using enum RE::BSShaderProperty::EShaderPropertyFlag;
using enum RE::BSUtilityShader::Flags;

auto* precipitationOcclusionMapRenderPassList = &property->unk0C8;
auto* precipitationOcclusionMapRenderPassList = &property->occlusionPasses;

precipitationOcclusionMapRenderPassList->Clear();
if (skylighting.inOcclusion) {
Expand Down Expand Up @@ -420,7 +420,7 @@ RE::BSLightingShaderProperty::Data* Skylighting::BSLightingShaderProperty_GetPre
technique.set(Vc);
}

const auto alphaProperty = static_cast<RE::NiAlphaProperty*>(geometry->GetGeometryRuntimeData().properties[0].get());
const auto alphaProperty = static_cast<RE::NiAlphaProperty*>(geometry->GetGeometryRuntimeData().alphaProperty.get());
if (alphaProperty && alphaProperty->GetAlphaTesting()) {
technique.set(Texture);
technique.set(AlphaTest);
Expand Down Expand Up @@ -511,8 +511,8 @@ void Skylighting::RenderOcclusion()
}
if (precipObject) {
precip->SetupMask();
auto effect = precipObject->GetGeometryRuntimeData().properties[RE::BSGeometry::States::kEffect];
auto shaderProp = netimmerse_cast<RE::BSShaderProperty*>(effect.get());
auto& effect = precipObject->GetGeometryRuntimeData().shaderProperty;
auto shaderProp = effect.get();
auto particleShaderProperty = netimmerse_cast<RE::BSParticleShaderProperty*>(shaderProp);
auto rain = (RE::BSParticleShaderRainEmitter*)(particleShaderProperty->particleEmitter);

Expand Down
2 changes: 1 addition & 1 deletion src/Features/Skylighting.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ struct Skylighting : Feature
// Hooks
struct BSLightingShaderProperty_GetPrecipitationOcclusionMapRenderPassesImpl
{
static RE::BSLightingShaderProperty::Data* thunk(RE::BSLightingShaderProperty* property, RE::BSGeometry* geometry, uint32_t renderMode, RE::BSGraphics::BSShaderAccumulator* accumulator);
static RE::BSShaderProperty::RenderPassArray* thunk(RE::BSLightingShaderProperty* property, RE::BSGeometry* geometry, uint32_t renderMode, RE::BSGraphics::BSShaderAccumulator* accumulator);
static inline REL::Relocation<decltype(thunk)> func;
};

Expand Down
2 changes: 1 addition & 1 deletion src/Features/TerrainHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ bool TerrainHelper::TESObjectLAND_SetupMaterial(RE::TESObjectLAND* land)
const auto& children = land->loadedData->mesh[quadI]->GetChildren();
auto geometry = children.empty() ? nullptr : static_cast<RE::BSGeometry*>(children[0].get());
if (geometry != nullptr) {
const auto shaderProp = static_cast<RE::BSLightingShaderProperty*>(geometry->GetGeometryRuntimeData().properties[1].get());
const auto shaderProp = static_cast<RE::BSLightingShaderProperty*>(geometry->GetGeometryRuntimeData().shaderProperty.get());
if (shaderProp != nullptr) {
hashKey = shaderProp->GetBaseMaterial()->hashKey;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Features/UnifiedWater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ void UnifiedWater::BGSTerrainBlock_Attach::thunk(RE::BGSTerrainBlock* block)
for (auto& [shape, instruction] : built) {
waterSystem->AddWater(shape, instruction->form.ptr, instruction->waterHeight, nullptr, true, false);

if (const auto prop = shape->GetGeometryRuntimeData().properties[1].get(); prop && prop->GetRTTI() == globals::rtti::BSWaterShaderPropertyRTTI.get()) {
if (const auto prop = shape->GetGeometryRuntimeData().shaderProperty.get(); prop && prop->GetRTTI() == globals::rtti::BSWaterShaderPropertyRTTI.get()) {
const auto waterShaderProp = static_cast<RE::BSWaterShaderProperty*>(prop);
REX::EnumSet waterFlags = static_cast<RE::BSWaterShaderProperty::WaterFlag>(0b10000100);
waterFlags |= RE::BSWaterShaderProperty::WaterFlag::kUseCubemapReflections;
Expand Down Expand Up @@ -464,7 +464,7 @@ void UnifiedWater::BSWaterShader_SetupGeometry::thunk(RE::BSShader* waterShader,
singleton.gDisplacementMeshFlowCellOffset->x = static_cast<float>(singleton.flowmap->GetHeight()); // ObjectUV.y
singleton.gDisplacementMeshFlowCellOffset->y = 1.0f - pass->geometry->local.scale; // ObjectUV.z (counters 1 - x in SetupGeometry)

if (const auto prop = pass->geometry->GetGeometryRuntimeData().properties[1].get(); prop && prop->GetRTTI() == globals::rtti::BSWaterShaderPropertyRTTI.get()) {
if (const auto prop = pass->geometry->GetGeometryRuntimeData().shaderProperty.get(); prop && prop->GetRTTI() == globals::rtti::BSWaterShaderPropertyRTTI.get()) {
const auto waterShaderProp = static_cast<RE::BSWaterShaderProperty*>(prop);
int32_t x, y;
Util::WorldToCell(pass->geometry->world.translate, x, y);
Expand Down
8 changes: 4 additions & 4 deletions src/Features/WetnessEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,8 @@ float WetnessEffects::GetRainIntensity(RE::NiPointer<RE::BSGeometry> precipObjec
return 0.0f;
}

auto& effect = precipObject->GetGeometryRuntimeData().properties[RE::BSGeometry::States::kEffect];
auto shaderProp = netimmerse_cast<RE::BSShaderProperty*>(effect.get());
auto& effect = precipObject->GetGeometryRuntimeData().shaderProperty;
auto shaderProp = effect.get();
auto particleShaderProperty = netimmerse_cast<RE::BSParticleShaderProperty*>(shaderProp);

if (!particleShaderProperty || !particleShaderProperty->particleEmitter) {
Expand Down Expand Up @@ -713,8 +713,8 @@ WetnessEffects::PerFrame WetnessEffects::GetCommonBufferData() const
precipObject = precip->lastPrecip;
}
if (precipObject) {
auto& effect = precipObject->GetGeometryRuntimeData().properties[RE::BSGeometry::States::kEffect];
auto shaderProp = netimmerse_cast<RE::BSShaderProperty*>(effect.get());
auto& effect = precipObject->GetGeometryRuntimeData().shaderProperty;
auto shaderProp = effect.get();
auto particleShaderProperty = netimmerse_cast<RE::BSParticleShaderProperty*>(shaderProp);
auto rain = (RE::BSParticleShaderRainEmitter*)(particleShaderProperty->particleEmitter);
data.OcclusionViewProj = rain->occlusionProjection;
Expand Down
2 changes: 1 addition & 1 deletion src/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ namespace GrassExtensions

state->permutationData.ExtraShaderDescriptor &= ~static_cast<uint32_t>(State::ExtraShaderDescriptors::GrassSphereNormal);

if (auto* shaderProperty = static_cast<RE::BSShaderProperty*>(pass->geometry->GetGeometryRuntimeData().properties[1].get())) {
if (auto* shaderProperty = static_cast<RE::BSShaderProperty*>(pass->geometry->GetGeometryRuntimeData().shaderProperty.get())) {
if (shaderProperty->flags.any(RE::BSShaderProperty::EShaderPropertyFlag::kEffectLighting)) {
state->permutationData.ExtraShaderDescriptor |= static_cast<uint32_t>(State::ExtraShaderDescriptors::GrassSphereNormal);
}
Expand Down
4 changes: 2 additions & 2 deletions src/ShaderCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ namespace SIE
std::unique_ptr<RE::BSGraphics::VertexShader> newShader{ shaderPtr };
newShader->byteCodeSize = (uint32_t)shaderData.GetBufferSize();
newShader->id = descriptor;
newShader->shaderDesc = 0;
newShader->vertexDesc = 0;

winrt::com_ptr<ID3D11ShaderReflection> reflector;
const auto reflectionResult = D3DReflect(shaderData.GetBufferPointer(), shaderData.GetBufferSize(),
Expand All @@ -1511,7 +1511,7 @@ namespace SIE
} else {
std::array<size_t, 3> bufferSizes = { 0, 0, 0 };
std::fill(newShader->constantTable.begin(), newShader->constantTable.end(), static_cast<uint8_t>(0));
ReflectConstantBuffers(*reflector.get(), bufferSizes, newShader->constantTable, newShader->shaderDesc,
ReflectConstantBuffers(*reflector.get(), bufferSizes, newShader->constantTable, newShader->vertexDesc,
ShaderClass::Vertex, descriptor, shader);
if (bufferSizes[0] != 0) {
newShader->constantBuffers[0].buffer =
Expand Down
18 changes: 9 additions & 9 deletions src/TruePBR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ struct BSLightingShaderProperty_LoadBinary
} else {
material = RE::BSLightingShaderMaterialBase::CreateMaterial(feature);
}
property->LinkMaterial(nullptr, false);
property->SetMaterial(nullptr, false);
property->material = material;
}

Expand Down Expand Up @@ -1162,7 +1162,7 @@ bool TruePBR::TESObjectLAND_SetupMaterial(RE::TESObjectLAND* land)

{
BSLightingShaderMaterialPBRLandscape srcMaterial;
shaderProperty->LinkMaterial(&srcMaterial, true);
shaderProperty->SetMaterial(&srcMaterial, true);
}

auto material = static_cast<BSLightingShaderMaterialPBRLandscape*>(shaderProperty->material);
Expand Down Expand Up @@ -1212,7 +1212,7 @@ bool TruePBR::TESObjectLAND_SetupMaterial(RE::TESObjectLAND* land)
auto geometry = children.empty() ? nullptr : static_cast<RE::BSGeometry*>(children[0].get());
shaderProperty->SetupGeometry(geometry);
if (geometry != nullptr) {
geometry->GetGeometryRuntimeData().properties[1] = RE::NiPointer(shaderProperty);
geometry->GetGeometryRuntimeData().shaderProperty = RE::NiPointer(shaderProperty);
}

globals::game::smState->shadowSceneNode[0]->AttachObject(geometry);
Expand Down Expand Up @@ -1255,12 +1255,12 @@ struct BSTempEffectSimpleDecal_SetupGeometry
{
func(decal, geometry, textureSet, blended);
auto* singleton = globals::truePBR;
auto unknownProperty = geometry->GetGeometryRuntimeData().properties[1].get();
auto unknownProperty = geometry->GetGeometryRuntimeData().shaderProperty.get();
if (auto shaderProperty = unknownProperty->GetRTTI() == globals::rtti::BSLightingShaderPropertyRTTI.get() ? static_cast<RE::BSLightingShaderProperty*>(unknownProperty) : nullptr;
shaderProperty != nullptr && singleton->IsPBRTextureSet(textureSet)) {
{
BSLightingShaderMaterialPBR srcMaterial;
shaderProperty->LinkMaterial(&srcMaterial, true);
shaderProperty->SetMaterial(&srcMaterial, true);
}

auto pbrMaterial = static_cast<BSLightingShaderMaterialPBR*>(shaderProperty->material);
Expand Down Expand Up @@ -1299,7 +1299,7 @@ struct BSTempEffectGeometryDecal_Initialize

{
BSLightingShaderMaterialPBR srcMaterial;
shaderProperty->LinkMaterial(&srcMaterial, true);
shaderProperty->SetMaterial(&srcMaterial, true);
}

auto pbrMaterial = static_cast<BSLightingShaderMaterialPBR*>(shaderProperty->material);
Expand All @@ -1321,12 +1321,12 @@ struct BSTempEffectGeometryDecal_Initialize
shaderProperty->SetFlags(kVertexLighting, true);
}

if (auto* alphaProperty = static_cast<RE::NiAlphaProperty*>(decal->decal->GetGeometryRuntimeData().properties[0].get())) {
if (auto* alphaProperty = static_cast<RE::NiAlphaProperty*>(decal->decal->GetGeometryRuntimeData().alphaProperty.get())) {
alphaProperty->alphaFlags = (alphaProperty->alphaFlags & ~0x1FE) | 0xED;
}

shaderProperty->SetupGeometry(decal->decal.get());
decal->decal->GetGeometryRuntimeData().properties[1] = RE::NiPointer(shaderProperty);
decal->decal->GetGeometryRuntimeData().shaderProperty = RE::NiPointer(shaderProperty);
}
}
static inline REL::Relocation<decltype(thunk)> func;
Expand All @@ -1343,7 +1343,7 @@ struct TESBoundObject_Clone3D
if (stat->data.materialObj != nullptr && stat->data.materialObj->directionalData.singlePass) {
if (auto* pbrData = truePBR->GetPBRMaterialObjectData(stat->data.materialObj)) {
RE::BSVisit::TraverseScenegraphGeometries(result, [pbrData](RE::BSGeometry* geometry) {
if (auto* shaderProperty = static_cast<RE::BSShaderProperty*>(geometry->GetGeometryRuntimeData().properties[1].get())) {
if (auto* shaderProperty = static_cast<RE::BSShaderProperty*>(geometry->GetGeometryRuntimeData().shaderProperty.get())) {
if (shaderProperty->GetMaterialType() == RE::BSShaderMaterial::Type::kLighting &&
shaderProperty->flags.any(RE::BSShaderProperty::EShaderPropertyFlag::kVertexLighting)) {
if (auto* material = static_cast<BSLightingShaderMaterialPBR*>(shaderProperty->material)) {
Expand Down
5 changes: 3 additions & 2 deletions src/Utils/GameSetting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,14 @@ namespace Util
case RE::Setting::Type::kFloat:
RenderImGuiElement(settingName, settingData, &setting->data.f, collectionName);
break;
case RE::Setting::Type::kSignedInteger:
case RE::Setting::Type::kInteger:
RenderImGuiElement(settingName, settingData, &setting->data.i, collectionName);
break;
case RE::Setting::Type::kUnsignedInteger:
RenderImGuiElement(settingName, settingData, &setting->data.u, collectionName);
break;
case RE::Setting::Type::kColor:
case RE::Setting::Type::kColorRGB:
case RE::Setting::Type::kColorRGBA:
case RE::Setting::Type::kString:
case RE::Setting::Type::kUnknown:
default:
Expand Down
Loading