Blender
V3.3
|
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_capabilities.h"
#include "GPU_compute.h"
#include "GPU_material.h"
#include "GPU_shader.h"
#include "GPU_texture.h"
#include "GPU_vertex_buffer.h"
#include "DRW_gpu_wrapper.hh"
#include "draw_hair_private.h"
#include "draw_shader.h"
#include "draw_shader_shared.h"
Go to the source code of this file.
Macros | |
#define | USE_TRANSFORM_FEEDBACK |
#define | USE_COMPUTE_SHADERS |
Variables | |
static GPUVertBuf * | g_dummy_vbo = nullptr |
static GPUTexture * | g_dummy_texture = nullptr |
static DRWPass * | g_tf_pass |
static blender::draw::UniformBuffer< CurvesInfos > * | g_dummy_curves_info = nullptr |
Contains procedural GPU hair drawing methods.
Definition in file draw_hair.cc.
#define USE_COMPUTE_SHADERS |
Definition at line 38 of file draw_hair.cc.
#define USE_TRANSFORM_FEEDBACK |
Definition at line 37 of file draw_hair.cc.
void DRW_hair_duplimat_get | ( | Object * | object, |
ParticleSystem * | UNUSEDpsys, | ||
ModifierData * | UNUSEDmd, | ||
float(*) | dupli_mat[4] | ||
) |
Definition at line 207 of file draw_hair.cc.
References copy_m4_m4(), DRW_object_get_dupli(), DRW_object_get_dupli_parent(), Object::instance_collection, Collection::instance_offset, invert_m4(), mul_m4_m4m4(), DupliObject::ob, OB_DUPLICOLLECTION, Object::obmat, sub_v3_v3(), DupliObject::type, and unit_m4().
Referenced by DRW_shgroup_hair_create_sub().
Definition at line 391 of file draw_hair.cc.
References DRW_TEXTURE_FREE_SAFE, g_dummy_curves_info, g_dummy_texture, g_dummy_vbo, and GPU_VERTBUF_DISCARD_SAFE.
Referenced by DRW_curves_free().
Definition at line 78 of file draw_hair.cc.
References DRW_pass_create(), DRW_STATE_NO_DRAW, DRW_STATE_WRITE_COLOR, g_dummy_curves_info, 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(), and GPU_vertformat_attr_add().
Referenced by DRW_curves_init().
|
static |
Definition at line 171 of file draw_hair.cc.
References drw_hair_particle_cache_update_compute(), drw_hair_particle_cache_update_transform_feedback(), drw_hair_shader_type_get(), PART_REFINE_SHADER_COMPUTE, particles_ensure_procedural_data(), and update().
Referenced by DRW_hair_pos_buffer_get(), and DRW_shgroup_hair_create_sub().
|
static |
Definition at line 110 of file draw_hair.cc.
References DRW_shgroup_uniform_int(), DRW_shgroup_uniform_texture(), ParticleHairCache::final, ParticleHairCache::point_tex, ParticleHairCache::strand_seg_tex, ParticleHairCache::strand_tex, and ParticleHairFinalCache::strands_res.
Referenced by drw_hair_particle_cache_update_compute(), and drw_hair_particle_cache_update_transform_feedback().
|
static |
Definition at line 120 of file draw_hair.cc.
References drw_hair_particle_cache_shgrp_attach_resources(), DRW_shgroup_call_compute(), DRW_shgroup_create(), DRW_shgroup_create_sub(), DRW_shgroup_uniform_int_copy(), DRW_shgroup_vertex_buffer, ParticleHairCache::final, g_tf_pass, GPU_max_work_group_count(), hair_refine_shader_get(), MIN2, PART_REFINE_CATMULL_ROM, ParticleHairFinalCache::proc_buf, ParticleHairCache::strands_len, and ParticleHairFinalCache::strands_res.
Referenced by drw_hair_particle_cache_get().
|
static |
Definition at line 142 of file draw_hair.cc.
References drw_hair_particle_cache_shgrp_attach_resources(), DRW_shgroup_call_procedural_points(), DRW_shgroup_create(), DRW_shgroup_transform_feedback_create(), DRW_shgroup_uniform_int(), ParticleHairCache::final, g_tf_pass, hair_refine_shader_get(), MEM_mallocN, PART_REFINE_CATMULL_ROM, ParticleHairFinalCache::proc_buf, ParticleHairCache::strands_len, and ParticleHairFinalCache::strands_res.
Referenced by drw_hair_particle_cache_get().
GPUVertBuf* DRW_hair_pos_buffer_get | ( | struct Object * | object, |
struct ParticleSystem * | psys, | ||
struct ModifierData * | md | ||
) |
Definition at line 193 of file draw_hair.cc.
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().
BLI_INLINE eParticleRefineShaderType drw_hair_shader_type_get | ( | ) |
Definition at line 41 of file draw_hair.cc.
References GPU_compute_shader_support(), GPU_shader_storage_buffer_objects_support(), PART_REFINE_SHADER_COMPUTE, PART_REFINE_SHADER_TRANSFORM_FEEDBACK, and PART_REFINE_SHADER_TRANSFORM_FEEDBACK_WORKAROUND.
Referenced by drw_hair_particle_cache_get(), DRW_hair_update(), and hair_refine_shader_get().
Definition at line 312 of file draw_hair.cc.
References data, DRW_draw_pass(), DRW_draw_pass_subset(), drw_hair_shader_type_get(), DRW_hair_update(), DRW_texture_pool_query_2d(), fb(), g_tf_pass, GPU_BARRIER_SHADER_STORAGE, GPU_DATA_FLOAT, GPU_framebuffer_bind(), GPU_framebuffer_free(), GPU_framebuffer_read_color(), GPU_memory_barrier(), GPU_RGBA32F, GPU_vertbuf_update_sub(), GPU_vertbuf_use(), height, max_ii(), MEM_freeN, MEM_mallocN, min_ii(), PART_REFINE_SHADER_COMPUTE, tex, and width.
Referenced by DRW_curves_update(), and DRW_hair_update().
DRWShadingGroup* DRW_shgroup_hair_create_sub | ( | struct Object * | object, |
struct ParticleSystem * | psys, | ||
struct ModifierData * | md, | ||
struct DRWShadingGroup * | shgrp, | ||
struct GPUMaterial * | gpu_material | ||
) |
This creates a shading group with display hairs. The draw call is already added by this function, just add additional uniforms.
Definition at line 235 of file draw_hair.cc.
References ParticleHairCache::col_layer_names, ParticleHairCache::col_tex, DRW_context_state_get(), DRW_hair_duplimat_get(), drw_hair_particle_cache_get(), DRW_shgroup_add_material_resources(), DRW_shgroup_call_no_cull, DRW_shgroup_create_sub(), DRW_shgroup_uniform_block, DRW_shgroup_uniform_bool_copy(), DRW_shgroup_uniform_float_copy(), DRW_shgroup_uniform_int(), DRW_shgroup_uniform_int_copy(), DRW_shgroup_uniform_mat4_copy(), DRW_shgroup_uniform_texture(), ParticleHairCache::final, g_dummy_curves_info, g_dummy_texture, GPUBatch, RenderData::hair_subdiv, RenderData::hair_type, ParticleHairCache::length_tex, 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_curves_cache_populate(), EEVEE_motion_blur_hair_cache_populate(), EEVEE_particle_hair_cache_populate(), blender::eevee::shgroup_curves_call(), and workbench_cache_hair_populate().
|
static |
Definition at line 73 of file draw_hair.cc.
References drw_hair_shader_type_get(), and DRW_shader_hair_refine_get().
Referenced by drw_hair_particle_cache_update_compute(), and drw_hair_particle_cache_update_transform_feedback().
|
static |
Definition at line 71 of file draw_hair.cc.
Referenced by DRW_hair_free(), DRW_hair_init(), and DRW_shgroup_hair_create_sub().
|
static |
Definition at line 69 of file draw_hair.cc.
Referenced by DRW_hair_free(), DRW_hair_init(), and DRW_shgroup_hair_create_sub().
|
static |
Definition at line 68 of file draw_hair.cc.
Referenced by DRW_hair_free(), and DRW_hair_init().
|
static |
Definition at line 70 of file draw_hair.cc.
Referenced by DRW_hair_init(), drw_hair_particle_cache_update_compute(), drw_hair_particle_cache_update_transform_feedback(), and DRW_hair_update().