Chapter 7. Working with Shaders
Every game's success depends largely on its look and feel. This directly means that the game must have an eye-catching graphical display. It is not always possible to provide maximum quality graphical assets due to space and heap restrictions. So, there has to be a way to create or improvise the graphical assets at runtime for display. This necessity gave birth to the concept of shaders.
Shaders can operate on any visual element and can tweak every pixel of drawable elements before rendering. Mostly, shaders are optimized for a specific graphics processor. However, nowadays, shaders can be written to support multiple processors on multiple platforms.
Android accommodates the option to work with shaders in the Android framework itself. Additionally, OpenGL shaders can also be used and customized with the help of the Android NDK. There are many occasions where exquisite graphical quality is delivered with the help of shaders without excellent raw...