mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-23 20:05:11 +00:00
5a3954ae0e
Fixes several files incorrectly stated a different license from the actual project, as well as the copyright headers included in all files. This change has no effect on the licensing terms, it should clear up a bit of confusion by contributors. Plus the files get a bit smaller, and we have less duplicated information across the entire project. Overall the project is GPLv2 if not built with Qt, and GPLv3 if it is built with Qt. There are no parts licensed under a different license, all have been adapted from other compatible licenses into GPLv2 or GPLv3.
117 lines
2.9 KiB
Text
117 lines
2.9 KiB
Text
// AUTOGENERATED COPYRIGHT HEADER START
|
|
// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
|
// AUTOGENERATED COPYRIGHT HEADER END
|
|
|
|
// --------------------------------------------------------------------------------
|
|
// Uniforms set by libobs
|
|
uniform float4x4 ViewProj<
|
|
bool automatic = true;
|
|
>;
|
|
|
|
// --------------------------------------------------------------------------------
|
|
// Uniforms set by StreamFX
|
|
uniform float4 Time<
|
|
bool automatic = true;
|
|
>;
|
|
uniform float4 ViewSize<
|
|
bool automatic = true;
|
|
>;
|
|
|
|
// Filters, Transitions
|
|
uniform texture2d InputA<
|
|
bool automatic = true;
|
|
>;
|
|
|
|
// Transitions
|
|
uniform texture2d InputB<
|
|
bool automatic = true;
|
|
>;
|
|
uniform float TransitionTime<
|
|
bool automatic = true;
|
|
>;
|
|
|
|
// --------------------------------------------------------------------------------
|
|
// Parameters
|
|
uniform bool BoolParameter = false;
|
|
uniform float FloatParameter<
|
|
string name = "Float Parameter";
|
|
string description = "This is a 32-bit floating point value.";
|
|
string field_type = "input";
|
|
string suffix = " %";
|
|
float minimum = -100.;
|
|
float maximum = 100.;
|
|
float step = .5;
|
|
float scale = .01;
|
|
> = 0.;
|
|
uniform float2 Float2Parameter<
|
|
string name = "Float2 Parameter";
|
|
string description = "This is a 32-bit floating point value.";
|
|
string field_type = "input";
|
|
string suffix = " %";
|
|
float2 minimum = {-100., -100.};
|
|
float2 maximum = {100., 100.};
|
|
float2 step = {.5, .5};
|
|
float2 scale = {.01, .01};
|
|
> = {0., 0.};
|
|
uniform float3 Float3Parameter = {0., 0., 0.};
|
|
uniform float4 Float4Parameter = {0., 0., 0., 0.};
|
|
uniform int IntParameter<
|
|
string name = "Enum Parameter";
|
|
string description = "This parameter is an enumeration";
|
|
string field_type = "enum";
|
|
// Enumeration
|
|
int enum = 4;
|
|
int enum_0 = 0;
|
|
string enum_0_name = "Null";
|
|
int enum_1 = 1;
|
|
string enum_1_name = "One";
|
|
int enum_2 = 2;
|
|
string enum_2_name = "Two";
|
|
int enum_3 = 4;
|
|
string enum_3_name = "Four";
|
|
> = 0;
|
|
uniform int2 Int2Parameter = {0, 0};
|
|
uniform int3 Int3Parameter = {0, 0, 0};
|
|
uniform int4 Int4Parameter = {0, 0, 0, 0};
|
|
|
|
// --------------------------------------------------------------------------------
|
|
// Vertex Processing
|
|
struct VertexData {
|
|
float4 pos : POSITION;
|
|
float2 uv : TEXCOORD0;
|
|
};
|
|
|
|
VertexData VSDefault(VertexData vtx) {
|
|
vtx.pos = mul(float4(vtx.pos.xyz, 1.), ViewProj);
|
|
return vtx;
|
|
};
|
|
|
|
// --------------------------------------------------------------------------------
|
|
// Default Technique
|
|
float4 PSDefault(VertexData vtx) : TARGET {
|
|
if (BoolParameter)
|
|
vtx.uv += 1.;
|
|
vtx.uv += FloatParameter;
|
|
vtx.uv += Float2Parameter;
|
|
vtx.uv += Float3Parameter.xy * Float3Parameter.zz;
|
|
vtx.uv += Float4Parameter.xy * Float4Parameter.zz;
|
|
|
|
if (IntParameter == 1) {
|
|
return float4(1., 0., 0., 1.);
|
|
} else if (IntParameter == 2) {
|
|
return float4(0., 1., 0., 1.);
|
|
} else if (IntParameter == 4) {
|
|
return float4(0., 0., 1., 1.);
|
|
}
|
|
|
|
return float4(0., 0., 0., 1.);
|
|
}
|
|
|
|
technique Draw
|
|
{
|
|
pass
|
|
{
|
|
vertex_shader = VSDefault(vtx);
|
|
pixel_shader = PSDefault(vtx);
|
|
}
|
|
}
|