diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-07-06 22:06:16 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-07-15 20:51:55 +0300 |
commit | 37a8c6d809f48c4e5e3c8927f22bde5778705d90 (patch) | |
tree | fb183396ae3184e942b0bade61e4337518409cd3 /source/blender/draw/engines | |
parent | 47885abbe69555fc0ea1eebede1ae820055182ee (diff) |
Cleanup: EEVEE: Remove unused IRRADIANCE_CUBEMAP
Diffstat (limited to 'source/blender/draw/engines')
7 files changed, 4 insertions, 67 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.c b/source/blender/draw/engines/eevee/eevee_lightcache.c index 93d60d7518f..78fcd28eb5d 100644 --- a/source/blender/draw/engines/eevee/eevee_lightcache.c +++ b/source/blender/draw/engines/eevee/eevee_lightcache.c @@ -53,9 +53,6 @@ #if defined(IRRADIANCE_SH_L2) # define IRRADIANCE_SAMPLE_SIZE_X 4 /* 3 in reality */ # define IRRADIANCE_SAMPLE_SIZE_Y 4 /* 3 in reality */ -#elif defined(IRRADIANCE_CUBEMAP) -# define IRRADIANCE_SAMPLE_SIZE_X 8 -# define IRRADIANCE_SAMPLE_SIZE_Y 8 #elif defined(IRRADIANCE_HL2) # define IRRADIANCE_SAMPLE_SIZE_X 4 /* 3 in reality */ # define IRRADIANCE_SAMPLE_SIZE_Y 2 diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c index 71c8294d123..72187dc29eb 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobes.c +++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c @@ -179,8 +179,6 @@ void EEVEE_lightprobes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) if (!sldata->fallback_lightcache) { #if defined(IRRADIANCE_SH_L2) int grid_res = 4; -#elif defined(IRRADIANCE_CUBEMAP) - int grid_res = 8; #elif defined(IRRADIANCE_HL2) int grid_res = 4; #endif @@ -1114,9 +1112,6 @@ void EEVEE_lightbake_filter_diffuse(EEVEE_ViewLayerData *sldata, /* NOTE : Keep in sync with load_irradiance_cell() */ #if defined(IRRADIANCE_SH_L2) int size[2] = {3, 3}; -#elif defined(IRRADIANCE_CUBEMAP) - int size[2] = {8, 8}; - pinfo->samples_len = 1024.0f; #elif defined(IRRADIANCE_HL2) int size[2] = {3, 2}; pinfo->samples_len = 1024.0f; diff --git a/source/blender/draw/engines/eevee/eevee_lookdev.c b/source/blender/draw/engines/eevee/eevee_lookdev.c index b89772441fa..b044213e029 100644 --- a/source/blender/draw/engines/eevee/eevee_lookdev.c +++ b/source/blender/draw/engines/eevee/eevee_lookdev.c @@ -170,8 +170,6 @@ void EEVEE_lookdev_cache_init(EEVEE_Data *vedata, if (stl->lookdev_lightcache == NULL) { #if defined(IRRADIANCE_SH_L2) int grid_res = 4; -#elif defined(IRRADIANCE_CUBEMAP) - int grid_res = 8; #elif defined(IRRADIANCE_HL2) int grid_res = 4; #endif diff --git a/source/blender/draw/engines/eevee/eevee_private.h b/source/blender/draw/engines/eevee/eevee_private.h index 1b1355fdecd..81a50d36e17 100644 --- a/source/blender/draw/engines/eevee/eevee_private.h +++ b/source/blender/draw/engines/eevee/eevee_private.h @@ -53,14 +53,11 @@ extern struct DrawEngineType draw_engine_eevee_type; /* Only define one of these. */ // #define IRRADIANCE_SH_L2 -// #define IRRADIANCE_CUBEMAP #define IRRADIANCE_HL2 #define HAMMERSLEY_SIZE 1024 #if defined(IRRADIANCE_SH_L2) # define SHADER_IRRADIANCE "#define IRRADIANCE_SH_L2\n" -#elif defined(IRRADIANCE_CUBEMAP) -# define SHADER_IRRADIANCE "#define IRRADIANCE_CUBEMAP\n" #elif defined(IRRADIANCE_HL2) # define SHADER_IRRADIANCE "#define IRRADIANCE_HL2\n" #endif diff --git a/source/blender/draw/engines/eevee/shaders/irradiance_lib.glsl b/source/blender/draw/engines/eevee/shaders/irradiance_lib.glsl index b1d4de1c682..64ea87001f4 100644 --- a/source/blender/draw/engines/eevee/shaders/irradiance_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/irradiance_lib.glsl @@ -3,11 +3,7 @@ uniform sampler2DArray irradianceGrid; #define IRRADIANCE_LIB -#ifdef IRRADIANCE_CUBEMAP -struct IrradianceData { - vec3 color; -}; -#elif defined(IRRADIANCE_SH_L2) +#if defined(IRRADIANCE_SH_L2) struct IrradianceData { vec3 shcoefs[9]; }; @@ -21,24 +17,7 @@ IrradianceData load_irradiance_cell(int cell, vec3 N) { /* Keep in sync with diffuse_filter_probe() */ -#if defined(IRRADIANCE_CUBEMAP) - -# define AMBIANT_CUBESIZE 8 - ivec2 cell_co = ivec2(AMBIANT_CUBESIZE); - int cell_per_row = textureSize(irradianceGrid, 0).x / cell_co.x; - cell_co.x *= cell % cell_per_row; - cell_co.y *= cell / cell_per_row; - - vec2 texelSize = 1.0 / vec2(AMBIANT_CUBESIZE); - - vec2 uvs = mapping_octahedron(N, texelSize); - uvs *= vec2(AMBIANT_CUBESIZE) / vec2(textureSize(irradianceGrid, 0)); - uvs += vec2(cell_co) / vec2(textureSize(irradianceGrid, 0)); - - IrradianceData ir; - ir.color = texture(irradianceGrid, vec3(uvs, 0.0)).rgb; - -#elif defined(IRRADIANCE_SH_L2) +#if defined(IRRADIANCE_SH_L2) ivec2 cell_co = ivec2(3, 3); int cell_per_row = textureSize(irradianceGrid, 0).x / cell_co.x; @@ -164,9 +143,7 @@ vec3 hl2_basis(vec3 N, vec3 cubesides[3]) vec3 compute_irradiance(vec3 N, IrradianceData ird) { -#if defined(IRRADIANCE_CUBEMAP) - return ird.color; -#elif defined(IRRADIANCE_SH_L2) +#if defined(IRRADIANCE_SH_L2) return spherical_harmonics_L2(N, ird.shcoefs); #else /* defined(IRRADIANCE_HL2) */ return hl2_basis(N, ird.cubesides); diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl index 296c1581545..b485511318b 100644 --- a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl @@ -111,32 +111,7 @@ void main() FragColor = vec4(sh, 1.0); #else -# if defined(IRRADIANCE_CUBEMAP) - /* Downside: Need lots of memory for storage, distortion due to octahedral mapping */ - const vec2 map_size = vec2(16.0); - const vec2 texelSize = 1.0 / map_size; - vec2 uvs = mod(gl_FragCoord.xy, map_size) * texelSize; - const float paddingSize = 1.0; - - /* Add a N pixel border to ensure filtering is correct - * for N mipmap levels. */ - uvs = (uvs - texelSize * paddingSize) / (1.0 - 2.0 * texelSize * paddingSize); - - /* edge mirroring : only mirror if directly adjacent - * (not diagonally adjacent) */ - vec2 m = abs(uvs - 0.5) + 0.5; - vec2 f = floor(m); - if (f.x - f.y != 0.0) { - uvs = 1.0 - uvs; - } - - /* clamp to [0-1] */ - uvs = fract(uvs); - - /* get cubemap vector */ - vec3 cubevec = octahedral_to_cubemap_proj(uvs); - -# elif defined(IRRADIANCE_HL2) +# if defined(IRRADIANCE_HL2) /* Downside: very very low resolution (6 texels), bleed lighting because of interpolation */ int x = int(gl_FragCoord.x) % 3; int y = int(gl_FragCoord.y) % 2; diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_grid_fill_frag.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_grid_fill_frag.glsl index 7cab5146b09..71e4d6e2c4a 100644 --- a/source/blender/draw/engines/eevee/shaders/lightprobe_grid_fill_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/lightprobe_grid_fill_frag.glsl @@ -6,8 +6,6 @@ void main() { #if defined(IRRADIANCE_SH_L2) const ivec2 data_size = ivec2(3, 3); -#elif defined(IRRADIANCE_CUBEMAP) - const ivec2 data_size = ivec2(8, 8); #elif defined(IRRADIANCE_HL2) const ivec2 data_size = ivec2(3, 2); #endif |