Skip to content

Commit

Permalink
refactor: move LightingData into common
Browse files Browse the repository at this point in the history
  • Loading branch information
FlayaN committed Feb 7, 2024
1 parent 28c69b0 commit d910e7f
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,14 +1,7 @@
#include "Common/Color.hlsl"
#include "Common/FrameBuffer.hlsl"
#include "Common/MotionBlur.hlsl"

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

StructuredBuffer<LightingData> lightingData : register(t126);
#include "Common/LightingData.hlsl"

#define GRASS

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,14 +1,7 @@
#include "Common/Color.hlsl"
#include "Common/FrameBuffer.hlsl"
#include "Common/MotionBlur.hlsl"

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

StructuredBuffer<LightingData> lightingData : register(t126);
#include "Common/LightingData.hlsl"

cbuffer PerFrame : register(b3)
{
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
Expand Up @@ -2,17 +2,10 @@
#include "Common/FrameBuffer.hlsl"
#include "Common/MotionBlur.hlsl"
#include "Common/Permutation.hlsl"
#include "Common/LightingData.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 d910e7f

Please sign in to comment.