Document the renderer
Our renderer uses ~relatively modern features to handle as much work on the GPU as possible. All content and object data is uploaded to the GPU, which is then responsible for deciding what gets rendered.
We should also document our current rendering architecture and the next steps for what we will support.
Gonna start reading through the rendering code and adding doc comments wherever I can.
Great! I just realised I was ambiguous here - I was actually looking for documentation for our mdbook (i.e. docs/src), but documenting the internals is useful too. Would you be interested in writing up architectural documentation for the mdbook, or should I create another issue for the internals and assign you to that?
I think I'd like to do the internals first, so I can get a good understanding of the architecture.
Sounds good to me!
We had an internal discussion about what visibility_from does that you might find useful. Here's some quick notes:
- An entity can have multiple meshes. They're culled as a group, so you don't need to do anything special.
- However, an entity can also belong to a hierarchy. By default, these are culled individually, so that a child is culled separately from its parent.
- To avoid this,
Model::spawn_subtreecreates the children with avisibility_fromcomponent, which points to the root of the hierarchy. -
visibility_fromis considered during the culling process; if set, the renderer will use the entity pointed to invisibility_fromfor culling determination. If you have a character holding a sword and the sword'svisibility_fromis set to the character, it will be culled when the character is culled.
Thanks! I've been pretty busy lately so I haven't had much time to work on this, but I still will!
I should have time this weekend to do this.
No rush, looking forward to it :)
I'll also begin reviewing the renderer internals and adding documentation wherever I can. If there's anything specific I can help document, just let me know.
@MavethGH were you able to make any progress?
Sorry it's been so long with no progress on this. Would it still be helpful if I did it now?