effects: Add generic shared header with common code

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2021-02-02 22:23:10 +01:00
parent 2d878fcb59
commit a027a57d09
2 changed files with 55 additions and 0 deletions

View file

@ -970,6 +970,7 @@ list(APPEND PROJECT_DATA
"data/effects/color-conversion.effect"
"data/effects/mipgen.effect"
"data/effects/pack-unpack.effect"
"data/effects/shared.effect"
"data/locale/en-US.ini"
)
list(APPEND PROJECT_INCLUDE_DIRS

View file

@ -0,0 +1,54 @@
//------------------------------------------------------------------------------
// Uniforms
//------------------------------------------------------------------------------
// View Projection Matrix
uniform float4x4 ViewProj;
//------------------------------------------------------------------------------
// Samplers
//------------------------------------------------------------------------------
sampler_state PointRepeatSampler {
Filter = Point;
AddressU = Repeat;
AddressV = Repeat;
};
sampler_state PointClampSampler {
Filter = Point;
AddressU = Clamp;
AddressV = Clamp;
};
sampler_state LinearRepeatSampler {
Filter = Linear;
AddressU = Repeat;
AddressV = Repeat;
};
sampler_state LinearClampSampler {
Filter = Linear;
AddressU = Clamp;
AddressV = Clamp;
};
//------------------------------------------------------------------------------
// Structures
//------------------------------------------------------------------------------
struct VertexData {
float4 pos : POSITION;
float2 uv : TEXCOORD0;
};
//------------------------------------------------------------------------------
// Vertex Shaders
//------------------------------------------------------------------------------
VertexData DefaultVertexShader(VertexData vtx) {
vtx.pos = mul(float4(vtx.pos.xyz, 1.0), ViewProj);
return vtx;
};
//------------------------------------------------------------------------------
// Color Conversion
//------------------------------------------------------------------------------