Files
test2/source/blender/gpu/shaders/common/gpu_shader_fullscreen_vert.glsl
Clément Foucault f2025f28e7 DRW: Move fullscreen vertex shader to gpu common
This makes no sense to have in the draw namespace.

Also take the opportunity for making the coordinates
a float2 and rename them to something more descriptive.
2025-04-16 20:09:28 +02:00

17 lines
403 B
GLSL

/* SPDX-FileCopyrightText: 2015-2022 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "gpu_shader_fullscreen_info.hh"
VERTEX_SHADER_CREATE_INFO(gpu_fullscreen)
void main()
{
int v = gl_VertexID % 3;
float x = -1.0f + float((v & 1) << 2);
float y = -1.0f + float((v & 2) << 1);
gl_Position = float4(x, y, 1.0f, 1.0f);
screen_uv = (gl_Position.xy + 1.0f) * 0.5f;
}