Blender  V3.3
Classes | Macros | Typedefs | Functions | Variables
draw_curves.cc File Reference

Contains procedural GPU hair drawing methods. More...

#include "BLI_string_utils.h"
#include "BLI_utildefines.h"
#include "DNA_curves_types.h"
#include "DNA_customdata_types.h"
#include "BKE_curves.hh"
#include "BKE_geometry_set.hh"
#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 "DRW_render.h"
#include "draw_cache_impl.h"
#include "draw_curves_private.h"
#include "draw_hair_private.h"
#include "draw_manager.h"
#include "draw_shader.h"

Go to the source code of this file.

Classes

struct  CurvesUniformBufPool
 

Macros

#define USE_TRANSFORM_FEEDBACK
 
#define USE_COMPUTE_SHADERS
 

Typedefs

using CurvesInfosBuf = blender::draw::UniformBuffer< CurvesInfos >
 

Functions

BLI_INLINE eParticleRefineShaderType drw_curves_shader_type_get ()
 
static GPUShadercurves_eval_shader_get (CurvesEvalShader type)
 
void DRW_curves_init (DRWData *drw_data)
 
void DRW_curves_ubos_pool_free (CurvesUniformBufPool *pool)
 
static void drw_curves_cache_shgrp_attach_resources (DRWShadingGroup *shgrp, CurvesEvalCache *cache, GPUTexture *tex, const int subdiv)
 
static void drw_curves_cache_update_compute (CurvesEvalCache *cache, const int subdiv, const int strands_len, GPUVertBuf *buffer, GPUTexture *tex)
 
static void drw_curves_cache_update_compute (CurvesEvalCache *cache, const int subdiv)
 
static void drw_curves_cache_update_transform_feedback (CurvesEvalCache *cache, GPUVertBuf *vbo, GPUTexture *tex, const int subdiv, const int final_points_len)
 
static void drw_curves_cache_update_transform_feedback (CurvesEvalCache *cache, const int subdiv)
 
static CurvesEvalCachedrw_curves_cache_get (Curves &curves, GPUMaterial *gpu_material, int subdiv, int thickness_res)
 
GPUVertBufDRW_curves_pos_buffer_get (Object *object)
 
static int attribute_index_in_material (GPUMaterial *gpu_material, const char *name)
 
DRWShadingGroupDRW_shgroup_curves_create_sub (Object *object, DRWShadingGroup *shgrp_parent, GPUMaterial *gpu_material)
 
void DRW_curves_update ()
 
void DRW_curves_free ()
 

Variables

static GPUVertBufg_dummy_vbo = nullptr
 
static GPUTextureg_dummy_texture = nullptr
 
static DRWPassg_tf_pass
 

Detailed Description

Contains procedural GPU hair drawing methods.

Definition in file draw_curves.cc.

Macro Definition Documentation

◆ USE_COMPUTE_SHADERS

#define USE_COMPUTE_SHADERS

Definition at line 38 of file draw_curves.cc.

◆ USE_TRANSFORM_FEEDBACK

#define USE_TRANSFORM_FEEDBACK

Definition at line 37 of file draw_curves.cc.

Typedef Documentation

◆ CurvesInfosBuf

Definition at line 72 of file draw_curves.cc.

Function Documentation

◆ attribute_index_in_material()

static int attribute_index_in_material ( GPUMaterial gpu_material,
const char *  name 
)
static

Definition at line 283 of file draw_curves.cc.

References GPU_material_attributes(), LISTBASE_FOREACH, and STREQ.

Referenced by DRW_shgroup_curves_create_sub().

◆ curves_eval_shader_get()

static GPUShader* curves_eval_shader_get ( CurvesEvalShader  type)
static

◆ drw_curves_cache_get()

static CurvesEvalCache* drw_curves_cache_get ( Curves curves,
GPUMaterial gpu_material,
int  subdiv,
int  thickness_res 
)
static

◆ drw_curves_cache_shgrp_attach_resources()

static void drw_curves_cache_shgrp_attach_resources ( DRWShadingGroup shgrp,
CurvesEvalCache cache,
GPUTexture tex,
const int  subdiv 
)
static

