Blender V4.5
draw_object_infos_info.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#ifdef GPU_SHADER
6# pragma once
7# include "gpu_glsl_cpp_stubs.hh"
8
9# include "draw_shader_shared.hh"
11
12# include "draw_view_info.hh"
13
14# define HAIR_SHADER
15# define DRW_GPENCIL_INFO
16#endif
17
18#include "draw_defines.hh"
20
21GPU_SHADER_CREATE_INFO(draw_volume_infos)
22TYPEDEF_SOURCE("draw_shader_shared.hh")
23DEFINE("VOLUME_INFO_LIB")
26
27GPU_SHADER_CREATE_INFO(draw_curves_infos)
28TYPEDEF_SOURCE("draw_shader_shared.hh")
31
32GPU_SHADER_CREATE_INFO(draw_layer_attributes)
33TYPEDEF_SOURCE("draw_shader_shared.hh")
34DEFINE("VLATTR_LIB")
37 drw_layer_attrs[DRW_RESOURCE_CHUNK_LEN],
38 BATCH)
40
41GPU_SHADER_CREATE_INFO(draw_object_infos)
42TYPEDEF_SOURCE("draw_shader_shared.hh")
43DEFINE("OBINFO_LIB")
46
48GPU_SHADER_CREATE_INFO(draw_object_attributes)
49DEFINE("OBATTR_LIB")
51ADDITIONAL_INFO(draw_object_infos)
53
54/* -------------------------------------------------------------------- */
57
59ADDITIONAL_INFO(draw_modelmat)
61
63DEFINE("HAIR_SHADER")
64DEFINE("DRW_HAIR_INFO")
65/* Per control points data inside subdivision shader
66 * or
67 * per tessellated point inside final shader. */
68SAMPLER(0, samplerBuffer, hairPointBuffer)
69/* TODO(@fclem): Pack these into one UBO. */
70/* hairStrandsRes: Number of points per hair strand.
71 * 2 - no subdivision
72 * 3+ - 1 or more interpolated points per hair. */
73PUSH_CONSTANT(int, hairStrandsRes)
74/* hairThicknessRes : Subdivide around the hair.
75 * 1 - Wire Hair: Only one pixel thick, independent of view distance.
76 * 2 - Poly-strip Hair: Correct width, flat if camera is parallel.
77 * 3+ - Cylinder Hair: Massive calculation but potentially perfect. Still need proper support. */
78PUSH_CONSTANT(int, hairThicknessRes)
79/* Hair thickness shape. */
80PUSH_CONSTANT(float, hairRadRoot)
81PUSH_CONSTANT(float, hairRadTip)
82PUSH_CONSTANT(float, hairRadShape)
83PUSH_CONSTANT(bool, hairCloseTip)
84/* Strand batch offset when used in compute shaders. */
85PUSH_CONSTANT(int, hairStrandOffset)
86/* Hair particles are stored in world space coordinate.
87 * This matrix convert to the instance "world space". */
88PUSH_CONSTANT(float4x4, hairDupliMatrix)
90
91GPU_SHADER_CREATE_INFO(draw_pointcloud)
92SAMPLER_FREQ(0, samplerBuffer, ptcloud_pos_rad_tx, BATCH)
93DEFINE("POINTCLOUD_SHADER")
94DEFINE("DRW_POINTCLOUD_INFO")
96
97GPU_SHADER_CREATE_INFO(draw_volume)
98ADDITIONAL_INFO(draw_modelmat)
100
101GPU_SHADER_CREATE_INFO(draw_gpencil)
102TYPEDEF_SOURCE("gpencil_shader_shared.hh")
103DEFINE("DRW_GPENCIL_INFO")
104SAMPLER(0, samplerBuffer, gp_pos_tx)
105SAMPLER(1, samplerBuffer, gp_col_tx)
106ADDITIONAL_INFO(draw_resource_id_varying)
107ADDITIONAL_INFO(draw_view)
108ADDITIONAL_INFO(draw_object_infos)
110
#define DRW_OBJ_INFOS_SLOT
#define DRW_OBJ_ATTR_SLOT
#define DRW_OBJ_DATA_INFO_UBO_SLOT
#define DRW_LAYER_ATTR_UBO_SLOT
#define DRW_RESOURCE_CHUNK_LEN
SamplerBase< float, 1 > samplerBuffer
MatBase< 4, 4 > float4x4
#define TYPEDEF_SOURCE(filename)
#define SAMPLER(slot, type, name)
#define ADDITIONAL_INFO(info_name)
#define PUSH_CONSTANT(type, name)
#define DEFINE(name)
#define UNIFORM_BUF_FREQ(slot, type_name, name, freq)
#define SAMPLER_FREQ(slot, type, name, freq)
#define STORAGE_BUF(slot, qualifiers, type_name, name)
#define GPU_SHADER_CREATE_INFO(_info)
#define GPU_SHADER_CREATE_END()
read