I often receive questions such as “How can I render shadows with OpenGL® ES 2.0 without an available depth texture extension?”; “How can I render a simple text with OpenGL ES 2.0?”; or “Simple text rendering does not produce a high quality result, how could I improve this?”.
With these questions in mind I decided to come up with sample codes and whitepapers to present to this particular developer audience, whilst being aware that there are much more sophisticated approaches which other developers will currently be working on. These tutorials present basic approaches on how to get something quickly working on a device. I encourage you to use any sample(s) you are interested in as part of your project. Below you can find short descriptions of what I have just released.
This tutorial presents an approach to shadow rendering without using depth textures, which are not available in OpenGL ES 2.0 unless the OES_depth_texture extension is available. The sample was written on the basis of a projective texture mapping technique. This technique does as many rendering passes as the number of lights, plus one final pass to draw the objects with shadows on top of them.
Please see the "Shadow Mapping - realtime shadow rendering with OpenGL ES 2.0" whitepaper in order to familiarize yourself with the approach.
Simple Text Rendering
This sample presents one of the simplest approaches to dynamic 2D textured text rendering in 3D space. When I say “dynamic”, I mean a text which may change from frame to frame. An application must remain in real time whilst doing this.
In the tutorial you will find more information on how to improve text quality by implementing commonly used OpenGL features. Please see the sample code and the "Simple text rendering - improving quality and performance" whitepaper for more details.
High Quality Text Rendering
This is another approach to rendering textured text. Compared to the method above, this approach focuses more on how to achieve the best possible quality and rendering performance - but you might lose performance or get some delay when changing (building) texts objects. Having that in mind you should understand that this approach is not suitable for texts which are changed often – one change per several frames should be fine.
For this approach you need to use a proper font engine as you no longer want to rely on a fixed size font from a texture atlas (as it is described in the “simple text rendering” sample). The font engine is going to produce a texture data with the whole text written down. The texture is then presented on a simple quad.
If you want to find out more please read both the "High quality text rendering - improving quality for textured text" whitepaper and the source code.
This sample demonstrates how to make a fur effect in real-time. The technique does not require any advanced GPU features. The example is based on OpenGL ES 2.0, but can be made even with the very first version of the API.
The idea is based on a semi-transparent object being rendered several times. Every time a convex object is rendered, its scale is increased and alpha decreased respectively.
If you want to find out more about this technique I encourage you to get familiar with this source code and the "Fur - realtime rendering technique using OpenGL ES 2.0" whitepaper.