Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/draw/engines/eevee_next/eevee_world.hh')
-rw-r--r--source/blender/draw/engines/eevee_next/eevee_world.hh64
1 files changed, 64 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee_next/eevee_world.hh b/source/blender/draw/engines/eevee_next/eevee_world.hh
new file mode 100644
index 00000000000..a7b77ef2e62
--- /dev/null
+++ b/source/blender/draw/engines/eevee_next/eevee_world.hh
@@ -0,0 +1,64 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later
+ * Copyright 2021 Blender Foundation.
+ */
+
+/** \file
+ * \ingroup eevee
+ *
+ * World rendering with material handling. Also take care of lookdev
+ * HDRI and default material.
+ */
+
+#pragma once
+
+#include "DNA_world_types.h"
+
+namespace blender::eevee {
+
+class Instance;
+
+/* -------------------------------------------------------------------- */
+/** \name Default World Nodetree
+ *
+ * In order to support worlds without nodetree we reuse and configure a standalone nodetree that
+ * we pass for shader generation. The GPUMaterial is still stored inside the World even if
+ * it does not use a nodetree.
+ * \{ */
+
+class DefaultWorldNodeTree {
+ private:
+ bNodeTree *ntree_;
+ bNodeSocketValueRGBA *color_socket_;
+
+ public:
+ DefaultWorldNodeTree();
+ ~DefaultWorldNodeTree();
+
+ bNodeTree *nodetree_get(::World *world);
+};
+
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name World
+ *
+ * \{ */
+
+class World {
+ private:
+ Instance &inst_;
+
+ DefaultWorldNodeTree default_tree;
+
+ /* Used to detect if world change. */
+ ::World *prev_original_world = nullptr;
+
+ public:
+ World(Instance &inst) : inst_(inst){};
+
+ void sync(void);
+};
+
+/** \} */
+
+} // namespace blender::eevee