Blender  V3.3
draw_hair_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 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 #define MAX_LAYER_NAME_CT 4 /* u0123456789, u, au, a0123456789 */
15 #define MAX_LAYER_NAME_LEN (GPU_MAX_SAFE_ATTR_NAME + 2)
16 #define MAX_THICKRES 2 /* see eHairType */
17 #define MAX_HAIR_SUBDIV 4 /* see hair_subdiv rna */
18 
19 typedef enum ParticleRefineShader {
23 
24 struct ModifierData;
25 struct Object;
26 struct ParticleHairCache;
27 struct ParticleSystem;
28 
29 typedef struct ParticleHairFinalCache {
30  /* Output of the subdivision stage: vertex buff sized to subdiv level. */
33 
34  /* Just contains a huge index buffer used to draw the final hair. */
36 
37  int strands_res; /* points per hair, at least 2 */
39 
40 typedef struct ParticleHairCache {
44 
45  /* Hair Procedural display: Interpolation is done on the GPU. */
46  GPUVertBuf *proc_point_buf; /* Input control points */
48 
52 
53  /* Hair Length */
56 
59 
63 
67 
70 
72 
74  int elems_len;
75  int point_len;
77 
81 bool particles_ensure_procedural_data(struct Object *object,
82  struct ParticleSystem *psys,
83  struct ModifierData *md,
84  struct ParticleHairCache **r_hair_cache,
85  struct GPUMaterial *gpu_material,
86  int subdiv,
87  int thickness_res);
88 
89 #ifdef __cplusplus
90 }
91 #endif
#define MAX_MTFACE
GPUBatch
Definition: GPU_batch.h:78
struct GPUIndexBuf GPUIndexBuf
struct GPUTexture GPUTexture
Definition: GPU_texture.h:17
struct GPUVertBuf GPUVertBuf
struct ParticleHairCache ParticleHairCache
struct ParticleHairFinalCache ParticleHairFinalCache
#define MAX_THICKRES
ParticleRefineShader
@ PART_REFINE_MAX_SHADER
@ PART_REFINE_CATMULL_ROM
#define MAX_LAYER_NAME_LEN
#define MAX_LAYER_NAME_CT
#define MAX_HAIR_SUBDIV
bool particles_ensure_procedural_data(struct Object *object, struct ParticleSystem *psys, struct ModifierData *md, struct ParticleHairCache **r_hair_cache, struct GPUMaterial *gpu_material, int subdiv, int thickness_res)
GPUTexture ** col_tex
GPUVertBuf * proc_point_buf
GPUTexture * uv_tex[MAX_MTFACE]
GPUVertBuf * proc_strand_buf
GPUVertBuf ** proc_col_buf
GPUIndexBuf * indices
GPUTexture * length_tex
char uv_layer_names[MAX_MTFACE][MAX_LAYER_NAME_CT][MAX_LAYER_NAME_LEN]
GPUVertBuf * proc_length_buf
GPUTexture * strand_seg_tex
GPUVertBuf * proc_strand_seg_buf
GPUTexture * point_tex
GPUTexture * strand_tex
GPUVertBuf * proc_uv_buf[MAX_MTFACE]
char(* col_layer_names)[MAX_LAYER_NAME_CT][MAX_LAYER_NAME_LEN]
GPUBatch * proc_hairs[MAX_THICKRES]