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()
87 if (inst_.is_baking()) {
92 if (inst_.use_studio_light()) {
101 bool has_update =
false;
104 if (inst_.scene->world !=
nullptr) {
106 wo_handle = inst_.sync.sync_world(*inst_.scene->world);
107 has_update = wo_handle.
recalc != 0;
111 sync_volume(wo_handle);
114 if (inst_.use_studio_light()) {
116 bl_world = lookdev_world_.world_get();
118 else if ((inst_.view_layer->layflag &
SCE_LAY_SKY) == 0) {
119 bl_world = default_world_get();
121 else if (has_volume_absorption_) {
122 bl_world = default_world_get();
125 bl_world = scene_world_get();
130 default_tree.nodetree_get(bl_world);
133 if (has_volume_absorption_) {
135 bl_world = default_world_get();
145 inst_.light_probes.sync_world(bl_world, has_update);
149 inst_.manager->register_layer_attributes(gpumat);
151 float opacity = inst_.use_studio_light() ? lookdev_world_.background_opacity_get() :
152 inst_.film.background_opacity_get();
153 float background_blur = inst_.use_studio_light() ? lookdev_world_.background_blur_get() : 0.0;
155 inst_.pipelines.background.sync(gpumat, opacity, background_blur);
156 inst_.pipelines.world.sync(gpumat);
159void World::sync_volume(
const WorldHandle &world_handle)
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
#define SH_NODE_BACKGROUND
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
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between world
bNodeTree * nodetree_get(::World *world)
bool use_studio_light() const
WorldVolumePipeline world_volume
GPUMaterial * world_shader_get(::World *blender_world, bNodeTree *nodetree, eMaterialPipeline pipeline_type)
void world_sync(const WorldHandle &world_handle)
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)
struct bNodeTree * nodetree