Several classes participate in the rendering process, beyond the GLSurfaceView and RenderService.
Rendering resources are obtained in the RequireResourceLoader.load() method, via the ResourceLoader interface.
This class is the top-level drawable component. It contains the list of GOs that participate in the Scene.
Scenes are activated via the Install Pipeline and managed by the RenderService.
Transition effects like cross-fade are also Scenes that take other Scenes and perform the implemented visual effect.
This class ties everything together:
Rendering consists of:
This class represents the Open GL shader program, a matching set of vertex and pixel shader linked together, and their associated variables (attribute/uniform). Both Geometry and Material interact with shaders, to set the variables needed for rendering.
Each shader "program" is identified by a string key-value. Several shaders are pre-configured by AGE:
Additional shader programs can be registered. Shader programs are compiled and linked on the first request for that key.
In order to fit everything together, AGE pre-defines the most-common shader program variable names, and these must be used in your own shaders to work with the default implementation.
If you have variables not in the default set, create matching Material implementations to configure them.
The shader chosen must agree with both the Gemoetry and Material implementations chosen:
Failure to match components results in the shader's variables not setting correctly, with incorrect rendering the result.
This class represents an Open GL texture, created from a bitmap. Be advised that the Y-axis of bitmaps in Android is inverted compared to GL texture coordinates!
The purpose of this class is to generate the Open GL primitives to enable and set up texture units, and to set the corresponding shader variables.
This abstract class is the base for model geometry, and the render() method is the interface to the RenderService.
The purpose of this class is to set up vertex attributes, and generate the Open GL primitives for drawing, e.g glDrawElements().
Geometry must be initialized during the Install Pipeline, and DrawableGameObject delegates appropriately.
This abstract class is for geometry defined by a list of vertex/normal/texture coordinates, and a vertex index list (suitable for glDrawElements). Each vertex attribute is stored in a separate array.
This abstract class is for geometry defined by a list of vertex/normal/color/texture coordinates (suitable for glDrawArrays). All vertex attributes are stored in one array.
This abstract class interfaces between the Shader variables and the color information for a model. Each material is configured to work with a specific shader programs.
A model using InterleavedVertexGeometry may not require a Material; color information (if present) gets set up by that class instead.
This material interfaces with the basic shader program, and provides a single color value.
This material interfaces with the cpv shader program, and provides per-vertex color values.
This material interfaces with the tex shader program, and provides texture mapping.