Eevee-Next: World Reflective Light #108149

Merged
Jeroen Bakker merged 33 commits from Jeroen-Bakker/blender:eevee-next-world-shader into main 2023-06-29 15:25:04 +02:00
2 changed files with 10 additions and 37 deletions
Showing only changes of commit 7bd30acde7 - Show all commits

View File

@ -8,23 +8,13 @@ namespace blender::eevee {
void ReflectionProbeModule::init()
{
if (cubemaps_.is_empty()) {
cubemaps_.reserve(max_probes);
/* Initialize the world cubemap. */
ReflectionProbe world_cubemap;
world_cubemap.type = ReflectionProbe::Type::WORLD;
world_cubemap.is_dirty = true;
cubemaps_.append(world_cubemap);
cubemaps_tx_.ensure_cube_array(GPU_RGBA16F,
max_resolution,
max_probes,
GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT,
NULL,
max_mipmap_levels);
GPU_texture_mipmap_mode(cubemaps_tx_, true, true);
}
cubemaps_tx_.ensure_cube_array(GPU_RGBA16F,
max_resolution_,
max_probes_,
GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT,
NULL,
max_mipmap_levels_);
GPU_texture_mipmap_mode(cubemaps_tx_, true, true);
}
} // namespace blender::eevee

View File

@ -34,39 +34,22 @@ class CaptureView;
/* -------------------------------------------------------------------- */
/** \name Reflection Probes
* \{ */
class ReflectionProbe {
public:
enum Type { UNUSED, WORLD };
Type type;
bool is_dirty = false;
bool needs_update() const;
};
class ReflectionProbeModule {
Jeroen-Bakker marked this conversation as resolved Outdated

Style: Uppercase enum members.

Style: Uppercase enum members.
private:
/** The max number of probes to track. */
static constexpr int max_probes = 1;
static constexpr int max_probes_ = 1;
/**
* The maximum resolution of a cubemap side.
*
* Must be a power of two; intension to be used as a cubemap atlas.
*/
static constexpr int max_resolution = 2048;
static constexpr int max_mipmap_levels = log(max_resolution) + 1;
/**
* Index of the probe that is used for world background.
*
* NOTE: First probe always contains the world probe.
*/
static constexpr int world_slot = 0;
static constexpr int max_resolution_ = 2048;
static constexpr int max_mipmap_levels_ = log(max_resolution_) + 1;
Jeroen-Bakker marked this conversation as resolved Outdated

Style: No uppercase

Style: No uppercase
Instance &instance_;
Vector<ReflectionProbe> cubemaps_;
Texture cubemaps_tx_ = {"Probes"};
public: