Our OpenGL and OpenGLES code is now more streamlined, which allowed to “unlock” 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 glBlitFramebuffer to get FBO results to image.
-
Modern way to query OpenGLES extensions by index.
-
Fixed, and more efficient than ever on mobile, shadow maps using shadow samplers in OpenGLES 3. I already mentioned shadow volumes and shaow maps improvements on mobile in past news.
-
Loading DDS and KTX with explicit mipmaps (using
GL_TEXTURE_MAX_LEVEL
).
Note that we still require only OpenGL ES 2.0. The OpenGL ES 3.0 features are optional for us.
Moreover:
-
Anisotropic filtering is now supported on OpenGLES, through an almost universally-available extension, just like on the desktop. See e.g. anisotropic_filtering demo. (Yeah, we should have a more comfortable way to adjust anisotropic filtering visually — I have 2 ideas about this, will explore them.)
-
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 fps_game on mobile.
So much progress !
I needed to search a bit. Does “Occlusion Query” also inculdes “Occlusion culling” ? From my understanding:
Does CGE has both features ?
The terminology we use is:
“Occlusion Query” and “Occlusion Culling” are synonyms, in practice. They mean we remove objects obscured by others. E.g. if you look at a wall, and behind this wall is a monster, and you would see the monster if only the wall was transparent, but the wall is opaque… the “Occlusion Query” and “Occlusion Culling” allow to not render the monster. See Occlusion Query | Manual | Castle Game Engine . It is similar to https://developer.nvidia.com/gpugems/gpugems/part-v-performance-and-practicalities/chapter-29-efficient-occlusion-culling and Unity usage of the term.
Hiding things that are not in “camera frame” is called “frustum culling”. This is also similar to Unity (and I guess all/most other 3D engines) usage of this term, from what I know.
CGE does:
“frustum culling” by default. You can control it using
TCastleScene.SceneFrustumCulling
,TCastleScene.ShapeFrustumCulling
, see Castle Game Engine: CastleScene: Class TCastleScene .“occlusion culling” if you activate it, following Occlusion Query | Manual | Castle Game Engine (
RenderOptions.OcclusionQuery := true
). See new “examples/viewport_and_scenes/occlusion_query” demo.note that we also have “distance culling”, esp. nice when you have dense fog that limits visibility beyond a certain distance. See “examples/viewport_and_scenes/fog_and_distance_culling” demo.
Okay. Got it. Thanks for making it clear . “distance culling” is really something useful !
Note that, as I saw both Godot and Unity using terms “occlusion culling”, and I like it more too (it’s a more general term, and consistent with “frustum culling”) → I will do some renames in our terminology to be simpler, and just use “occlusion culling” term in CGE more (instead of “occlusion query”).
Nevertheless … we all learn from here. If we need to search something specific, we know the name now (or we know some more terms)