74 switch (displacement_method) {
93 switch (thickness_mode) {
112 bool &transparent_shadows)
114 const uint64_t geometry_mask = ((1u << 4u) - 1u);
115 const uint64_t pipeline_mask = ((1u << 4u) - 1u);
116 const uint64_t thickness_mask = ((1u << 1u) - 1u);
117 const uint64_t displacement_mask = ((1u << 1u) - 1u);
119 pipeline_type =
static_cast<eMaterialPipeline>((shader_uuid >> 4u) & pipeline_mask);
121 thickness_type =
static_cast<eMaterialThickness>((shader_uuid >> 9u) & thickness_mask);
122 transparent_shadows = (shader_uuid >> 10u) & 1u;
130 char blend_flags = 0)
139 uuid = geometry_type;
140 uuid |= pipeline_type << 4;
141 uuid |= displacement_type << 8;
142 uuid |= thickness_type << 9;
143 uuid |= transparent_shadows << 10;
215 short visibility_flags)
399 return default_materials_load(
false);
403 return default_materials_load(
true);
423 ShaderGroups default_materials_load(
bool block_until_ready =
false);
#define ENUM_OPERATORS(_type, _max)
@ MA_DISPLACEMENT_DISPLACE
@ MA_BL_TRANSPARENT_SHADOW
GPUShader * 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
bNodeTree * nodetree_get(::Material *ma)
~DefaultSurfaceNodeTree()
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
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 eMaterialThickness to_thickness_type(int thickness_mode)
@ MAT_DISPLACEMENT_VERTEX_WITH_BUMP
@ MAT_PIPE_PREPASS_FORWARD_VELOCITY
@ MAT_PIPE_VOLUME_MATERIAL
@ MAT_PIPE_PREPASS_DEFERRED
@ MAT_PIPE_PREPASS_OVERLAP
@ MAT_PIPE_PREPASS_PLANAR
@ MAT_PIPE_PREPASS_DEFERRED_VELOCITY
@ MAT_PIPE_VOLUME_OCCUPANCY
@ MAT_PIPE_PREPASS_FORWARD
Vector< GPUMaterial * > gpu_materials
Vector< Material > materials
bool operator<(const MaterialKey &k) const
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
bool operator==(const ShaderKey &k) const