2023-02-28 01:15:26 +00:00
|
|
|
// AUTOGENERATED COPYRIGHT HEADER START
|
|
|
|
// Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
|
|
|
// AUTOGENERATED COPYRIGHT HEADER END
|
|
|
|
|
2021-04-12 13:43:51 +00:00
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
// 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.
|
2023-07-21 22:18:32 +00:00
|
|
|
#define m_log10(x) (log(x) / log(10.))
|
2021-04-12 13:43:51 +00:00
|
|
|
|
2021-02-02 21:23:10 +00:00
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
// Uniforms
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// View Projection Matrix
|
|
|
|
uniform float4x4 ViewProj;
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
// Samplers
|
|
|
|
//------------------------------------------------------------------------------
|
2021-10-06 00:05:46 +00:00
|
|
|
sampler_state BlankSampler {
|
|
|
|
};
|
|
|
|
|
2021-02-02 21:23:10 +00:00
|
|
|
sampler_state PointRepeatSampler {
|
2021-09-07 00:58:17 +00:00
|
|
|
Filter = Point;
|
|
|
|
AddressU = Repeat;
|
|
|
|
AddressV = Repeat;
|
2021-02-02 21:23:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
sampler_state PointClampSampler {
|
2021-09-07 00:58:17 +00:00
|
|
|
Filter = Point;
|
|
|
|
AddressU = Clamp;
|
|
|
|
AddressV = Clamp;
|
2021-02-02 21:23:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
sampler_state LinearRepeatSampler {
|
2021-09-07 00:58:17 +00:00
|
|
|
Filter = Linear;
|
|
|
|
AddressU = Repeat;
|
|
|
|
AddressV = Repeat;
|
2021-02-02 21:23:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
sampler_state LinearClampSampler {
|
2021-09-07 00:58:17 +00:00
|
|
|
Filter = Linear;
|
|
|
|
AddressU = Clamp;
|
|
|
|
AddressV = Clamp;
|
2021-02-02 21:23:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
// Structures
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
struct VertexData {
|
|
|
|
float4 pos : POSITION;
|
|
|
|
float2 uv : TEXCOORD0;
|
|
|
|
};
|
2021-11-07 13:43:09 +00:00
|
|
|
|
2021-10-29 07:13:58 +00:00
|
|
|
struct VertexColorData {
|
|
|
|
float4 pos : POSITION;
|
|
|
|
float4 clr : COLOR;
|
|
|
|
float2 uv : TEXCOORD0;
|
|
|
|
};
|
2021-02-02 21:23:10 +00:00
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
// Vertex Shaders
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
VertexData DefaultVertexShader(VertexData vtx) {
|
|
|
|
vtx.pos = mul(float4(vtx.pos.xyz, 1.0), ViewProj);
|
|
|
|
return vtx;
|
|
|
|
};
|
2021-11-07 13:43:09 +00:00
|
|
|
|
2021-10-29 07:13:58 +00:00
|
|
|
VertexColorData ColorVertexShader(VertexColorData vtx) {
|
|
|
|
vtx.pos = mul(float4(vtx.pos.xyz, 1.0), ViewProj);
|
|
|
|
return vtx;
|
|
|
|
};
|
2021-02-02 21:23:10 +00:00
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
// Color Conversion
|
|
|
|
//------------------------------------------------------------------------------
|
2021-02-02 21:22:47 +00:00
|
|
|
#include "color_conversion_rgb_yuv.effect"
|
|
|
|
#include "color_conversion_rgb_hsv.effect"
|
|
|
|
#include "color_conversion_rgb_hsl.effect"
|