diff options
author | Thomas Herzog <therzog@mail.de> | 2018-08-23 17:08:16 +0200 |
---|---|---|
committer | Thomas Herzog <therzog@mail.de> | 2018-08-23 17:08:16 +0200 |
commit | a7bedaf935c979b4c369ce05e1ff2ac164cf8440 (patch) | |
tree | 70fea35e280af73ec8305d5f2b604a35c1d244db /drivers/gles2 | |
parent | d1497b720eb34da7797e5107c357f6ed17b37297 (diff) |
[GLES2] attempt to fix some android problems
Diffstat (limited to 'drivers/gles2')
-rw-r--r-- | drivers/gles2/rasterizer_scene_gles2.cpp | 6 | ||||
-rw-r--r-- | drivers/gles2/shaders/cubemap_filter.glsl | 7 | ||||
-rw-r--r-- | drivers/gles2/shaders/scene.glsl | 7 |
3 files changed, 15 insertions, 5 deletions
diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp index 288a144b32..5d20868294 100644 --- a/drivers/gles2/rasterizer_scene_gles2.cpp +++ b/drivers/gles2/rasterizer_scene_gles2.cpp @@ -107,7 +107,7 @@ void RasterizerSceneGLES2::shadow_atlas_set_size(RID p_atlas, int p_size) { glActiveTexture(GL_TEXTURE0); glGenTextures(1, &shadow_atlas->depth); glBindTexture(GL_TEXTURE_2D, shadow_atlas->depth); - glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16, shadow_atlas->size, shadow_atlas->size, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); + glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, shadow_atlas->size, shadow_atlas->size, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); @@ -2401,7 +2401,7 @@ void RasterizerSceneGLES2::initialize() { glBindTexture(GL_TEXTURE_CUBE_MAP, cube.cubemap); for (int i = 0; i < 6; i++) { - glTexImage2D(_cube_side_enum[i], 0, GL_DEPTH_COMPONENT16, cube_size, cube_size, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, NULL); + glTexImage2D(_cube_side_enum[i], 0, GL_DEPTH_COMPONENT, cube_size, cube_size, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, NULL); } glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_NEAREST); @@ -2435,7 +2435,7 @@ void RasterizerSceneGLES2::initialize() { glGenTextures(1, &directional_shadow.depth); glBindTexture(GL_TEXTURE_2D, directional_shadow.depth); - glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16, directional_shadow.size, directional_shadow.size, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); + glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, directional_shadow.size, directional_shadow.size, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); diff --git a/drivers/gles2/shaders/cubemap_filter.glsl b/drivers/gles2/shaders/cubemap_filter.glsl index 62ecd9471b..35f0a16325 100644 --- a/drivers/gles2/shaders/cubemap_filter.glsl +++ b/drivers/gles2/shaders/cubemap_filter.glsl @@ -21,7 +21,12 @@ void main() { [fragment] -#extension GL_ARB_shader_texture_lod : require +#extension GL_ARB_shader_texture_lod : enable + +#ifndef GL_ARB_shader_texture_lod +#define texture2DLod(img, coord, lod) texture2D(img, coord) +#define textureCubeLod(img, coord, lod) textureCube(img, coord) +#endif #ifdef USE_GLES_OVER_GL #define mediump diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl index 3e64c92e96..204f22c046 100644 --- a/drivers/gles2/shaders/scene.glsl +++ b/drivers/gles2/shaders/scene.glsl @@ -262,7 +262,12 @@ VERTEX_SHADER_CODE } [fragment] -#extension GL_ARB_shader_texture_lod : require +#extension GL_ARB_shader_texture_lod : enable + +#ifndef GL_ARB_shader_texture_lod +#define texture2DLod(img, coord, lod) texture2D(img, coord) +#define textureCubeLod(img, coord, lod) textureCube(img, coord) +#endif #ifdef USE_GLES_OVER_GL #define mediump |