2023-08-24 10:54:59 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2020-2022 Blender Authors
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2020-02-11 15:18:55 +01:00
|
|
|
|
2025-09-25 10:57:02 +02:00
|
|
|
#include "infos/overlay_background_infos.hh"
|
2025-02-24 16:17:18 +01:00
|
|
|
|
|
|
|
|
VERTEX_SHADER_CREATE_INFO(overlay_clipbound)
|
|
|
|
|
|
2025-01-23 18:06:22 +01:00
|
|
|
#include "draw_view_lib.glsl"
|
2020-02-11 15:18:55 +01:00
|
|
|
|
|
|
|
|
void main()
|
|
|
|
|
{
|
2025-04-14 13:46:41 +02:00
|
|
|
float3 world_pos = boundbox[gl_VertexID];
|
2025-01-23 18:06:22 +01:00
|
|
|
gl_Position = drw_point_world_to_homogenous(world_pos);
|
2020-02-11 15:18:55 +01:00
|
|
|
|
|
|
|
|
/* Result in a position at 1.0 (far plane). Small epsilon to avoid precision issue.
|
|
|
|
|
* This mimics the effect of infinite projection matrix
|
|
|
|
|
* (see http://www.terathon.com/gdc07_lengyel.pdf). */
|
2025-04-11 18:28:45 +02:00
|
|
|
gl_Position.z = gl_Position.w - 2.4e-7f;
|
2020-02-11 15:18:55 +01:00
|
|
|
}
|