aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md44
1 files changed, 26 insertions, 18 deletions
diff --git a/README.md b/README.md
index f0b103d..491761d 100644
--- a/README.md
+++ b/README.md
@@ -20,32 +20,35 @@ educational purposes.
20### Gfx 20### Gfx
21 21
22The `Gfx` object represents the graphics subsystem and is at the center of the 22The `Gfx` object represents the graphics subsystem and is at the center of the
23library's high-level API. The `Gfx` object exposes a `Render` backend and a 23library's high-level API. The `Gfx` object exposes a render backend (`GfxCore`)
24`Renderer` and allows the caller to create `Scene`s. 24and a `Renderer`, and allows the caller to create `Scene`s.
25 25
26### Render Backend 26### Render Backend
27 27
28The `Render` backend is a thin abstraction layer over low-level graphics APIs 28The render backend (`GfxCore`) is a thin abstraction layer over low-level
29like OpenGL or Vulkan. It holds GPU resources such as geometry, textures, 29graphics APIs like OpenGL or Vulkan. It holds GPU resources such as geometry,
30shaders, etc, and exposes functions to manipulate them. 30textures, shaders, etc, and exposes functions to manipulate them.
31 31
32Currently there is only one implementation of the `Render` backend based on 32Currently, there is only one implementation of the render backend based on
33OpenGL. 33OpenGL.
34 34
35#### Ownership 35#### Ownership
36 36
37The `Render` backend owns all rendering resources: buffers, geometries, 37The render backend owns all rendering resources: buffers, geometries, textures,
38textures, shaders, etc. Even resources that point to other resources do not own 38shaders, etc. Even resources that point to other resources do not own those
39those other resources (geometries pointing to buffers). 39other resources (geometries pointing to buffers).
40 40
41There is no ownership tracking in the render backend. It is up to the client to 41There is no lifetime tracking in the render backend. It is up to the client to
42manage resource lifetime. 42manage resource lifetime.
43 43
44### Low-level Renderer
45
46`ImmRenderer` is a low-level, immediate mode renderer.
47
44### Scene 48### Scene
45 49
46A `Scene` encapsulates a scene graph. A scene graph contains the elements that 50A `Scene` graph contains the elements that make up a scene. The current scene
47make up a scene: nodes, cameras, lights, objects, etc. The current scene graph 51graph implementation includes:
48implementation includes:
49 52
50- Camera 53- Camera
51- Light 54- Light
@@ -64,7 +67,8 @@ functions to set the parent node of an object/camera/light. If we exposed the
64former, the API could create the illusion that the hierarchy can be a DAG. 67former, the API could create the illusion that the hierarchy can be a DAG.
65 68
66The strict tree hierarchy should not be that restrictive in practice. Even the 69The strict tree hierarchy should not be that restrictive in practice. Even the
67glTF 2.0 spec [enforces this](https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#nodes-and-hierarchy): 70glTF 2.0
71spec [enforces this](https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#nodes-and-hierarchy):
68 72
69> *For Version 2.0 conformance, the glTF node hierarchy is not a directed 73> *For Version 2.0 conformance, the glTF node hierarchy is not a directed
70> acyclic graph (DAG) or scene graph, but a disjoint union of strict trees. That 74> acyclic graph (DAG) or scene graph, but a disjoint union of strict trees. That
@@ -76,9 +80,9 @@ glTF 2.0 spec [enforces this](https://github.com/KhronosGroup/glTF/blob/master/s
76Two use cases for instancing seem to be: 80Two use cases for instancing seem to be:
77 81
781. Creating N identical clones, but each with a unique transform. (Ex: N 821. Creating N identical clones, but each with a unique transform. (Ex: N
79animated characters animated in unison but located in different locations.) 83 animated characters animated in unison but located in different locations.)
802. Creating N copies of a sub-tree, each now being their own unique tree. (Ex: 842. Creating N copies of a sub-tree, each now being their own unique tree. (Ex:
81The same N animated characters, but each of them now being animated separately.) 85 The same N animated characters, but each of them now being animated separately.)
82 86
83Some scene graphs 87Some scene graphs
84([Panda3D](https://docs.panda3d.org/1.10/python/programming/scene-graph/instancing)) 88([Panda3D](https://docs.panda3d.org/1.10/python/programming/scene-graph/instancing))
@@ -87,10 +91,10 @@ to have multiple parents. This turns the scene graph into a DAG and adds a
87number of complications for us: 91number of complications for us:
88 92
891. Shared ownership of children. We would now need some sort of ref counting or 931. Shared ownership of children. We would now need some sort of ref counting or
90deferred GC to delete nodes and their subtrees. 94 deferred GC to delete nodes and their subtrees.
912. Nodes no longer have a unique parent. 952. Nodes no longer have a unique parent.
923. Given a node, we can no longer determine its location (which parent link do 963. Given a node, we can no longer determine its location (which parent link do
93you follow?), or any attribute that is derived from its parent(s). 97 you follow?), or any attribute that is derived from its parent(s).
94 98
95In our case, we stick to strict tree hierarchies. 99In our case, we stick to strict tree hierarchies.
96 100
@@ -131,6 +135,10 @@ Code under `util/` provides functionality that need not be in the core part
131of the library (Gfx, render backend, scene or renderer). This includes functions 135of the library (Gfx, render backend, scene or renderer). This includes functions
132to compute irradiance maps, create procedural geometry, etc. 136to compute irradiance maps, create procedural geometry, etc.
133 137
138### Memory management
139
140TODO
141
134## Ideas for Future Work 142## Ideas for Future Work
135 143
136- Render graphs to allow for custom multi-pass rendering algorithms. 144- Render graphs to allow for custom multi-pass rendering algorithms.