diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gles2/rasterizer_storage_gles2.cpp | 9 | ||||
-rw-r--r-- | drivers/gles2/shaders/canvas.glsl | 10 | ||||
-rw-r--r-- | drivers/gles2/shaders/cubemap_filter.glsl | 8 | ||||
-rw-r--r-- | drivers/gles2/shaders/scene.glsl | 9 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_scene_gles3.cpp | 9 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_scene_gles3.h | 2 |
6 files changed, 18 insertions, 29 deletions
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index 8b8f902826..afdb45d28e 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -1137,7 +1137,7 @@ void RasterizerStorageGLES2::sky_set_texture(RID p_sky, RID p_panorama, int p_ra glGenTextures(1, &sky->radiance); glBindTexture(GL_TEXTURE_CUBE_MAP, sky->radiance); - int size = p_radiance_size / 4; //divide by four because its a cubemap (this is an approximation because GLES3 uses a dual paraboloid) + int size = p_radiance_size / 2; //divide by two because its a cubemap (this is an approximation because GLES3 uses a dual paraboloid) GLenum internal_format = GL_RGB; GLenum format = GL_RGB; @@ -1176,7 +1176,7 @@ void RasterizerStorageGLES2::sky_set_texture(RID p_sky, RID p_panorama, int p_ra int mipmaps = 6; int lod = 0; int mm_level = mipmaps; - size = p_radiance_size / 4; + size = p_radiance_size / 2; shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES2::USE_SOURCE_PANORAMA, true); shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES2::USE_DIRECT_WRITE, true); shaders.cubemap_filter.bind(); @@ -4733,6 +4733,7 @@ void RasterizerStorageGLES2::render_target_set_flag(RID p_render_target, RenderT rt->flags[p_flag] = p_value; switch (p_flag) { + case RENDER_TARGET_TRANSPARENT: case RENDER_TARGET_HDR: case RENDER_TARGET_NO_3D: case RENDER_TARGET_NO_SAMPLING: @@ -5468,7 +5469,9 @@ void RasterizerStorageGLES2::initialize() { #ifdef GLES_OVER_GL //this needs to be enabled manually in OpenGL 2.1 - glEnable(_EXT_TEXTURE_CUBE_MAP_SEAMLESS); + if (config.extensions.has("GL_ARB_seamless_cube_map")) { + glEnable(_EXT_TEXTURE_CUBE_MAP_SEAMLESS); + } glEnable(GL_POINT_SPRITE); glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); #endif diff --git a/drivers/gles2/shaders/canvas.glsl b/drivers/gles2/shaders/canvas.glsl index f72a0d288b..7ba2856216 100644 --- a/drivers/gles2/shaders/canvas.glsl +++ b/drivers/gles2/shaders/canvas.glsl @@ -220,29 +220,25 @@ VERTEX_SHADER_CODE /* clang-format off */ [fragment] +// texture2DLodEXT and textureCubeLodEXT are fragment shader specific. +// Do not copy these defines in the vertex section. #ifndef USE_GLES_OVER_GL - #ifdef GL_EXT_shader_texture_lod #extension GL_EXT_shader_texture_lod : enable #define texture2DLod(img, coord, lod) texture2DLodEXT(img, coord, lod) #define textureCubeLod(img, coord, lod) textureCubeLodEXT(img, coord, lod) #endif - -#endif +#endif // !USE_GLES_OVER_GL #ifdef GL_ARB_shader_texture_lod #extension GL_ARB_shader_texture_lod : enable #endif - #if !defined(GL_EXT_shader_texture_lod) && !defined(GL_ARB_shader_texture_lod) #define texture2DLod(img, coord, lod) texture2D(img, coord, lod) #define textureCubeLod(img, coord, lod) textureCube(img, coord, lod) #endif - - - #ifdef USE_GLES_OVER_GL #define lowp #define mediump diff --git a/drivers/gles2/shaders/cubemap_filter.glsl b/drivers/gles2/shaders/cubemap_filter.glsl index a6902836ed..db3d8b3a1b 100644 --- a/drivers/gles2/shaders/cubemap_filter.glsl +++ b/drivers/gles2/shaders/cubemap_filter.glsl @@ -25,15 +25,15 @@ void main() { /* clang-format off */ [fragment] +// texture2DLodEXT and textureCubeLodEXT are fragment shader specific. +// Do not copy these defines in the vertex section. #ifndef USE_GLES_OVER_GL - #ifdef GL_EXT_shader_texture_lod #extension GL_EXT_shader_texture_lod : enable #define texture2DLod(img, coord, lod) texture2DLodEXT(img, coord, lod) #define textureCubeLod(img, coord, lod) textureCubeLodEXT(img, coord, lod) #endif - -#endif +#endif // !USE_GLES_OVER_GL #ifdef GL_ARB_shader_texture_lod #extension GL_ARB_shader_texture_lod : enable @@ -44,8 +44,6 @@ void main() { #define textureCubeLod(img, coord, lod) textureCube(img, coord, lod) #endif - - #ifdef USE_GLES_OVER_GL #define lowp #define mediump diff --git a/drivers/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl index 3b0bca982d..7e59b63935 100644 --- a/drivers/gles2/shaders/scene.glsl +++ b/drivers/gles2/shaders/scene.glsl @@ -675,15 +675,15 @@ VERTEX_SHADER_CODE /* clang-format off */ [fragment] +// texture2DLodEXT and textureCubeLodEXT are fragment shader specific. +// Do not copy these defines in the vertex section. #ifndef USE_GLES_OVER_GL - #ifdef GL_EXT_shader_texture_lod #extension GL_EXT_shader_texture_lod : enable #define texture2DLod(img, coord, lod) texture2DLodEXT(img, coord, lod) #define textureCubeLod(img, coord, lod) textureCubeLodEXT(img, coord, lod) #endif - -#endif +#endif // !USE_GLES_OVER_GL #ifdef GL_ARB_shader_texture_lod #extension GL_ARB_shader_texture_lod : enable @@ -694,9 +694,6 @@ VERTEX_SHADER_CODE #define textureCubeLod(img, coord, lod) textureCube(img, coord, lod) #endif - - - #ifdef USE_GLES_OVER_GL #define lowp #define mediump diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index 0c7d8c53d4..309f8b506c 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -2349,10 +2349,6 @@ void RasterizerSceneGLES3::_add_geometry_with_material(RasterizerStorageGLES3::G state.used_screen_texture = true; } - if (p_material->shader->spatial.uses_depth_texture) { - state.used_depth_texture = true; - } - if (p_depth_pass) { if (has_blend_alpha || p_material->shader->spatial.uses_depth_texture || (has_base_alpha && p_material->shader->spatial.depth_draw_mode != RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) || p_material->shader->spatial.depth_draw_mode == RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_NEVER || p_material->shader->spatial.no_depth_test) @@ -3169,7 +3165,7 @@ void RasterizerSceneGLES3::_fill_render_list(InstanceBase **p_cull_result, int p current_material_index = 0; state.used_sss = false; state.used_screen_texture = false; - state.used_depth_texture = false; + //fill list for (int i = 0; i < p_cull_count; i++) { @@ -3634,7 +3630,6 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p if (storage->frame.current_rt->buffers.active) { //transfer to effect buffer if using buffers, also resolve MSAA - glReadBuffer(GL_COLOR_ATTACHMENT0); glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[0].sizes[0].fbo); glBlitFramebuffer(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, 0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, GL_COLOR_BUFFER_BIT, GL_NEAREST); @@ -4191,7 +4186,7 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const glColorMask(1, 1, 1, 1); - if (state.used_contact_shadows || state.used_depth_texture) { + if (state.used_contact_shadows) { glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo); glReadBuffer(GL_COLOR_ATTACHMENT0); diff --git a/drivers/gles3/rasterizer_scene_gles3.h b/drivers/gles3/rasterizer_scene_gles3.h index 3ac5ade721..56e378d7fa 100644 --- a/drivers/gles3/rasterizer_scene_gles3.h +++ b/drivers/gles3/rasterizer_scene_gles3.h @@ -204,7 +204,7 @@ public: bool cull_disabled; bool used_sss; bool used_screen_texture; - bool used_depth_texture; + bool used_depth_prepass; bool used_depth_prepass_and_resolved; |