The core layer contains all of the fundamental abstractions like: NamedEntity, Uniforms, Spacial, Illumination, Perspective, Camera, RenderObject, RenderProgram, ChronosGL, etc.
Each attribute/uniform has a canonical name. By convention the first letter of the name signals the type of input:
- a: "Attribute" (aPosition, aTexUV, aNormal, ...)
- u: "Uniform" (uPerspectiveViewMatrix, uTexture, ...)
- c: "Controls" (cDepthWrite, cDepthTest, cBlendEquation, ...)
- v: "Varying Attributes"
- i: "Indexer Attributes"
A large number of canonical names are already registered by default. Additional ones required by custom shaders can be registered at startup. See lib/src/base/shader_object.dart for a list.
is a base class for object that need to be transformed, e.g. moved, scaled, rotated. It is also used as a Camera abstraction.
represent the raw data for mesh. Internally this is wrapper around a Vertex Array Object (VAO). MeshData objects can be populated directly but often they will derived from GeometryBuilder objects. The other common way to create a MeshData object is via RenderProgram.MakeMeshData(). Note, MeshData is always associated with a specific RenderProgram but it is possible to assert compatibility with multiple RenderPrograms.
Helper for Shader independent Mesh creation. Supports Faces with 3 and 4 Nodes or point clouds. Use GeometryBuilderToMeshData() to create the Mesh for a specific Shader.
properties like clamping and mip-mapping.
is the base class for all textures
provides an Orthographic Perspective Matrix
provides the Input for perspective projection, i.e. the uPerspectiveViewMatrix Uniform which also requires a Camera for view matrix.
is a light weight container for uniforms related to the appearance of a mesh.
Prepares a canvas for 3d rendering. Contains wrapper for all the WebGL2 bindings
is inherited by almost all other classes in ChronosGL. It mostly exists to help with debugging by giving names to objects. It also provides a simple mechanism for en-/dis-abling objects, though what it means to be disabled will differ from class to class.
is an abstraction for a set of uniforms
Important subclasses are:
- Projection provides a perspective matrix uniform
- Material provides color and texture uniforms
- Illumination provides uniforms describing light sources
Helper class for holding info produced by RenderProgram::Draw().
represents program (Fragment + Vertex Shader) running on the GPU with an API to invoke it.
represents a light source with helpers for light and shadow computation. Light is NOT a UniformGroup. But several Lights can be added to an Illumination object which is a *UnformGroup.
light is emanating from a single point in all directions
Conceptually a directional light is emanating from a infinitely large source at infinite distance.
a cone of directional light is emanating from a point
represents a collection of Lights.
The scene layer adds abstractions to the core layer* related to scene graphs.
represents a simple scene graph. Each scene is rendered by multiple invocation of a single RenderProgram and contains additional UniformGroups to be passed to that program at draw time.
represents a sequence of Scenes.
represents a hierarchy of objects that well be rendered by rendered RenderProgram. Typically that hierarchy is a tree but DAGs are supported. Only leaf Nodes will cause draw calls by providing MeshData and Material. Non leaf Nodes are just containers for other Nodes Each Node is a Spatial so it be re-oriented with respect to its parent
provides many standard Vertex and Fragment shaders.
contains helpers for creating GeometryBuilder objects for basic shapes like cubes and cylinders. Higher layers contain wrappers that generate the corresponding MeshData objects from them.
Camera flying through a TorusKnot like through a tunnel
provides abstractions for animated meshes.
the basic unit of a skeleton. Bones form a tree structure and have a parent bone.
represents a Skeleton ready to be used for skinning.
represents Key frame animation data for a single bone in a skeleton.
represents Key frame animation data for an entire skeleton.
contains helpers reading various mesh file formats into GeometryBuilders
adds helpers which require access to HTML features like DOM tree (elements).
HTML keyboard handling
HTML mouse handling
Interactive Camera focused on a specific point.
The misc layer contains miscellaneous helpers
A RenderPhase which automatically updates perspective and viewport when the window size is changed. This assumes that the canvas is always "full screen".