Skip to content

implement rendering!!!! - #20

Open
IanRPage wants to merge 10 commits into
phase-6-fixed-timestepfrom
phase-7-rendering
Open

implement rendering!!!!#20
IanRPage wants to merge 10 commits into
phase-6-fixed-timestepfrom
phase-7-rendering

Conversation

@IanRPage

@IanRPage IanRPage commented Sep 6, 2026

Copy link
Copy Markdown
Owner

this MR adds the rendering layer on top of the physics core (all my hardwork): a GLFW/GL 4.1 window, GPU-instanced drawing, and an ImGui demo app

render/ module:

  • Window: GLFW/GLAD/GL context, ImGui init
  • ShaderProgram: compiles/links shaders from assets/shaders/. surfaces GLSL errors as exceptions
  • Mesh / MeshLibrary: quad, circle, icosphere, box, capsule, and convex-hull fan triangulation
  • InstancedBatch: double-buffered orphan-and-refill instancing, so one draw call per shape type
  • Camera: orthographic (2D) and perspective (3D). free-fly controller (mouse-look, WASD/Space/Ctrl)
  • RenderableStore: per-body render color that's kept sep from BodyStore. self-heals on body-slot reuse using generation checks (added unit tests for this)
  • HullMeshCache: built lazy, caches meshes for ConvexHullShape bodies
  • Renderer / ImguiController: drives simulation each frame. got a left-docked, collapsible ImGui sidebar, world view filling the rest. 2D drag-to-pan, 3D fly camera, interpolated transforms alpha clamp applied

need vec4 for rendering colors
…dBatch)

low-level rendering primitives: window/context/GLAD setup, shader
compile+link with surfaced GLSL error logs (loaded from assets/shaders/
via AssetPaths.hpp.in), VAO/VBO mesh wrapper + mesh-generation library
(quad/circle/icosphere/box/capsule/hull triangulation), and the
double-buffered orphan and refill instanced draw batch
OrthographicCamera and PerspectiveCamera view-projection math, plus
FreeFlyCameraController (mouse-look yaw/pitch + WASD/Space/Ctrl
movement) for 3D view
per-body render color outside BodyStore (physics sep from rendering) in
a handle-indexed store that self heals on body slot reuse via generation
checks. unlike the rest of render/, this has zero GL dependency, so i
added tests for it covering default-color fallback, set/get, and stale
generation after reuse
ConvexHullShape bodies have per-body polygon geometry that can't share a
"canonical" (fkn claudisms) mesh the way sphere/box/capsule do.
therefore, each gets its own lazily built, fan triangulated mesh cached
by BodyHandle, and is pruned once per frame for dead handles
ties everything together. Renderer owns window, shared shader, per-shape
mesh/batch pairs, and camera state, driving a fixed-timestep Simulator
each frame w/ an ImGui sidebar, and the rest of the window as the world
view. CMakeLists.txt adds new sources, configures AssetPaths.hpp from
the .in template, and drops the asset-copy line. we got something that
runs lads
@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: b1b2ec31-9fc2-4694-a66f-472e3ec49231

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant