Blender  V3.3
Macros | Functions | Variables
draw_hair.cc File Reference

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
 

Functions

BLI_INLINE eParticleRefineShaderType drw_hair_shader_type_get ()
 
static GPUShaderhair_refine_shader_get (ParticleRefineShader refinement)
 
void DRW_hair_init (void)
 
static void drw_hair_particle_cache_shgrp_attach_resources (DRWShadingGroup *shgrp, ParticleHairCache *cache, const int subdiv)
 
static void drw_hair_particle_cache_update_compute (ParticleHairCache *cache, const int subdiv)
 
static void drw_hair_particle_cache_update_transform_feedback (ParticleHairCache *cache, const int subdiv)
 
static ParticleHairCachedrw_hair_particle_cache_get (Object *object, ParticleSystem *psys, ModifierData *md, GPUMaterial *gpu_material, int subdiv, int thickness_res)
 
GPUVertBufDRW_hair_pos_buffer_get (Object *object, ParticleSystem *psys, ModifierData *md)
 
void DRW_hair_duplimat_get (Object *object, ParticleSystem *UNUSED(psys), ModifierData *UNUSED(md), float(*dupli_mat)[4])
 
DRWShadingGroupDRW_shgroup_hair_create_sub (Object *object, ParticleSystem *psys, ModifierData *md, DRWShadingGroup *shgrp_parent, GPUMaterial *gpu_material)
 
void DRW_hair_update ()
 
void DRW_hair_free (void)
 

Variables

static GPUVertBufg_dummy_vbo = nullptr
 
static GPUTextureg_dummy_texture = nullptr
 
static DRWPassg_tf_pass
 
static blender::draw::UniformBuffer< CurvesInfos > * g_dummy_curves_info = nullptr
 

Detailed Description

Contains procedural GPU hair drawing methods.

Definition in file draw_hair.cc.

Macro Definition Documentation

◆ USE_COMPUTE_SHADERS

#define USE_COMPUTE_SHADERS

Definition at line 38 of file draw_hair.cc.

◆ USE_TRANSFORM_FEEDBACK

#define USE_TRANSFORM_FEEDBACK

Definition at line 37 of file draw_hair.cc.

Function Documentation

◆ DRW_hair_duplimat_get()

void DRW_hair_duplimat_get ( Object object,
ParticleSystem UNUSEDpsys,
ModifierData UNUSEDmd,
float(*)  dupli_mat[4] 
)

◆ DRW_hair_free()

void DRW_hair_free ( void  )

◆ DRW_hair_init()

void DRW_hair_init ( void  )

◆ drw_hair_particle_cache_get()

static ParticleHairCache* drw_hair_particle_cache_get ( Object object,
ParticleSystem psys,
ModifierData md,
GPUMaterial gpu_material,
int  subdiv,
int  thickness_res 
)
static

◆ drw_hair_particle_cache_shgrp_attach_resources()

static void drw_hair_particle_cache_shgrp_attach_resources ( DRWShadingGroup shgrp,
ParticleHairCache cache,
const int  subdiv 
)
static

◆ drw_hair_particle_cache_update_compute()

static void drw_hair_particle_cache_update_compute ( ParticleHairCache cache,
const int  subdiv 
)
static

◆ drw_hair_particle_cache_update_transform_feedback()

static void drw_hair_particle_cache_update_transform_feedback ( ParticleHairCache cache,
const int  subdiv 
)
static

◆ DRW_hair_pos_buffer_get()

GPUVertBuf* DRW_hair_pos_buffer_get ( struct Object object,
struct ParticleSystem psys,
struct ModifierData md 
)

◆ drw_hair_shader_type_get()

BLI_INLINE eParticleRefineShaderType drw_hair_shader_type_get ( )

◆ DRW_hair_update()

void DRW_hair_update ( void  )

◆ DRW_shgroup_hair_create_sub()

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().

◆ hair_refine_shader_get()

static GPUShader* hair_refine_shader_get ( ParticleRefineShader  refinement)
static

Variable Documentation

◆ g_dummy_curves_info

blender::draw::UniformBuffer<CurvesInfos>* g_dummy_curves_info = nullptr
static

Definition at line 71 of file draw_hair.cc.

Referenced by DRW_hair_free(), DRW_hair_init(), and DRW_shgroup_hair_create_sub().

◆ g_dummy_texture

GPUTexture* g_dummy_texture = nullptr
static

Definition at line 69 of file draw_hair.cc.

Referenced by DRW_hair_free(), DRW_hair_init(), and DRW_shgroup_hair_create_sub().

◆ g_dummy_vbo

GPUVertBuf* g_dummy_vbo = nullptr
static

Definition at line 68 of file draw_hair.cc.

Referenced by DRW_hair_free(), and DRW_hair_init().

◆ g_tf_pass

DRWPass* g_tf_pass
static