mirror of https://github.com/Xaymar/obs-StreamFX
effects: Add standard effect file
There are a number of duplicate shader routines we should combine into a single shader to save disk space, and remove unexpected errors in one copy but not the other.
This commit is contained in:
parent
e40e7526de
commit
889fea6422
|
@ -1174,6 +1174,7 @@ list(APPEND PROJECT_DATA
|
||||||
"data/effects/color_conversion_rgb_yuv.effect"
|
"data/effects/color_conversion_rgb_yuv.effect"
|
||||||
"data/effects/mipgen.effect"
|
"data/effects/mipgen.effect"
|
||||||
"data/effects/pack-unpack.effect"
|
"data/effects/pack-unpack.effect"
|
||||||
|
"data/effects/standard.effect"
|
||||||
"data/effects/shared.effect"
|
"data/effects/shared.effect"
|
||||||
"data/locale/en-US.ini"
|
"data/locale/en-US.ini"
|
||||||
)
|
)
|
||||||
|
|
|
@ -16,6 +16,9 @@ uniform float4x4 ViewProj;
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// Samplers
|
// Samplers
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
sampler_state BlankSampler {
|
||||||
|
};
|
||||||
|
|
||||||
sampler_state PointRepeatSampler {
|
sampler_state PointRepeatSampler {
|
||||||
Filter = Point;
|
Filter = Point;
|
||||||
AddressU = Repeat;
|
AddressU = Repeat;
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
#include "shared.effect"
|
||||||
|
|
||||||
|
uniform texture2D Channel0;
|
||||||
|
uniform texture2D Channel1;
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// Technique: Restore Alpha
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// Parameters:
|
||||||
|
// - Channel0: RGBX Texture
|
||||||
|
// - Channel1: XXXA Texture
|
||||||
|
|
||||||
|
float4 PSRestoreAlpha(VertexData vtx) : TARGET {
|
||||||
|
float4 rgbx = Channel0.Sample(BlankSampler, vtx.uv);
|
||||||
|
float4 xxxa = Channel1.Sample(BlankSampler, vtx.uv);
|
||||||
|
rgbx.a = xxxa.a;
|
||||||
|
return rgbx;
|
||||||
|
};
|
||||||
|
|
||||||
|
technique RestoreAlpha
|
||||||
|
{
|
||||||
|
pass
|
||||||
|
{
|
||||||
|
vertex_shader = DefaultVertexShader(vtx);
|
||||||
|
pixel_shader = PSRestoreAlpha(vtx);
|
||||||
|
};
|
||||||
|
};
|
Loading…
Reference in New Issue