Blender
V5.3
source
blender
draw
engines
eevee
shaders
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
"
13
#include "
eevee_reverse_z_lib.bsl.hh
"
14
#include "
eevee_surf_common.bsl.hh
"
15
#include "
eevee_uniform.bsl.hh
"
16
17
namespace
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*/
,
22
[[
out
]]
VertOutCommon
&
interp
,
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
y
y
Definition
compositor_morphological_blur_infos.hh:32
draw_model.bsl.hh
draw_view.bsl.hh
eevee_reverse_z_lib.bsl.hh
eevee_surf_common.bsl.hh
eevee_uniform.bsl.hh
position
#define position
Definition
gpu_shader_cxx_attribute.hh:63
resource_table
#define resource_table
Definition
gpu_shader_cxx_attribute.hh:128
out
#define out
Definition
gpu_shader_cxx_attribute.hh:109
vertex_id
#define vertex_id
Definition
gpu_shader_cxx_attribute.hh:74
clip_control
#define clip_control
Definition
gpu_shader_cxx_attribute.hh:34
vertex
#define vertex
Definition
gpu_shader_cxx_attribute.hh:24
x
uint x
Definition
kernel/device/gpu/kernel.h:142
interp
ccl_device_inline float interp(const float a, const float b, const float t)
Definition
math_base.h:549
eevee
Definition
eevee_bxdf_lut.bsl.hh:20
eevee::geom_world
void geom_world(const Uniform &, const draw::View &views, const draw::Model &, VertOutCommon &interp, const int vert_id, float4 &out_position)
Definition
eevee_geom_world.bsl.hh:19
reverse_z::transform
float4 transform(float4 hs_position)
Definition
eevee_reverse_z_lib.bsl.hh:18
float
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
Definition
shadow_state_template.h:80
draw::Model
Definition
draw_model.bsl.hh:76
draw::View
Definition
draw_view.bsl.hh:15
eevee::Uniform
Definition
eevee_uniform.bsl.hh:11
eevee::VertOutCommon
Definition
eevee_surf_common.bsl.hh:17
float3
Definition
sky_math.h:135
float4
Definition
sky_math.h:224
Generated on
for Blender by
doxygen
1.18.0