Skip to content

Add ability to generate python raytracing renderering#8

Merged
sebcrozet merged 3 commits into
dimforge:mainfrom
haixuanTao:feat/python-rt-render
Jul 16, 2026
Merged

Add ability to generate python raytracing renderering#8
sebcrozet merged 3 commits into
dimforge:mainfrom
haixuanTao:feat/python-rt-render

Conversation

@haixuanTao

Copy link
Copy Markdown
Contributor

Add ability to generate raytraced framed

@haixuanTao
haixuanTao force-pushed the feat/python-rt-render branch from f22e180 to 34da17c Compare July 8, 2026 10:00

@sebcrozet sebcrozet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! That looks good but it seems like this includes some of the code from other PRs. So let’s merge the others first.

haixuanTao added a commit to haixuanTao/nexus that referenced this pull request Jul 8, 2026
…ewer, pipelined readback

Makes the nexus3d Python bindings usable for off-screen video capture:

- NexusViewer(width, height): configurable resolution; set_draw_ui(False)
  keeps the egui panel out of captured frames.
- NexusViewer.render() -> (H, W, 3) uint8 numpy frame export, like
  mujoco.Renderer.render().
- raytrace_frame() + set_raytracer_samples_per_frame/max_bounces/denoise
  + raytracer_backend(): kiss3d's GPU path tracer from Python, with
  progressive sample accumulation. sync takes the CPU-readback path while
  the tracer is active (the zero-readback kernel only updates the
  rasterizer's instance buffers, which the tracer's BVH never reads).
- NexusViewer(..., headless=True): no OS window, no swapchain — frames
  render into an off-screen texture, never throttled by display vsync,
  works without a display server.
- set_vsync(enabled)/vsync(): uncap a windowed viewer instead.
- render_async()/render_flush(): pipelined capture — returns the previous
  frame while the current frame's GPU->CPU copy runs in the background.

A windowed capture loop was vsync-locked at ~30 fps (blocking readback +
Fifo swapchain = ~2 vblanks per iteration); headless + pipelined readback
reaches 92 gen-fps at 640x480 (GPU physics) on an RTX 5080.

Requires the kiss3d headless-capture branch (dimforge/kiss3d#398).
Supersedes dimforge#7 and dimforge#8 (included here).
@haixuanTao
haixuanTao force-pushed the feat/python-rt-render branch from 6aa6051 to 1b45312 Compare July 9, 2026 07:04
haixuanTao and others added 3 commits July 16, 2026 13:22
Adds NexusViewer.raytrace_frame() (kiss3d 0.45 GPU path tracer with
cross-frame sample accumulation), set_raytracer_samples_per_frame/
max_bounces/denoise, and snap_rgb() returning the framebuffer as an
(H, W, 3) uint8 numpy array.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The zero-readback sync kernel writes body poses straight into kiss3d's
GPU instance buffers, but the ray tracer rebuilds its acceleration
structure from the CPU-side instance data — so path-traced frames froze
at the initial scene. Route sync through the readback path whenever a
RayTracer exists.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
NexusViewer.raytracer_backend() returns "hardware" (RT-core ray
queries) or "software" (compute-shader BVH fallback) so users can
verify which backend kiss3d selected on their GPU.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sebcrozet
sebcrozet force-pushed the feat/python-rt-render branch from 1b45312 to 4e5725d Compare July 16, 2026 11:23
@sebcrozet
sebcrozet merged commit b8489f5 into dimforge:main Jul 16, 2026
5 checks passed
@sebcrozet

Copy link
Copy Markdown
Member

Thanks!

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.

2 participants