diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-05-02 10:22:14 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-05-02 10:35:45 +0300 |
commit | 8ece0816d9ddf25c4fc695bf244ed2e261433ee2 (patch) | |
tree | 087bf6a6a1890609801bb71aecd100856c7ea44a /source/blender/draw/engines/eevee_next/eevee_world.hh | |
parent | f0f44fd92f1684552ee0275d14bb6dd72405c8fd (diff) |
EEVEE: Rewrite: Implement nodetree support with every geometry types
This commit introduce back support for all geometry types and all nodetree support.
Only the forward shading pipeline is implemented for now.
Vertex Displacement is automatically enabled for now.
Lighting & Shading is placeholder.
Related Task: T93220
# Conflicts:
# source/blender/draw/engines/eevee_next/eevee_engine.cc
# source/blender/gpu/CMakeLists.txt
Diffstat (limited to 'source/blender/draw/engines/eevee_next/eevee_world.hh')
-rw-r--r-- | source/blender/draw/engines/eevee_next/eevee_world.hh | 64 |
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 |