mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-10 22:05:06 +00:00
effects: Add generic shared header with common code
This commit is contained in:
parent
2d878fcb59
commit
a027a57d09
2 changed files with 55 additions and 0 deletions
|
@ -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
|
||||
|
|
54
data/effects/shared.effect
Normal file
54
data/effects/shared.effect
Normal 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
|
||||
//------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in a new issue