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
42 lines
1.2 KiB
GLSL
42 lines
1.2 KiB
GLSL
/* SPDX-FileCopyrightText: 2022-2023 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
#include "infos/eevee_film_infos.hh"
|
|
|
|
FRAGMENT_SHADER_CREATE_INFO(eevee_film_frag)
|
|
|
|
#include "eevee_film_lib.glsl"
|
|
|
|
void main()
|
|
{
|
|
int2 texel_film = int2(gl_FragCoord.xy) - uniform_buf.film.offset;
|
|
float out_depth;
|
|
|
|
if (uniform_buf.film.display_only) {
|
|
out_depth = imageLoadFast(depth_img, texel_film).r;
|
|
|
|
if (display_id == -1) {
|
|
out_color = texelFetch(in_combined_tx, texel_film, 0);
|
|
}
|
|
else if (uniform_buf.film.display_storage_type == PASS_STORAGE_VALUE) {
|
|
out_color.rgb = imageLoadFast(value_accum_img, int3(texel_film, display_id)).rrr;
|
|
out_color.a = 1.0f;
|
|
}
|
|
else if (uniform_buf.film.display_storage_type == PASS_STORAGE_COLOR) {
|
|
out_color = imageLoadFast(color_accum_img, int3(texel_film, display_id));
|
|
}
|
|
else /* PASS_STORAGE_CRYPTOMATTE */ {
|
|
out_color = cryptomatte_false_color(
|
|
imageLoadFast(cryptomatte_img, int3(texel_film, display_id)).r);
|
|
}
|
|
}
|
|
else {
|
|
film_process_data(texel_film, out_color, out_depth);
|
|
}
|
|
|
|
gl_FragDepth = drw_depth_view_to_screen(-out_depth);
|
|
|
|
gl_FragDepth = film_display_depth_amend(texel_film, gl_FragDepth);
|
|
}
|