Blender  V2.93
draw_hair_private.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2017 by Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #define MAX_LAYER_NAME_CT 4 /* u0123456789, u, au, a0123456789 */
27 #define MAX_LAYER_NAME_LEN (GPU_MAX_SAFE_ATTR_NAME + 2)
28 #define MAX_THICKRES 2 /* see eHairType */
29 #define MAX_HAIR_SUBDIV 4 /* see hair_subdiv rna */
30 
31 struct ModifierData;
32 struct Object;
33 struct ParticleHairCache;
34 struct ParticleSystem;
35 
36 typedef struct ParticleHairFinalCache {
37  /* Output of the subdivision stage: vertex buff sized to subdiv level. */
40 
41  /* Just contains a huge index buffer used to draw the final hair. */
43 
44  int strands_res; /* points per hair, at least 2 */
46 
47 typedef struct ParticleHairCache {
51 
52  /* Hair Procedural display: Interpolation is done on the GPU. */
53  GPUVertBuf *proc_point_buf; /* Input control points */
55 
59 
62 
66 
70 
73 
75 
77  int elems_len;
78  int point_len;
80 
81 void particle_batch_cache_clear_hair(struct ParticleHairCache *hair_cache);
82 
83 bool particles_ensure_procedural_data(struct Object *object,
84  struct ParticleSystem *psys,
85  struct ModifierData *md,
86  struct ParticleHairCache **r_hair_cache,
87  int subdiv,
88  int thickness_res);
89 
90 bool hair_ensure_procedural_data(struct Object *object,
91  struct ParticleHairCache **r_hair_cache,
92  int subdiv,
93  int thickness_res);
#define MAX_MCOL
#define MAX_MTFACE
GPUBatch
Definition: GPU_batch.h:93
struct GPUIndexBuf GPUIndexBuf
struct GPUTexture GPUTexture
Definition: GPU_texture.h:33
struct GPUVertBuf GPUVertBuf
struct ParticleHairCache ParticleHairCache
bool hair_ensure_procedural_data(struct Object *object, struct ParticleHairCache **r_hair_cache, int subdiv, int thickness_res)
bool particles_ensure_procedural_data(struct Object *object, struct ParticleSystem *psys, struct ModifierData *md, struct ParticleHairCache **r_hair_cache, int subdiv, int thickness_res)
struct ParticleHairFinalCache ParticleHairFinalCache
#define MAX_THICKRES
void particle_batch_cache_clear_hair(struct ParticleHairCache *hair_cache)
#define MAX_LAYER_NAME_LEN
#define MAX_LAYER_NAME_CT
#define MAX_HAIR_SUBDIV
GPUVertBuf * proc_point_buf
GPUTexture * uv_tex[MAX_MTFACE]
GPUVertBuf * proc_strand_buf
GPUIndexBuf * indices
GPUVertBuf * proc_col_buf[MAX_MCOL]
char uv_layer_names[MAX_MTFACE][MAX_LAYER_NAME_CT][MAX_LAYER_NAME_LEN]
GPUTexture * strand_seg_tex
GPUVertBuf * proc_strand_seg_buf
GPUTexture * point_tex
char col_layer_names[MAX_MCOL][MAX_LAYER_NAME_CT][MAX_LAYER_NAME_LEN]
GPUTexture * strand_tex
GPUVertBuf * proc_uv_buf[MAX_MTFACE]
GPUTexture * col_tex[MAX_MCOL]
GPUBatch * proc_hairs[MAX_THICKRES]