mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-12-29 11:01:23 +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.
129 lines
2.9 KiB
Text
129 lines
2.9 KiB
Text
// AUTOGENERATED COPYRIGHT HEADER START
|
|
// Copyright (C) 2021-2023 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
|
// AUTOGENERATED COPYRIGHT HEADER END
|
|
|
|
#include "shared.effect"
|
|
|
|
uniform texture2d InputA<
|
|
bool automatic = true;
|
|
>;
|
|
|
|
uniform texture2d InputB<
|
|
bool automatic = true;
|
|
>;
|
|
|
|
//------------------------------------------------------------------------------
|
|
// Technique: Texture
|
|
//------------------------------------------------------------------------------
|
|
// Parameters:
|
|
// - InputA: RGBA Texture
|
|
|
|
float4 PSTexture(VertexData vtx) : TARGET {
|
|
return InputA.Sample(BlankSampler, vtx.uv);
|
|
};
|
|
|
|
technique Draw
|
|
{
|
|
pass
|
|
{
|
|
vertex_shader = DefaultVertexShader(vtx);
|
|
pixel_shader = PSTexture(vtx);
|
|
};
|
|
};
|
|
technique Texture
|
|
{
|
|
pass
|
|
{
|
|
vertex_shader = DefaultVertexShader(vtx);
|
|
pixel_shader = PSTexture(vtx);
|
|
};
|
|
};
|
|
|
|
//------------------------------------------------------------------------------
|
|
// Technique: TextureColor
|
|
//------------------------------------------------------------------------------
|
|
// Parameters:
|
|
// - InputA: RGBA Texture
|
|
|
|
float4 PSTextureColor(VertexColorData vtx) : TARGET {
|
|
return InputA.Sample(BlankSampler, vtx.uv) * vtx.clr;
|
|
};
|
|
|
|
technique TextureColor
|
|
{
|
|
pass
|
|
{
|
|
vertex_shader = ColorVertexShader(vtx);
|
|
pixel_shader = PSTextureColor(vtx);
|
|
};
|
|
};
|
|
|
|
//------------------------------------------------------------------------------
|
|
// Technique: Texture Premultiplied
|
|
//------------------------------------------------------------------------------
|
|
// Parameters:
|
|
// - InputA: RGBA Texture
|
|
|
|
float4 PSTexturePremultiplied(VertexData vtx) : TARGET {
|
|
float4 rgba = InputA.Sample(BlankSampler, vtx.uv);
|
|
rgba.rgb /= rgba.a > (1. / 1024.) ? rgba.a : 1.0;
|
|
return rgba;
|
|
};
|
|
|
|
technique DrawPremultiplied
|
|
{
|
|
pass
|
|
{
|
|
vertex_shader = DefaultVertexShader(vtx);
|
|
pixel_shader = PSTexturePremultiplied(vtx);
|
|
};
|
|
};
|
|
technique TexturePremultiplied
|
|
{
|
|
pass
|
|
{
|
|
vertex_shader = DefaultVertexShader(vtx);
|
|
pixel_shader = PSTexturePremultiplied(vtx);
|
|
};
|
|
};
|
|
|
|
//------------------------------------------------------------------------------
|
|
// Technique: Restore Alpha
|
|
//------------------------------------------------------------------------------
|
|
// Parameters:
|
|
// - InputA: RGBX Texture
|
|
// - InputB: XXXA Texture
|
|
|
|
float4 PSRestoreAlpha(VertexData vtx) : TARGET {
|
|
float4 rgbx = InputA.Sample(BlankSampler, vtx.uv);
|
|
float4 xxxa = InputB.Sample(BlankSampler, vtx.uv);
|
|
rgbx.a = xxxa.a;
|
|
return rgbx;
|
|
};
|
|
|
|
technique RestoreAlpha
|
|
{
|
|
pass
|
|
{
|
|
vertex_shader = DefaultVertexShader(vtx);
|
|
pixel_shader = PSRestoreAlpha(vtx);
|
|
};
|
|
};
|
|
|
|
//------------------------------------------------------------------------------
|
|
// Technique: Color
|
|
//------------------------------------------------------------------------------
|
|
// Parameters:
|
|
|
|
float4 PSColor(VertexColorData vtx) : TARGET {
|
|
return vtx.clr;
|
|
};
|
|
|
|
technique Color
|
|
{
|
|
pass
|
|
{
|
|
vertex_shader = ColorVertexShader(vtx);
|
|
pixel_shader = PSColor(vtx);
|
|
};
|
|
};
|