This is the first step of moving the create infos back inside shader sources. All info files are now treated as source files. However, they are not considered in the include tree yet. This will come in another following PR. Each shader source file now generate a `.info` file containing only the create info declarations. This renames all info files so that they do not conflict with their previous versions that were copied (non-generated). Pull Request: https://projects.blender.org/blender/blender/pulls/146676
36 lines
813 B
GLSL
36 lines
813 B
GLSL
/* SPDX-FileCopyrightText: 2019-2022 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
#include "infos/overlay_extra_infos.hh"
|
|
|
|
FRAGMENT_SHADER_CREATE_INFO(overlay_image_base)
|
|
|
|
#include "draw_colormanagement_lib.glsl"
|
|
#include "select_lib.glsl"
|
|
|
|
void main()
|
|
{
|
|
float2 uvs_clamped = clamp(uvs, 0.0f, 1.0f);
|
|
float4 tex_color;
|
|
tex_color = texture_read_as_linearrgb(img_tx, img_premultiplied, uvs_clamped);
|
|
|
|
frag_color = tex_color * ucolor;
|
|
|
|
if (!img_alpha_blend) {
|
|
/* Arbitrary discard anything below 5% opacity.
|
|
* Note that this could be exposed to the User. */
|
|
if (tex_color.a < 0.05f) {
|
|
gpu_discard_fragment();
|
|
}
|
|
else {
|
|
frag_color.a = 1.0f;
|
|
}
|
|
}
|
|
|
|
/* Pre-multiplied blending. */
|
|
frag_color.rgb *= frag_color.a;
|
|
|
|
select_id_output(select_id);
|
|
}
|