Blender V5.3
gpu_shader_fullscreen.bsl.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2015-2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
8
9/* Position vertices of a triangle to cover the whole screen. */
10void fullscreen_vertex(int vertex_id, float4 &out_position)
11{
12 int v = vertex_id % 3;
13 float x = -1.0f + float((v & 1) << 2);
14 float y = -1.0f + float((v & 2) << 1);
15 out_position = float4(x, y, 1.0f, 1.0f);
16}
17
18void fullscreen_vertex(int vertex_id, float4 &out_position, float2 &out_uv)
19{
20 fullscreen_vertex(vertex_id, out_position);
21 out_uv = (out_position.xy + 1.0f) * 0.5f;
22}
#define vertex_id
void fullscreen_vertex(int vertex_id, float4 &out_position)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float