diff --git a/src/Features/WaterLighting.cpp b/src/Features/WaterLighting.cpp new file mode 100644 index 000000000..7f8d208c5 --- /dev/null +++ b/src/Features/WaterLighting.cpp @@ -0,0 +1,25 @@ +#include "WaterLighting.h" + +#include "State.h" +#include "Util.h" + +#include + +void WaterLighting::SetupResources() +{ + auto& device = State::GetSingleton()->device; + auto& context = State::GetSingleton()->context; + + DirectX::CreateDDSTextureFromFile(device, context, L"Data\\Shaders\\WaterLighting\\WaterLighting.dds", nullptr, &causticsView); +} + +void WaterLighting::Prepass() +{ + auto& context = State::GetSingleton()->context; + context->PSSetShaderResources(70, 1, &causticsView); +} + +bool WaterLighting::HasShaderDefine(RE::BSShader::Type) +{ + return true; +} diff --git a/src/Features/WaterLighting.h b/src/Features/WaterLighting.h new file mode 100644 index 000000000..e64bac221 --- /dev/null +++ b/src/Features/WaterLighting.h @@ -0,0 +1,27 @@ +#pragma once + +#include "Feature.h" + +struct WaterLighting : Feature +{ +public: + static WaterLighting* GetSingleton() + { + static WaterLighting singleton; + return &singleton; + } + + ID3D11ShaderResourceView* causticsView; + + virtual inline std::string GetName() override { return "Water Lighting"; } + virtual inline std::string GetShortName() override { return "WaterLighting"; } + virtual inline std::string_view GetShaderDefineName() override { return "WATER_LIGHTING"; } + + bool HasShaderDefine(RE::BSShader::Type shaderType) override; + + virtual void SetupResources() override; + + virtual void Prepass() override; + + virtual bool SupportsVR() override { return true; }; +};