58 metallic_socket_->
value = ma->metallic;
59 roughness_socket_->
value = ma->roughness;
60 specular_socket_->
value = ma->spec;
126 error_mat_->nodetree =
ntree;
127 error_mat_->use_nodes =
true;
148 for (
Material *mat : material_map_.values()) {
160 for (
Material *mat : material_map_.values()) {
170 bNodeTree *
ntree = (blender_mat->use_nodes && blender_mat->nodetree !=
nullptr) ?
171 blender_mat->nodetree :
176 blender_mat,
ntree, pipeline_type, geometry_type,
true);
186 blender_mat, blender_mat->nodetree, pipeline_type, geometry_type,
false);
191 error_mat_, error_mat_->nodetree, pipeline_type, geometry_type,
false);
212 ShaderKey shader_key(matpass.
gpumat, geometry_type, pipeline_type);
218 DRWShadingGroup *grp = shader_map_.lookup_or_add_cb(shader_key, add_cb);
220 if (grp !=
nullptr) {
250 MaterialKey material_key(blender_mat, geometry_type, surface_pipe);
253 auto add_cb = [&]() {
return new Material(); };
254 Material &mat = *material_map_.lookup_or_add_cb(material_key, add_cb);
260 mat.prepass = material_pass_get(blender_mat, prepass_pipe, geometry_type);
261 mat.shading = material_pass_get(blender_mat, surface_pipe, geometry_type);
263 mat.shadow = MaterialPass();
266 mat.shadow = material_pass_get(blender_mat,
MAT_PIPE_SHADOW, geometry_type);
299 ::Material *blender_mat = material_from_slot(ob, i);
304 return material_array_;
312 ::Material *blender_mat = material_from_slot(ob, mat_nr);
313 Material &mat = material_sync(blender_mat, geometry_type, has_motion);
void * BKE_id_new_nomain(short type, const char *name)
void BKE_id_free(struct Main *bmain, void *idv)
General operations, lookup, etc. for materials.
struct Material * BKE_material_default_surface(void)
struct Material * BKE_object_material_get(struct Object *ob, short act)
struct Material * BKE_material_default_holdout(void)
struct Material * BKE_material_default_volume(void)
#define SH_NODE_BSDF_PRINCIPLED
#define SH_NODE_BSDF_DIFFUSE
#define SH_NODE_OUTPUT_MATERIAL
void ntreeFreeEmbeddedTree(struct bNodeTree *ntree)
struct bNodeLink * nodeAddLink(struct bNodeTree *ntree, struct bNode *fromnode, struct bNodeSocket *fromsock, struct bNode *tonode, struct bNodeSocket *tosock)
struct bNodeSocket * nodeFindSocket(const struct bNode *node, eNodeSocketInOut in_out, const char *identifier)
#define SH_NODE_BSDF_GLOSSY
struct bNodeTree * ntreeAddTree(struct Main *bmain, const char *name, const char *idname)
struct bNode * nodeAddStaticNode(const struct bContext *C, struct bNodeTree *ntree, int type)
void nodeSetActive(struct bNodeTree *ntree, struct bNode *node)
MINLINE void copy_v3_fl3(float v[3], float x, float y, float z)
MINLINE void copy_v3_fl(float r[3], float f)
bool GPU_material_flag_get(const GPUMaterial *mat, eGPUMaterialFlag flag)
bool GPU_material_recalc_flag_get(GPUMaterial *mat)
eGPUMaterialStatus GPU_material_status(GPUMaterial *mat)
@ GPU_MATFLAG_SHADER_TO_RGBA
@ GPU_MATFLAG_TRANSPARENT
struct bNodeTreeType * ntreeType_Shader
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
void append(const T &value)
bNodeTree * nodetree_get(::Material *ma)
~DefaultSurfaceNodeTree()
A running instance of the engine.
MaterialModule(Instance &inst)
Material & material_get(Object *ob, bool has_motion, int mat_nr, eMaterialGeometry geometry_type)
MaterialArray & material_array_get(Object *ob, bool has_motion)
int64_t queued_shaders_count
DRWShadingGroup * material_add(::Material *blender_mat, GPUMaterial *gpumat, eMaterialPipeline pipeline_type)
GPUMaterial * material_shader_get(::Material *blender_mat, struct bNodeTree *nodetree, eMaterialPipeline pipeline_type, eMaterialGeometry geometry_type, bool deferred_compilation)
int DRW_cache_object_material_count_get(struct Object *ob)
void DRW_shgroup_add_material_resources(DRWShadingGroup *grp, struct GPUMaterial *material)
DRWShadingGroup * DRW_shgroup_create_sub(DRWShadingGroup *shgroup)
ccl_global KernelShaderEvalInput ccl_global float * output
static eMaterialGeometry to_material_geometry(const Object *ob)
@ MAT_PIPE_DEFERRED_PREPASS_VELOCITY
@ MAT_PIPE_FORWARD_PREPASS_VELOCITY
@ MAT_PIPE_DEFERRED_PREPASS
@ MAT_PIPE_FORWARD_PREPASS
static const pxr::TfToken roughness("roughness", pxr::TfToken::Immortal)
Vector< Material * > materials
Vector< GPUMaterial * > gpu_materials