Support passthrough for stream
This commit is contained in:
@@ -83,7 +83,7 @@ layout(location = 0) out vec4 outColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
outColor = vec4(texture(texSampler, inUV).rgb, 1);
|
||||
outColor = texture(texSampler, inUV).rgba;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
+15
-10
@@ -21,8 +21,8 @@
|
||||
|
||||
#ifdef VERT_SHADER
|
||||
|
||||
layout (constant_id = 0) const float useful_size_x = 1.0;
|
||||
layout (constant_id = 1) const float useful_size_y = 1.0;
|
||||
layout(constant_id = 0) const float useful_size_x = 1.0;
|
||||
layout(constant_id = 1) const float useful_size_y = 1.0;
|
||||
|
||||
vec2 positions[3] = vec2[](
|
||||
vec2(-1.0, -1.0),
|
||||
@@ -46,6 +46,7 @@ void main()
|
||||
#ifdef FRAG_SHADER
|
||||
layout(binding = 0) uniform sampler2D texSampler;
|
||||
layout(constant_id = 0) const bool do_srgb = true;
|
||||
layout(constant_id = 1) const bool is_alpha = false;
|
||||
|
||||
layout(location = 0) in vec2 inUV;
|
||||
|
||||
@@ -53,19 +54,18 @@ layout(location = 0) out vec4 outColor;
|
||||
|
||||
float sRGB_to_linear(float x)
|
||||
{
|
||||
if (x <= 0.04045)
|
||||
return x / 12.92;
|
||||
return pow((x + 0.055) / 1.055, 2.4);
|
||||
if (x <= 0.04045)
|
||||
return x / 12.92;
|
||||
return pow((x + 0.055) / 1.055, 2.4);
|
||||
}
|
||||
|
||||
vec4 sRGB_to_linear_rgba(vec4 x)
|
||||
{
|
||||
return vec4(
|
||||
sRGB_to_linear(x.r),
|
||||
sRGB_to_linear(x.g),
|
||||
sRGB_to_linear(x.b),
|
||||
x.a
|
||||
);
|
||||
sRGB_to_linear(x.r),
|
||||
sRGB_to_linear(x.g),
|
||||
sRGB_to_linear(x.b),
|
||||
x.r);
|
||||
}
|
||||
|
||||
void main()
|
||||
@@ -77,6 +77,11 @@ void main()
|
||||
else
|
||||
{
|
||||
outColor = texture(texSampler, inUV);
|
||||
outColor.a = outColor.r;
|
||||
}
|
||||
if (!is_alpha)
|
||||
{
|
||||
outColor.a = 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user