obs-StreamFX/data/effects/shared.effect

65 lines
2 KiB
Text
Raw Normal View History

//------------------------------------------------------------------------------
// HLSL/GLSL Support
//------------------------------------------------------------------------------
// OBS Studio does not correctly translate all HLSL functionality to GLSL.
// log10(x) is HLSL-exclusive and not translated by OBS Shader Parser.
#define m_log10(x) (log(x) / log(10))
//------------------------------------------------------------------------------
// Uniforms
//------------------------------------------------------------------------------
// View Projection Matrix
uniform float4x4 ViewProj;
//------------------------------------------------------------------------------
// Samplers
//------------------------------------------------------------------------------
sampler_state PointRepeatSampler {
2021-09-07 00:58:17 +00:00
Filter = Point;
AddressU = Repeat;
AddressV = Repeat;
};
sampler_state PointClampSampler {
2021-09-07 00:58:17 +00:00
Filter = Point;
AddressU = Clamp;
AddressV = Clamp;
};
sampler_state LinearRepeatSampler {
2021-09-07 00:58:17 +00:00
Filter = Linear;
AddressU = Repeat;
AddressV = Repeat;
};
sampler_state LinearClampSampler {
2021-09-07 00:58:17 +00:00
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
//------------------------------------------------------------------------------
#include "color_conversion_rgb_yuv.effect"
#include "color_conversion_rgb_hsv.effect"
#include "color_conversion_rgb_hsl.effect"