◆ drw_curves_cache_update_compute() [1/2]

static void drw_curves_cache_update_compute ( CurvesEvalCache cache,
const int  subdiv 
)
static

◆ drw_curves_cache_update_compute() [2/2]

static void drw_curves_cache_update_compute ( CurvesEvalCache cache,
const int  subdiv,
const int  strands_len,
GPUVertBuf buffer,
GPUTexture tex 
)
static

◆ drw_curves_cache_update_transform_feedback() [1/2]

static void drw_curves_cache_update_transform_feedback ( CurvesEvalCache cache,
const int  subdiv 
)
static

◆ drw_curves_cache_update_transform_feedback() [2/2]

static void drw_curves_cache_update_transform_feedback ( CurvesEvalCache cache,
GPUVertBuf vbo,
GPUTexture tex,
const int  subdiv,
const int  final_points_len 
)
static

◆ DRW_curves_free()

void DRW_curves_free ( void  )

◆ DRW_curves_init()

void DRW_curves_init ( DRWData drw_data)

◆ DRW_curves_pos_buffer_get()

GPUVertBuf* DRW_curves_pos_buffer_get ( struct Object object)

◆ drw_curves_shader_type_get()

BLI_INLINE eParticleRefineShaderType drw_curves_shader_type_get ( )

◆ DRW_curves_ubos_pool_free()

void DRW_curves_ubos_pool_free ( CurvesUniformBufPool pool)

Definition at line 132 of file draw_curves.cc.

References blender::compositor::pool.

Referenced by DRW_viewport_data_free().

◆ DRW_curves_update()

void DRW_curves_update ( void  )

◆ DRW_shgroup_curves_create_sub()

DRWShadingGroup* DRW_shgroup_curves_create_sub ( Object object,
DRWShadingGroup shgrp_parent,
GPUMaterial gpu_material 
)

Definition at line 303 of file draw_curves.cc.

References ATTR_DOMAIN_CURVE, ATTR_DOMAIN_POINT, CurvesEvalFinalCache::attr_used, attribute_index_in_material(), DRW_AttributeRequest::attribute_name, CurvesEvalFinalCache::attributes_tex, blender::math::clamp(), curves, DRWData::curves_ubos, DRW_AttributeRequest::domain, DRW_context_state_get(), drw_curves_cache_get(), drw_curves_get_attribute_sampler_name(), 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(), DST, CurvesEvalCache::final, blender::IndexRange::first(), g_dummy_texture, Curves::geometry, GPUBatch, RenderData::hair_subdiv, RenderData::hair_type, blender::IndexRange::last(), CurvesEvalCache::length_tex, DRW_Attributes::num_requests, Object::obmat, blender::compositor::pool, CurvesEvalCache::proc_attributes_tex, CurvesEvalFinalCache::proc_hairs, CurvesEvalFinalCache::proc_tex, blender::draw::detail::UniformCommon< T, len, device_only >::push_update(), Scene::r, radii, DRW_Attributes::requests, blender::math::safe_divide(), SCE_HAIR_SHAPE_STRAND, scene, DRWContextState::scene, blender::IndexRange::size(), CurvesEvalFinalCache::strands_res, DRWManager::vmempool, and blender::bke::CurvesGeometry::wrap().

Referenced by basic_cache_populate(), EEVEE_cryptomatte_object_curves_cache_populate(), EEVEE_motion_blur_curves_cache_populate(), EEVEE_object_curves_cache_populate(), OVERLAY_outline_curves(), OVERLAY_sculpt_curves_cache_populate(), blender::eevee::shgroup_curves_call(), and workbench_cache_populate().

Variable Documentation

◆ g_dummy_texture

GPUTexture* g_dummy_texture = nullptr
static

Definition at line 69 of file draw_curves.cc.

Referenced by DRW_curves_free(), DRW_curves_init(), and DRW_shgroup_curves_create_sub().

◆ g_dummy_vbo

GPUVertBuf* g_dummy_vbo = nullptr
static

Definition at line 68 of file draw_curves.cc.

Referenced by DRW_curves_free(), and DRW_curves_init().

◆ g_tf_pass

DRWPass* g_tf_pass
static