61 if (default_world_ !=
nullptr) {
66::World *World::default_world_get()
68 if (default_world_ ==
nullptr) {
70 default_world_->horr = default_world_->horg = default_world_->horb = 0.0f;
71 default_world_->use_nodes = 0;
72 default_world_->nodetree =
nullptr;
75 return default_world_;
78::World *World::scene_world_get()
100 bool has_update =
false;
106 has_update = wo_handle.
recalc != 0;
109 bool wait_ready =
true;
112 sync_volume(wo_handle, wait_ready);
120 bl_world = default_world_get();
122 else if (has_volume_absorption_) {
123 bl_world = default_world_get();
126 bl_world = scene_world_get();
134 if (has_volume_absorption_) {
136 bl_world = default_world_get();
157 bl_world = default_world_get();
177void World::sync_volume(
const WorldHandle &world_handle,
bool wait_ready)
190 bool had_volume = has_volume_;
198 has_volume_ = has_volume_absorption_ = has_volume_scatter_ =
false;
204 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
#define SH_NODE_BACKGROUND
BLI_INLINE void BLI_listbase_clear(ListBase *lb)
MINLINE void copy_v3_fl3(float v[3], float x, float y, float z)
T * DEG_get_original(T *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, bool deferred_compilation)
WorldHandle sync_world(const ::World &world)
void world_sync(const WorldHandle &world_handle)
void sync(GPUMaterial *gpumat)
void sync(GPUMaterial *gpumat)
bNodeSocket * node_find_socket(bNode &node, eNodeSocketInOut in_out, StringRef identifier)
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, StringRef name, StringRef idname)
void node_set_active(bNodeTree &ntree, bNode &node)
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