Eevee-Next: World Reflective Light #108149
|
@ -8,23 +8,13 @@ namespace blender::eevee {
|
||||||
|
|
||||||
void ReflectionProbeModule::init()
|
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,
|
cubemaps_tx_.ensure_cube_array(GPU_RGBA16F,
|
||||||
max_resolution,
|
max_resolution_,
|
||||||
max_probes,
|
max_probes_,
|
||||||
GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT,
|
GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT,
|
||||||
NULL,
|
NULL,
|
||||||
max_mipmap_levels);
|
max_mipmap_levels_);
|
||||||
GPU_texture_mipmap_mode(cubemaps_tx_, true, true);
|
GPU_texture_mipmap_mode(cubemaps_tx_, true, true);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace blender::eevee
|
} // namespace blender::eevee
|
||||||
|
|
|
@ -34,39 +34,22 @@ class CaptureView;
|
||||||
/* -------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------- */
|
||||||
/** \name Reflection Probes
|
/** \name Reflection Probes
|
||||||
* \{ */
|
* \{ */
|
||||||
class ReflectionProbe {
|
|
||||||
public:
|
|
||||||
enum Type { UNUSED, WORLD };
|
|
||||||
|
|
||||||
Type type;
|
|
||||||
bool is_dirty = false;
|
|
||||||
|
|
||||||
bool needs_update() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
class ReflectionProbeModule {
|
class ReflectionProbeModule {
|
||||||
Jeroen-Bakker marked this conversation as resolved
Outdated
|
|||||||
private:
|
private:
|
||||||
/** The max number of probes to track. */
|
/** 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.
|
* The maximum resolution of a cubemap side.
|
||||||
*
|
*
|
||||||
* Must be a power of two; intension to be used as a cubemap atlas.
|
* Must be a power of two; intension to be used as a cubemap atlas.
|
||||||
*/
|
*/
|
||||||
static constexpr int max_resolution = 2048;
|
static constexpr int max_resolution_ = 2048;
|
||||||
static constexpr int max_mipmap_levels = log(max_resolution) + 1;
|
static constexpr int max_mipmap_levels_ = log(max_resolution_) + 1;
|
||||||
Jeroen-Bakker marked this conversation as resolved
Outdated
Clément Foucault
commented
Style: No uppercase Style: No uppercase
|
|||||||
|
|
||||||
/**
|
|
||||||
* Index of the probe that is used for world background.
|
|
||||||
*
|
|
||||||
* NOTE: First probe always contains the world probe.
|
|
||||||
*/
|
|
||||||
static constexpr int world_slot = 0;
|
|
||||||
|
|
||||||
Instance &instance_;
|
Instance &instance_;
|
||||||
|
|
||||||
Vector<ReflectionProbe> cubemaps_;
|
|
||||||
Texture cubemaps_tx_ = {"Probes"};
|
Texture cubemaps_tx_ = {"Probes"};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in New Issue
Style: Uppercase enum members.