Skip to content

Commit

Permalink
refactor: move LightingData into common (#174)
Browse files Browse the repository at this point in the history
* refactor: move LightingData into common
fix #171

* style: 🎨 apply clang-format changes

* style: add endline

---------

Co-authored-by: FlayaN <[email protected]>
  • Loading branch information
FlayaN and FlayaN authored Feb 8, 2024
1 parent 28c69b0 commit f622afe
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 24 deletions.
9 changes: 1 addition & 8 deletions features/Grass Lighting/Shaders/RunGrass.hlsl
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
#include "Common/Color.hlsl"
#include "Common/FrameBuffer.hlsl"
#include "Common/LightingData.hlsl"
#include "Common/MotionBlur.hlsl"

struct LightingData
{
float WaterHeight[25];
bool Reflections;
};

StructuredBuffer<LightingData> lightingData : register(t126);

#define GRASS

struct VS_INPUT
Expand Down
9 changes: 1 addition & 8 deletions features/Tree LOD Lighting/Shaders/DistantTree.hlsl
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
#include "Common/Color.hlsl"
#include "Common/FrameBuffer.hlsl"
#include "Common/LightingData.hlsl"
#include "Common/MotionBlur.hlsl"

struct LightingData
{
float WaterHeight[25];
bool Reflections;
};

StructuredBuffer<LightingData> lightingData : register(t126);

cbuffer PerFrame : register(b3)
{
row_major float3x4 DirectionalAmbient;
Expand Down
7 changes: 7 additions & 0 deletions package/Shaders/Common/LightingData.hlsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
struct LightingData
{
float WaterHeight[25];
bool Reflections;
};

StructuredBuffer<LightingData> lightingData : register(t126);
9 changes: 1 addition & 8 deletions package/Shaders/Lighting.hlsl
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
#include "Common/Color.hlsl"
#include "Common/FrameBuffer.hlsl"
#include "Common/LightingData.hlsl"
#include "Common/MotionBlur.hlsl"
#include "Common/Permutation.hlsl"

#define PI 3.1415927

struct LightingData
{
float WaterHeight[25];
bool Reflections;
};

StructuredBuffer<LightingData> lightingData : register(t126);

#if (defined(TREE_ANIM) || defined(LANDSCAPE)) && !defined(VC)
# define VC
#endif // TREE_ANIM || LANDSCAPE || !VC
Expand Down

0 comments on commit f622afe

Please sign in to comment.