|
Blender
V2.93
|
Contains procedural GPU hair drawing methods. More...
#include "DRW_render.h"#include "BLI_string_utils.h"#include "BLI_utildefines.h"#include "DNA_collection_types.h"#include "DNA_customdata_types.h"#include "DNA_modifier_types.h"#include "DNA_particle_types.h"#include "BKE_duplilist.h"#include "GPU_batch.h"#include "GPU_shader.h"#include "GPU_vertex_buffer.h"#include "draw_hair_private.h"Go to the source code of this file.
Macros | |
| #define | USE_TRANSFORM_FEEDBACK |
Typedefs | |
| typedef enum ParticleRefineShader | ParticleRefineShader |
Enumerations | |
| enum | ParticleRefineShader { PART_REFINE_CATMULL_ROM = 0 , PART_REFINE_MAX_SHADER } |
Functions | |
| static GPUShader * | hair_refine_shader_get (ParticleRefineShader sh) |
| void | DRW_hair_init (void) |
| static ParticleHairCache * | drw_hair_particle_cache_get (Object *object, ParticleSystem *psys, ModifierData *md, int subdiv, int thickness_res) |
| GPUVertBuf * | DRW_hair_pos_buffer_get (Object *object, ParticleSystem *psys, ModifierData *md) |
| void | DRW_hair_duplimat_get (Object *object, ParticleSystem *psys, ModifierData *UNUSED(md), float(*dupli_mat)[4]) |
| DRWShadingGroup * | DRW_shgroup_hair_create_sub (Object *object, ParticleSystem *psys, ModifierData *md, DRWShadingGroup *shgrp_parent) |
| void | DRW_hair_update (void) |
| void | DRW_hair_free (void) |
Variables | |
| static GPUVertBuf * | g_dummy_vbo = NULL |
| static GPUTexture * | g_dummy_texture = NULL |
| static GPUShader * | g_refine_shaders [PART_REFINE_MAX_SHADER] = {NULL} |
| static DRWPass * | g_tf_pass |
| char | datatoc_common_hair_lib_glsl [] |
| char | datatoc_common_hair_refine_vert_glsl [] |
| char | datatoc_gpu_shader_3D_smooth_color_frag_glsl [] |
Contains procedural GPU hair drawing methods.
Definition in file draw_hair.c.
| #define USE_TRANSFORM_FEEDBACK |
Definition at line 45 of file draw_hair.c.
| typedef enum ParticleRefineShader ParticleRefineShader |
| enum ParticleRefineShader |
| Enumerator | |
|---|---|
| PART_REFINE_CATMULL_ROM | |
| PART_REFINE_MAX_SHADER | |
Definition at line 48 of file draw_hair.c.
| void DRW_hair_duplimat_get | ( | Object * | object, |
| ParticleSystem * | psys, | ||
| ModifierData * | UNUSEDmd, | ||
| float(*) | dupli_mat[4] | ||
| ) |
Definition at line 188 of file draw_hair.c.
References copy_m4_m4(), DRW_object_get_dupli(), DRW_object_get_dupli_parent(), Object::instance_collection, Collection::instance_offset, invert_m4(), mul_m4_m4m4(), NULL, DupliObject::ob, OB_DUPLICOLLECTION, Object::obmat, sub_v3_v3(), DupliObject::type, and unit_m4().
Referenced by DRW_shgroup_hair_create_sub().
| void DRW_hair_free | ( | void | ) |
Definition at line 376 of file draw_hair.c.
References DRW_SHADER_FREE_SAFE, DRW_TEXTURE_FREE_SAFE, g_dummy_texture, g_dummy_vbo, g_refine_shaders, GPU_VERTBUF_DISCARD_SAFE, and PART_REFINE_MAX_SHADER.
Referenced by DRW_engines_free().
| void DRW_hair_init | ( | void | ) |
Definition at line 103 of file draw_hair.c.
References DRW_pass_create(), DRW_STATE_WRITE_COLOR, g_dummy_texture, g_dummy_vbo, g_tf_pass, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_texture_create_from_vertbuf(), GPU_vertbuf_attr_fill(), GPU_vertbuf_create_with_format, GPU_vertbuf_data_alloc(), GPU_vertbuf_use(), GPU_vertformat_attr_add(), and NULL.
Referenced by DRW_cache_restart(), DRW_custom_pipeline(), drw_draw_depth_loop_impl(), DRW_draw_render_loop_ex(), DRW_draw_select_loop(), and DRW_render_object_iter().
|
static |
Definition at line 128 of file draw_hair.c.
References DRW_shgroup_call_procedural_points(), DRW_shgroup_create(), DRW_shgroup_transform_feedback_create(), DRW_shgroup_uniform_int(), DRW_shgroup_uniform_texture(), ParticleHairCache::final, g_tf_pass, hair_ensure_procedural_data(), hair_refine_shader_get(), MEM_mallocN, NULL, PART_REFINE_CATMULL_ROM, particles_ensure_procedural_data(), ParticleHairCache::point_tex, ParticleHairFinalCache::proc_buf, ParticleHairCache::strand_seg_tex, ParticleHairCache::strand_tex, ParticleHairCache::strands_len, ParticleHairFinalCache::strands_res, and update().
Referenced by DRW_hair_pos_buffer_get(), and DRW_shgroup_hair_create_sub().
| GPUVertBuf* DRW_hair_pos_buffer_get | ( | Object * | object, |
| ParticleSystem * | psys, | ||
| ModifierData * | md | ||
| ) |
Definition at line 175 of file draw_hair.c.
References DRW_context_state_get(), drw_hair_particle_cache_get(), ParticleHairCache::final, RenderData::hair_subdiv, RenderData::hair_type, ParticleHairFinalCache::proc_buf, Scene::r, SCE_HAIR_SHAPE_STRAND, scene, and DRWContextState::scene.
Referenced by EEVEE_motion_blur_hair_cache_populate().
| void DRW_hair_update | ( | void | ) |
Definition at line 300 of file draw_hair.c.
References data, DRW_draw_pass(), DRW_draw_pass_subset(), DRW_hair_update(), DRW_texture_pool_query_2d(), fb(), g_tf_pass, GPU_DATA_FLOAT, GPU_framebuffer_bind(), GPU_framebuffer_free(), GPU_framebuffer_read_color(), GPU_RGBA32F, GPU_vertbuf_update_sub(), GPU_vertbuf_use(), height, max_ii(), MEM_freeN, MEM_mallocN, min_ii(), NULL, tex, and width.
Referenced by drw_draw_depth_loop_impl(), DRW_draw_render_loop_ex(), DRW_draw_select_loop(), DRW_hair_update(), eevee_lightbake_cache_create(), EEVEE_motion_blur_cache_finish(), EEVEE_render_draw(), and workbench_render().
| DRWShadingGroup* DRW_shgroup_hair_create_sub | ( | Object * | object, |
| ParticleSystem * | psys, | ||
| ModifierData * | md, | ||
| DRWShadingGroup * | shgrp_parent | ||
| ) |
Definition at line 222 of file draw_hair.c.
References ParticleHairCache::col_layer_names, ParticleHairCache::col_tex, DRW_context_state_get(), DRW_hair_duplimat_get(), drw_hair_particle_cache_get(), DRW_shgroup_call_no_cull, DRW_shgroup_create_sub(), DRW_shgroup_uniform_bool_copy(), DRW_shgroup_uniform_float_copy(), DRW_shgroup_uniform_int(), DRW_shgroup_uniform_int_copy(), DRW_shgroup_uniform_texture(), DRW_shgroup_uniform_vec4_array_copy(), ParticleHairCache::final, g_dummy_texture, GPUBatch, RenderData::hair_subdiv, RenderData::hair_type, MAX_LAYER_NAME_CT, ParticleHairCache::num_col_layers, ParticleHairCache::num_uv_layers, ParticleSystem::part, PART_SHAPE_CLOSE_TIP, ParticleHairFinalCache::proc_hairs, ParticleHairFinalCache::proc_tex, Scene::r, ParticleSettings::rad_root, ParticleSettings::rad_scale, ParticleSettings::rad_tip, SCE_HAIR_SHAPE_STRAND, scene, DRWContextState::scene, ParticleSettings::shape, ParticleSettings::shape_flag, ParticleHairFinalCache::strands_res, ParticleHairCache::uv_layer_names, and ParticleHairCache::uv_tex.
Referenced by eevee_cryptomatte_hair_cache_populate(), eevee_hair_cache_populate(), EEVEE_motion_blur_hair_cache_populate(), and workbench_cache_hair_populate().
|
static |
Definition at line 76 of file draw_hair.c.
References BLI_string_joinN, datatoc_common_hair_lib_glsl, datatoc_common_hair_refine_vert_glsl, datatoc_gpu_shader_3D_smooth_color_frag_glsl, DRW_shader_create, DRW_shader_create_with_transform_feedback(), g_refine_shaders, GPU_SHADER_TFB_POINTS, MEM_freeN, and NULL.
Referenced by drw_hair_particle_cache_get().
|
extern |
Referenced by hair_refine_shader_get().
|
extern |
Referenced by hair_refine_shader_get().
|
extern |
Referenced by hair_refine_shader_get().
|
static |
Definition at line 68 of file draw_hair.c.
Referenced by DRW_hair_free(), DRW_hair_init(), and DRW_shgroup_hair_create_sub().
|
static |
Definition at line 67 of file draw_hair.c.
Referenced by DRW_hair_free(), and DRW_hair_init().
|
static |
Definition at line 69 of file draw_hair.c.
Referenced by DRW_hair_free(), and hair_refine_shader_get().
|
static |
Definition at line 70 of file draw_hair.c.
Referenced by DRW_hair_init(), drw_hair_particle_cache_get(), and DRW_hair_update().