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
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);
}
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_renderpass_tx_.ensure_2d(GPU_RGBA16F, extent, usage);
dummy_aov_color_tx_.ensure_2d_array(GPU_RGBA16F, extent, 1, usage);

View File

@ -22,7 +22,7 @@ void ReflectionProbeModule::init()
MAX_PROBES,
GPU_TEXTURE_USAGE_SHADER_READ | GPU_TEXTURE_USAGE_ATTACHMENT,
NULL,
12);
MIPMAP_LEVELS);
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.
*/
static constexpr int MAX_RESOLUTION = 2048;
Jeroen-Bakker marked this conversation as resolved Outdated

I don't know if this is covered by the next patch, but this should become an option.

I don't know if this is covered by the next patch, but this should become an option.

Yes, that will be part of the reflection probe baking patch. Might even land earlier when specific parts of that patch are stable. Currently this part isn't stable to land in main yet.

Yes, that will be part of the reflection probe baking patch. Might even land earlier when specific parts of that patch are stable. Currently this part isn't stable to land in main yet.
static constexpr int MIPMAP_LEVELS = 12;
Jeroen-Bakker marked this conversation as resolved Outdated

Maybe derive it from MAX_RESOLUTION ? log2(MAX_RESOLUTION) + 1

Maybe derive it from `MAX_RESOLUTION` ? `log2(MAX_RESOLUTION) + 1`
/**
* 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)
{
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. */
Jeroen-Bakker marked this conversation as resolved Outdated

Check lightprobe_filter_glossy_frag

Check `lightprobe_filter_glossy_frag`
float lod_cube_max = 12.0;
float lod = linear_roughness * lod_cube_max;