Ambient icon indicating copy to clipboard operation
Ambient copied to clipboard

Document the renderer

Open philpax opened this issue 3 years ago • 1 comments

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.

philpax avatar Mar 01 '23 07:03 philpax

Gonna start reading through the rendering code and adding doc comments wherever I can.

MavethGH avatar Mar 05 '23 15:03 MavethGH

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?

philpax avatar Mar 06 '23 16:03 philpax

I think I'd like to do the internals first, so I can get a good understanding of the architecture.

MavethGH avatar Mar 06 '23 16:03 MavethGH

Sounds good to me!

philpax avatar Mar 06 '23 16:03 philpax

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_subtree creates the children with a visibility_from component, which points to the root of the hierarchy.
  • visibility_from is considered during the culling process; if set, the renderer will use the entity pointed to in visibility_from for culling determination. If you have a character holding a sword and the sword's visibility_from is set to the character, it will be culled when the character is culled.

philpax avatar Mar 13 '23 13:03 philpax

Thanks! I've been pretty busy lately so I haven't had much time to work on this, but I still will!

MavethGH avatar Mar 13 '23 13:03 MavethGH

I should have time this weekend to do this.

MavethGH avatar Mar 17 '23 13:03 MavethGH

No rush, looking forward to it :)

philpax avatar Mar 17 '23 13:03 philpax

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.

marceline-cramer avatar Mar 30 '23 20:03 marceline-cramer

@MavethGH were you able to make any progress?

philpax avatar Mar 30 '23 20:03 philpax

Sorry it's been so long with no progress on this. Would it still be helpful if I did it now?

MavethGH avatar Jul 01 '23 19:07 MavethGH