-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStructure.txt
60 lines (55 loc) · 2.68 KB
/
Structure.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
##############################
## Readable in VisualStudio ##
##############################
Features I want:
- 3D rendering with:
- Some basic lighting ( Not deferred until later )
- Directional, Point and Spot lights
- Opaque and translucent meshes
- Simple materials with:
- Diffuse mapping
- Specular mapping
- Transparency ( Let's only support transparency on seperate meshes for simplicity, 1 material per mesh)
- If no transparency (on material used by mesh) use opaque shader if we have transparency use transparency shader
Renderer3D -- 3D rendering base class \ --- These will sort and batch so that rendering goes as smooth as possible ---
Focus on -> ForwardRenderer -- Takes a rendering command containing -> Mesh, Shader, Transform(model matrix)
DeferredRenderer -- Takes a rendering command containing -> Mesh, Shader, Transform(model matrix)
Batch and sort commands(meshes) based on:
- Material (Contains Shader, Textures, Transparent or not) - other than transparency sorting is low priority
Also do rough checks to only render things actually in view
- Create shader for particles and foilage etc using glDrawXXXXInstanced and gl_InstanceID - low priority
Scene \
EX:
RootObject
| .- GameObject
/ \_____ GameObject -- Children --<-- GameObject
/ '- GameObject
GameObject
|
Components
|
Any of ex: ModelComponent - TransformComponent
| __________________________________________________
Model ( Assimp - Insperation: Scene -> Meshes, Materials ) -\
| ( Then the models contain indexes to the materials ) --\
Meshes ( and meshes avoiding duplicating when loading the ) ---\
| ( same models later ) --------------------.
Mesh |
.---> | >---.--->VAO |
| /|\ | |
IndexArray --> EBO __/ | \__ VBO <-- VertexArray --> Vertex --> texCoords, normals, position |
| |
Material* (avoid duplicates) |
| |
Shader* (avoid duplicates) |
Textures (avoid duplicates) |
values like shininess |
|
ModelLoader -----------------------------'
| ---- For deletion, reference counters/smart pointers?
Meshes ___________/|\____________ Materials
^ | ^
\ | /
\ Models /
Meshes* ________/ ____ Materials*
\__________________/