Blender  V3.3
draw_curves_private.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2017 Blender Foundation. All rights reserved. */
3 
8 #pragma once
9 
10 #include "BKE_attribute.h"
11 #include "GPU_shader.h"
12 
13 #include "draw_attributes.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 struct Curves;
20 struct GPUVertBuf;
21 struct GPUIndexBuf;
22 struct GPUBatch;
23 struct GPUTexture;
24 
25 #define MAX_THICKRES 2 /* see eHairType */
26 #define MAX_HAIR_SUBDIV 4 /* see hair_subdiv rna */
27 
28 typedef enum CurvesEvalShader {
32 #define CURVES_EVAL_SHADER_NUM 3
33 
34 typedef struct CurvesEvalFinalCache {
35  /* Output of the subdivision stage: vertex buffer sized to subdiv level. */
38 
41 
44 
47 
53 
60 
61  /* Output of the subdivision stage: vertex buffers sized to subdiv level. This is only attributes
62  * on point domain. */
66 
67 /* Curves procedural display: Evaluation is done on the GPU. */
68 typedef struct CurvesEvalCache {
69  /* Input control point positions combined with parameter data. */
72 
76 
77  /* Curve length data. */
80 
83 
85 
86  /* For point attributes, which need subdivision, these buffers contain the input data.
87  * For curve domain attributes, which do not need subdivision, these are the final data. */
90 
92  int elems_len;
93  int point_len;
95 
100  struct CurvesEvalCache **r_hair_cache,
101  struct GPUMaterial *gpu_material,
102  int subdiv,
103  int thickness_res);
104 
105 void drw_curves_get_attribute_sampler_name(const char *layer_name, char r_sampler_name[32]);
106 
107 #ifdef __cplusplus
108 }
109 #endif
Generic geometry attributes built on CustomData.
GPUBatch
Definition: GPU_batch.h:78
struct GPUIndexBuf GPUIndexBuf
#define GPU_MAX_ATTR
Definition: GPU_shader.h:388
struct GPUTexture GPUTexture
Definition: GPU_texture.h:17
struct GPUVertBuf GPUVertBuf
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to curves
Utilities for rendering attributes.
struct CurvesEvalFinalCache CurvesEvalFinalCache
void drw_curves_get_attribute_sampler_name(const char *layer_name, char r_sampler_name[32])
bool curves_ensure_procedural_data(struct Curves *curves, struct CurvesEvalCache **r_hair_cache, struct GPUMaterial *gpu_material, int subdiv, int thickness_res)
#define MAX_THICKRES
struct CurvesEvalCache CurvesEvalCache
CurvesEvalShader
@ CURVES_EVAL_CATMULL_ROM
@ CURVES_EVAL_BEZIER
#define MAX_HAIR_SUBDIV
GPUTexture * point_tex
GPUVertBuf * proc_strand_seg_buf
GPUVertBuf * proc_attributes_buf[GPU_MAX_ATTR]
GPUTexture * strand_tex
GPUTexture * proc_attributes_tex[GPU_MAX_ATTR]
GPUVertBuf * proc_strand_buf
GPUTexture * length_tex
GPUVertBuf * proc_point_buf
GPUVertBuf * proc_length_buf
GPUTexture * strand_seg_tex
DRW_Attributes attr_used_over_time
GPUBatch * proc_hairs[MAX_THICKRES]
GPUVertBuf * attributes_buf[GPU_MAX_ATTR]
GPUTexture * attributes_tex[GPU_MAX_ATTR]