Skip to content

Commit

Permalink
Merge branch 'dev' into dev-tracy
Browse files Browse the repository at this point in the history
  • Loading branch information
Pentalimbed committed Aug 3, 2024
2 parents 930cc9b + e69d1af commit a5b2ebb
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/Features/WaterLighting.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include "WaterLighting.h"

#include "State.h"
#include "Util.h"

#include <DDSTextureLoader.h>

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;
}
27 changes: 27 additions & 0 deletions src/Features/WaterLighting.h
Original file line number Diff line number Diff line change
@@ -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; };
};

0 comments on commit a5b2ebb

Please sign in to comment.