-
Notifications
You must be signed in to change notification settings - Fork 6
Renderer
The rendering framework is based on threejs.
All the code that manages drawing things to the scene and managing resources will all be done within the threejs framework.
Helios has 2 "scenes" which shouldn't be confused with each other.
The first scene is the one described in Scene. This is the logical scene which stores metadata on the logical scene. In this scene, the data stored is IDs which point to Models, it tracks the current time being rendered. It implements the conceptual idea of rendering objects in the scene.
The second scene is the threejs scene described in the remainder of this page. This is the threejs scene which performs the 3D rendering.
In modern graphics applications, the difficult part of working with rendering engines has been abstracted to the conceptual idea of a Scene. A scene is exactly what it sounds like. It's like a movie scene.
Within the scene you specify objects, each object has a position. It's facing a certain way. It has its own instructions on what to do within the scene. Sometimes these objects are called actors, and the code that defines their instructions on what to do are called scripts.
This conceptual idea for programming 3D applications can be found in Unreal Engine, Unity, and of course threejs, which Helios uses.
The code which manages the rendering scene in Helios can be found in src/Scene/three.
The entry point to the rendering scene is src/Scene/three/three_scene.ts. This is where the threejs rendering context is created. It creates the camera, adds in the red/green/blue axes, and registers the controls which allow users to zoom, pan, and rotate the camera around the scene.
Anything which interacts directly with the rendering scene (with the exception of model implementations, which are only responsible for creating objects for the scene) are within source files in src/Scene/Three.
- Loading meshes is implemented in
mesh_loader.js. - Loading textures is implemented in
texture_loader.js
Another way of looking at it is that the code defined within src/Scene/three should define an abstraction over threejs.