Blender V5.3
eevee_geom_world.bsl.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "draw_model.bsl.hh"
12#include "draw_view.bsl.hh"
15#include "eevee_uniform.bsl.hh"
16
17namespace eevee {
18
19[[vertex]] [[clip_control]] void geom_world([[resource_table]] const Uniform & /*uni*/,
20 [[resource_table]] const draw::View &views,
21 [[resource_table]] const draw::Model & /*models*/,
23 [[vertex_id]] const int vert_id,
24 [[position]] float4 &out_position)
25{
26 /* (W)Intel drivers require all varying iface to be written to inside the Vertex shader. */
27 interp.resource_id_raw = 0u;
28
29 /* Full-screen triangle. */
30 int v = vert_id % 3;
31 float x = float((v & 1) << 2) - 1.0f;
32 float y = float((v & 2) << 1) - 1.0f;
33 out_position = float4(x, y, 1.0f, 1.0f);
34
35 /* Pass view position to keep accuracy. */
36 interp.P = views.get(0).point_ndc_to_view(out_position.xyz);
37 interp.N = float3(1);
38
39 out_position = reverse_z::transform(out_position);
40}
41
42} // namespace eevee
#define position
#define resource_table
#define vertex_id
#define clip_control
#define vertex
ccl_device_inline float interp(const float a, const float b, const float t)
Definition math_base.h:549
void geom_world(const Uniform &, const draw::View &views, const draw::Model &, VertOutCommon &interp, const int vert_id, float4 &out_position)
float4 transform(float4 hs_position)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float