Blender V4.5
draw_curves_private.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2017 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include <array>
12#include <string>
13
14#include "GPU_shader.hh"
15
16#include "BLI_vector_set.hh"
17
18struct Curves;
19namespace blender::gpu {
20class Batch;
21class VertBuf;
22} // namespace blender::gpu
23struct GPUMaterial;
24
25namespace blender::draw {
26
27#define MAX_THICKRES 2 /* see eHairType */
28#define MAX_HAIR_SUBDIV 4 /* see hair_subdiv rna */
29
34#define CURVES_EVAL_SHADER_NUM 3
35
39 /* The "strand or strip" setting from the scene. See #MAX_THICKRES. */
41
42 /* Output of the subdivision stage: vertex buffer sized to subdiv level. */
44
46 gpu::Batch *proc_hairs;
47
50
53
59
66
67 /* Output of the subdivision stage: vertex buffers sized to subdiv level. This is only attributes
68 * on point domain. */
70};
71
72/* Curves procedural display: Evaluation is done on the GPU. */
74 /* Control point positions on evaluated data-block combined with parameter data. */
76
79
80 /* Curve length data. */
82
84
86
87 /* For point attributes, which need subdivision, these buffers contain the input data.
88 * For curve domain attributes, which do not need subdivision, these are the final data. */
90 std::array<bool, GPU_MAX_ATTR> proc_attributes_point_domain;
91
94};
95
100 CurvesEvalCache **r_cache,
101 const GPUMaterial *gpu_material,
102 int subdiv,
103 int thickness_res);
104
105void drw_curves_get_attribute_sampler_name(StringRef layer_name, char r_sampler_name[32]);
106
107} // namespace blender::draw
static constexpr int GPU_MAX_ATTR
Definition GPU_shader.hh:34
void drw_curves_get_attribute_sampler_name(const StringRef layer_name, char r_sampler_name[32])
bool curves_ensure_procedural_data(Curves *curves_id, CurvesEvalCache **r_cache, const GPUMaterial *gpu_material, const int subdiv, const int thickness_res)
gpu::VertBuf * proc_attributes_buf[GPU_MAX_ATTR]
std::array< bool, GPU_MAX_ATTR > proc_attributes_point_domain
VectorSet< std::string > attr_used_over_time
gpu::VertBuf * attributes_buf[GPU_MAX_ATTR]