{"id":4119,"date":"2023-03-12T18:23:06","date_gmt":"2023-03-12T18:23:06","guid":{"rendered":"https:\/\/castle-engine.io\/wp\/?p=4119"},"modified":"2023-03-13T09:56:16","modified_gmt":"2023-03-13T09:56:16","slug":"mobile-opengles-rendering-upgrades-occlusion-query-anisotropic-filtering-3d-textures-shadows-plus-new-occlusion-query-demo","status":"publish","type":"post","link":"https:\/\/castle-engine.io\/wp\/2023\/03\/12\/mobile-opengles-rendering-upgrades-occlusion-query-anisotropic-filtering-3d-textures-shadows-plus-new-occlusion-query-demo\/","title":{"rendered":"Mobile (OpenGLES) rendering upgrades: occlusion culling, anisotropic filtering, 3D textures, shadows; plus new occlusion query demo"},"content":{"rendered":"<table class=\"thumbnails thumbnails-align-right\"><tr><td>\n          <a href=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2023\/03\/screenshot_android.png\"\n             class=\"screenshot\"\n             title=\"Occlusion query demo on Android\"><img loading=\"lazy\" decoding=\"async\"\n            style=\"float: right\"\n            src=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2023\/03\/screenshot_android-200x92.png\"\n             width=\"200\" height=\"92\" \n            alt=\"Occlusion query demo on Android\"\n          ><\/a><\/td><\/tr><tr><td>\n          <a href=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2023\/03\/screenshot_editor.png\"\n             class=\"screenshot\"\n             title=\"Occlusion query demo\"><img loading=\"lazy\" decoding=\"async\"\n            style=\"float: right\"\n            src=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2023\/03\/screenshot_editor-200x113.png\"\n             width=\"200\" height=\"113\" \n            alt=\"Occlusion query demo\"\n          ><\/a><\/td><\/tr><tr><td>\n          <a href=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2023\/03\/screenshot.png\"\n             class=\"screenshot\"\n             title=\"Occlusion query demo on desktop\"><img loading=\"lazy\" decoding=\"async\"\n            style=\"float: right\"\n            src=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2023\/03\/screenshot-200x118.png\"\n             width=\"200\" height=\"118\" \n            alt=\"Occlusion query demo on desktop\"\n          ><\/a><\/td><\/tr><\/table>\n<p>Our OpenGL and OpenGLES code is now more streamlined, which allowed to &#8220;unlock&#8221; various rendering features on OpenGLES.<\/p>\n<p>This means we will use some features from OpenGL ES 3.0, if it is available:<\/p>\n<ul>\n<li>\n    <a href=\"https:\/\/castle-engine.io\/occlusion_culling\">Occlusion Culling<\/a>, that is also showcased in a new demo <a href=\"https:\/\/github.com\/castle-engine\/castle-engine\/tree\/master\/examples\/viewport_and_scenes\/occlusion_culling\">examples\/viewport_and_scenes\/occlusion_culling<\/a>.<\/p>\n<li>\n<p>3D textures (example data in <a href=\"https:\/\/github.com\/castle-engine\/demo-models\">demo-models, look in texturing_advanced subdirectory<\/a>).<\/p>\n<li>\n<p>Using glBlitFramebuffer to get FBO results to image.<\/p>\n<li>\n<p>Modern way to query OpenGLES extensions by index.<\/p>\n<li>\n<p>Fixed, and more efficient than ever on mobile, shadow maps using shadow samplers in OpenGLES 3. I already mentioned <a href=\"https:\/\/castle-engine.io\/wp\/2023\/02\/19\/shadow-volumes-and-shadow-maps-work-on-mobile-opengl-es-and-we-have-a-new-tcastlerenderunlitmesh-utility-class\/\">shadow volumes and shaow maps improvements on mobile in past news<\/a>.<\/p>\n<li>\n<p>Loading <a href=\"https:\/\/castle-engine.io\/x3d_implementation_texturing.php#section_dds\">DDS<\/a> and <a href=\"https:\/\/castle-engine.io\/x3d_implementation_texturing.php#section_ktx\">KTX<\/a> with explicit mipmaps (using <code>GL_TEXTURE_MAX_LEVEL<\/code>).\n<\/ul>\n<p>Note that we still <i>require<\/i> only OpenGL ES 2.0. The OpenGL ES 3.0 features are optional for us.<\/p>\n<p>Moreover:<\/p>\n<ul>\n<li>\n<p>Anisotropic filtering is now supported on OpenGLES, through an <a href=\"https:\/\/www.khronos.org\/opengl\/wiki\/Ubiquitous_Extension\">almost universally-available extension<\/a>, just like on the desktop. See e.g. <a href=\"https:\/\/github.com\/castle-engine\/castle-engine\/tree\/master\/examples\/viewport_and_scenes\/anisotropic_filtering\">anisotropic_filtering<\/a> demo. (Yeah, we should have a more comfortable way to adjust anisotropic filtering visually &mdash; I have 2 ideas about this, will explore them.)<\/p>\n<li>\n<p>We also fixed support for rendering shapes that require 32-bit indexes. While OpenGLES 2.0 guarantees only 16-bit indexes (OpenGLES 3.0 bumps it to 32-bit), we now automatically deal with it inside a renderer, if necessary doing additional processing to enable bigger meshes even for OpenGLES 2.0. This can be tested using <a href=\"https:\/\/github.com\/castle-engine\/castle-engine\/tree\/master\/examples\/fps_game\">fps_game<\/a> on mobile.\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Our OpenGL and OpenGLES code is now more streamlined, which allowed to &#8220;unlock&#8221; various rendering features on OpenGLES. This means we will use some features from OpenGL ES 3.0, if it is available: Occlusion Culling, that is also showcased in a new demo examples\/viewport_and_scenes\/occlusion_culling. 3D textures (example data in demo-models, look in texturing_advanced subdirectory). Using &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/castle-engine.io\/wp\/2023\/03\/12\/mobile-opengles-rendering-upgrades-occlusion-query-anisotropic-filtering-3d-textures-shadows-plus-new-occlusion-query-demo\/\" class=\"more-link\">Continue reading  \u27a4<span class=\"screen-reader-text\"> &#8220;Mobile (OpenGLES) rendering upgrades: occlusion culling, anisotropic filtering, 3D textures, shadows; plus new occlusion query demo&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":4122,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"publish_to_discourse":"0","publish_post_category":"9","wpdc_auto_publish_overridden":"1","wpdc_topic_tags":"","wpdc_pin_topic":"","wpdc_pin_until":"","discourse_post_id":"2631","discourse_permalink":"https:\/\/forum.castle-engine.io\/t\/mobile-opengles-rendering-upgrades-occlusion-culling-anisotropic-filtering-3d-textures-shadows-plus-new-occlusion-query-demo\/764","wpdc_publishing_response":"","wpdc_publishing_error":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-4119","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2023\/03\/screenshot_editor.png","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9IgYW-14r","jetpack_likes_enabled":false,"_links":{"self":[{"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/posts\/4119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/comments?post=4119"}],"version-history":[{"count":6,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/posts\/4119\/revisions"}],"predecessor-version":[{"id":4128,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/posts\/4119\/revisions\/4128"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/media\/4122"}],"wp:attachment":[{"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/media?parent=4119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/categories?post=4119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/tags?post=4119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}