WIP: eevee-next-world-irradiance #108304

Closed
Jeroen Bakker wants to merge 79 commits from Jeroen-Bakker:eevee-next-world-irradiance into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
4 changed files with 5 additions and 3 deletions
Showing only changes of commit a58620c766 - Show all commits

View File

@ -80,7 +80,7 @@ void WorldProbePipeline::sync()
side.cubemap_face_ps.state_set(DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_ALWAYS); side.cubemap_face_ps.state_set(DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_ALWAYS);
} }
const int2 extent(1); const int2 extent(1);
const eGPUTextureUsage usage = GPU_TEXTURE_USAGE_MEMORYLESS | GPU_TEXTURE_USAGE_SHADER_WRITE; constexpr eGPUTextureUsage usage = GPU_TEXTURE_USAGE_MEMORYLESS | GPU_TEXTURE_USAGE_SHADER_WRITE;
dummy_cryptomatte_tx_.ensure_2d(GPU_RGBA32F, extent, usage); dummy_cryptomatte_tx_.ensure_2d(GPU_RGBA32F, extent, usage);
dummy_renderpass_tx_.ensure_2d(GPU_RGBA16F, extent, usage); dummy_renderpass_tx_.ensure_2d(GPU_RGBA16F, extent, usage);
dummy_aov_color_tx_.ensure_2d_array(GPU_RGBA16F, extent, 1, usage); dummy_aov_color_tx_.ensure_2d_array(GPU_RGBA16F, extent, 1, usage);

View File

@ -22,7 +22,7 @@ void ReflectionProbeModule::init()
MAX_PROBES, MAX_PROBES,
GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT, GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT,
NULL, NULL,
12); MIPMAP_LEVELS);
GPU_texture_mipmap_mode(cubemaps_tx_, true, true); GPU_texture_mipmap_mode(cubemaps_tx_, true, true);
} }
} }

View File

@ -54,6 +54,7 @@ class ReflectionProbeModule {
* 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 MIPMAP_LEVELS = 12;
/** /**
* Index of the probe that is used for world background. * Index of the probe that is used for world background.

View File

@ -6,7 +6,8 @@ void light_world_eval(ClosureDiffuse diffuse,
inout vec3 out_specular) inout vec3 out_specular)
{ {
float linear_roughness = fast_sqrt(reflection.roughness); float linear_roughness = fast_sqrt(reflection.roughness);
/* TODO: This should be based by actual LOD?.*/ /* TODO: This should be based by actual resolution. Currently the resolution is fixed but
* eventually this should based on a user setting. */
float lod_cube_max = 12.0; float lod_cube_max = 12.0;
float lod = linear_roughness * lod_cube_max; float lod = linear_roughness * lod_cube_max;