62 if (default_world_ !=
nullptr) {
67::World *World::default_world_get()
69 if (default_world_ ==
nullptr) {
71 default_world_->horr = default_world_->horg = default_world_->horb = 0.0f;
72 default_world_->use_nodes = 0;
73 default_world_->nodetree =
nullptr;
76 return default_world_;
79::World *World::scene_world_get()
101 bool has_update =
false;
107 has_update = wo_handle.
recalc != 0;
111 sync_volume(wo_handle);
119 bl_world = default_world_get();
121 else if (has_volume_absorption_) {
122 bl_world = default_world_get();
125 bl_world = scene_world_get();
133 if (has_volume_absorption_) {
135 bl_world = default_world_get();
159void World::sync_volume(
const WorldHandle &world_handle)
167 if (world && world->nodetree && world->use_nodes) {
171 bool had_volume = has_volume_;
179 has_volume_ = has_volume_absorption_ = has_volume_scatter_ =
false;
185 if (has_volume_ || had_volume) {
void BKE_id_free(Main *bmain, void *idv)
void * BKE_id_new_nomain(short type, const char *name)
#define SH_NODE_OUTPUT_WORLD
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
MINLINE void copy_v3_fl3(float v[3], float x, float y, float z)
ID * DEG_get_original_id(ID *id)
bool GPU_material_flag_get(const GPUMaterial *mat, eGPUMaterialFlag flag)
eGPUMaterialStatus GPU_material_status(GPUMaterial *mat)
@ GPU_MATFLAG_VOLUME_SCATTER
@ GPU_MATFLAG_VOLUME_ABSORPTION
bool GPU_material_has_volume_output(GPUMaterial *mat)
struct blender::bke::bNodeTreeType * ntreeType_Shader
void register_layer_attributes(GPUMaterial *material)
void sync(GPUMaterial *gpumat, float background_opacity, float background_blur)
bNodeTree * nodetree_get(::World *world)
float background_opacity_get() const
bool use_studio_light() const
LightProbeModule light_probes
void sync_world(const ::World *world, bool has_update)
float background_blur_get() const
float background_opacity_get() const
bool sync(const LookdevParameters &new_parameters)
WorldVolumePipeline world_volume
BackgroundPipeline background
GPUMaterial * world_shader_get(::World *blender_world, bNodeTree *nodetree, eMaterialPipeline pipeline_type)
WorldHandle sync_world(const ::World &world)
void world_sync(const WorldHandle &world_handle)
void sync(GPUMaterial *gpumat)
void sync(GPUMaterial *gpumat)
void node_set_active(bNodeTree *ntree, bNode *node)
bNode * node_add_static_node(const bContext *C, bNodeTree *ntree, int type)
bNodeLink * node_add_link(bNodeTree *ntree, bNode *fromnode, bNodeSocket *fromsock, bNode *tonode, bNodeSocket *tosock)
bNodeTree * node_tree_add_tree(Main *bmain, const char *name, const char *idname)
bNodeSocket * node_find_socket(bNode *node, eNodeSocketInOut in_out, StringRef identifier)
void node_tree_free_embedded_tree(bNodeTree *ntree)
@ MAT_PIPE_VOLUME_MATERIAL
bool assign_if_different(T &old_value, T new_value)
float studiolight_intensity
struct bNodeTree * nodetree