diff options
author | clayjohn <claynjohn@gmail.com> | 2020-01-18 16:38:20 -0800 |
---|---|---|
committer | clayjohn <claynjohn@gmail.com> | 2020-01-18 16:51:52 -0800 |
commit | 0979411cad1a07259cee5f62e1d2e77bd3ac6c62 (patch) | |
tree | 46e6573787ba2afb3f2373bac6f6043ff6e466ed /drivers/gles3/shaders | |
parent | d4a222cd9d849a63f0535f70cbf78700bc5c815b (diff) |
reduce complexity of irradiance map generation
Diffstat (limited to 'drivers/gles3/shaders')
-rw-r--r-- | drivers/gles3/shaders/copy.glsl | 8 | ||||
-rw-r--r-- | drivers/gles3/shaders/cubemap_filter.glsl | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/drivers/gles3/shaders/copy.glsl b/drivers/gles3/shaders/copy.glsl index 1952e201aa..a3cdb3a543 100644 --- a/drivers/gles3/shaders/copy.glsl +++ b/drivers/gles3/shaders/copy.glsl @@ -104,6 +104,10 @@ uniform sampler2D CbCr; //texunit:1 /* clang-format on */ +#ifdef USE_LOD +uniform float mip_level; +#endif + #if defined(USE_TEXTURE3D) || defined(USE_TEXTURE2DARRAY) uniform float layer; #endif @@ -190,8 +194,12 @@ void main() { color.gb = textureLod(CbCr, uv_interp, 0.0).rg - vec2(0.5, 0.5); color.a = 1.0; #else +#ifdef USE_LOD + vec4 color = textureLod(source, uv_interp, mip_level); +#else vec4 color = textureLod(source, uv_interp, 0.0); #endif +#endif #ifdef LINEAR_TO_SRGB // regular Linear -> SRGB conversion diff --git a/drivers/gles3/shaders/cubemap_filter.glsl b/drivers/gles3/shaders/cubemap_filter.glsl index 3f3313c3a7..15d4e2d58e 100644 --- a/drivers/gles3/shaders/cubemap_filter.glsl +++ b/drivers/gles3/shaders/cubemap_filter.glsl @@ -183,12 +183,12 @@ vec2 Hammersley(uint i, uint N) { #ifdef LOW_QUALITY #define SAMPLE_COUNT 64u -#define SAMPLE_DELTA 0.05 +#define SAMPLE_DELTA 0.1 #else #define SAMPLE_COUNT 512u -#define SAMPLE_DELTA 0.01 +#define SAMPLE_DELTA 0.03 #endif |