49 switch (displacement_method) {
68 switch (thickness_mode) {
87 bool &transparent_shadows)
89 const uint64_t geometry_mask = ((1u << 4u) - 1u);
90 const uint64_t pipeline_mask = ((1u << 4u) - 1u);
91 const uint64_t thickness_mask = ((1u << 1u) - 1u);
92 const uint64_t displacement_mask = ((1u << 1u) - 1u);
94 pipeline_type =
static_cast<eMaterialPipeline>((shader_uuid >> 4u) & pipeline_mask);
96 thickness_type =
static_cast<eMaterialThickness>((shader_uuid >> 9u) & thickness_mask);
97 transparent_shadows = (shader_uuid >> 10u) & 1u;
105 char blend_flags = 0)
114 uuid = geometry_type;
115 uuid |= pipeline_type << 4;
116 uuid |= displacement_type << 8;
117 uuid |= thickness_type << 9;
118 uuid |= transparent_shadows << 10;
183 int closure_data_slots = 0;
188 closure_data_slots |= (1 << 2);
191 closure_data_slots |= (1 << 0);
195 closure_data_slots |= (1 << 0);
198 closure_data_slots |= (1 << 0);
201 closure_data_slots |= (1 << 0);
204 closure_data_slots |= (1 << 1);
207 closure_data_slots |= (1 << 2);
237 short visibility_flags)
381 return default_materials_load(
false);
385 return default_materials_load(
true);
405 ShaderGroups default_materials_load(
bool block_until_ready =
false);
MINLINE int count_bits_i(unsigned int n)
#define ENUM_OPERATORS(_type, _max)
@ MA_BL_TRANSPARENT_SHADOW
@ MA_DISPLACEMENT_DISPLACE
blender::gpu::Shader * GPU_material_get_shader(GPUMaterial *material)
bool GPU_material_flag_get(const GPUMaterial *mat, eGPUMaterialFlag flag)
@ GPU_MATFLAG_SHADER_TO_RGBA
@ GPU_MATFLAG_TRANSLUCENT
@ GPU_MATFLAG_TRANSPARENT
unsigned long long int uint64_t
detail::PassBase< command::DrawMultiBuf > Sub
A running instance of the engine.
MaterialModule(Instance &inst)
ShaderGroups default_materials_load_async()
::Material * default_volume
Material & material_get(Object *ob, bool has_motion, int mat_nr, eMaterialGeometry geometry_type)
::Material * metallic_mat
int64_t queued_textures_count
MaterialArray & material_array_get(Object *ob, bool has_motion)
::Material * default_surface
ShaderGroups default_materials_wait_ready()
int64_t queued_optimize_shaders_count
int64_t queued_shaders_count
::Material * material_override
static eMaterialDisplacement to_displacement_type(int displacement_method)
static bool geometry_type_has_surface(eMaterialGeometry geometry_type)
@ CLOSURE_AMBIENT_OCCLUSION
static eMaterialGeometry to_material_geometry(const Object *ob)
static eClosureBits shader_closure_bits_from_flag(const GPUMaterial *gpumat)
static void material_type_from_shader_uuid(uint64_t shader_uuid, eMaterialPipeline &pipeline_type, eMaterialGeometry &geometry_type, eMaterialDisplacement &displacement_type, eMaterialThickness &thickness_type, bool &transparent_shadows)
static uint64_t shader_uuid_from_material_type(eMaterialPipeline pipeline_type, eMaterialGeometry geometry_type, eMaterialDisplacement displacement_type=MAT_DISPLACEMENT_BUMP, eMaterialThickness thickness_type=MAT_THICKNESS_SPHERE, char blend_flags=0)
static int to_gbuffer_bin_count(const eClosureBits closure_bits)
static eMaterialThickness to_thickness_type(int thickness_mode)
@ MAT_DISPLACEMENT_VERTEX_WITH_BUMP
Vector< GPUMaterial * > gpu_materials
Vector< Material > materials
MaterialKey(::Material *mat_, eMaterialGeometry geometry, eMaterialPipeline pipeline, short visibility_flags)
bool operator==(const MaterialKey &k) const
bool is_alpha_blend_transparent
MaterialPass overlap_masking
MaterialPass volume_material
MaterialPass planar_probe_prepass
bool has_transparent_shadows
MaterialPass planar_probe_shading
MaterialPass volume_occupancy
MaterialPass lightprobe_sphere_shading
MaterialPass lightprobe_sphere_prepass
ShaderKey(GPUMaterial *gpumat, ::Material *blender_mat, eMaterialProbe probe_capture)
bool operator==(const ShaderKey &k) const