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
24 lines
548 B
GLSL
24 lines
548 B
GLSL
/* SPDX-FileCopyrightText: 2018-2023 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
#include "infos/gpu_shader_gpencil_stroke_infos.hh"
|
|
|
|
FRAGMENT_SHADER_CREATE_INFO(gpu_shader_gpencil_stroke)
|
|
|
|
void main()
|
|
{
|
|
constexpr float2 center = float2(0, 0.5f);
|
|
float4 tColor = interp.mColor;
|
|
/* if alpha < 0, then encap */
|
|
if (tColor.a < 0) {
|
|
tColor.a = tColor.a * -1.0f;
|
|
float dist = length(interp.mTexCoord - center);
|
|
if (dist > 0.25f) {
|
|
gpu_discard_fragment();
|
|
}
|
|
}
|
|
/* Solid */
|
|
fragColor = tColor;
|
|
}
|