Skip to content

neraulgraphics 0.5.0

Latest

Choose a tag to compare

@github-actions github-actions released this 11 Nov 01:04
· 12 commits to main since this release

Added

  • Beauty mode: path tracing. Renderer.set_render_mode(RenderMode.PathTraced, PathTracing(...)) draws
    light bouncing between surfaces with soft shadows, sky lighting and physically based materials
    (GGX specular with Lambert diffuse, sampled by visible normals), by unidirectional path tracing with direct
    light sampling and Russian roulette. A sample brighter than max_radiance is scaled down against fireflies.
    Both backends, with the same results (the CPU and the GPU agree to noise). Classic materials need no change:
    Material gains roughness, metallic and emission, and when roughness or metallic is left unset they
    are worked out from the specular exponent and reflectivity.
  • Environment and Renderer.set_environment: a gradient or an equirectangular HDR map as the sky, which
    rays leaving the scene see in either renderer and path tracing also uses as light. A map is importance
    sampled, combined with material sampling by multiple importance sampling, so a small bright sun lights and
    shadows cleanly. up and rotation orient it. load_hdr reads Radiance .hdr files and procedural_sky
    makes a sky with a sun of a given strength.
  • A denoiser for path-traced pictures: reuse of the previous frame along the camera's motion, with history
    rejected where the surface changed, then an edge-aware spatial filter steered by variance. One path per pixel
    looks clean, and the picture keeps improving while the camera holds still.
  • sim.beauty(sky=None, **settings) and sim.classic() on the Newton and MuJoCo adapters (the sky follows
    the simulator's up axis). The glTF loader passes roughness, metallic and emission through.
  • Viewer: --beauty and the B key.
  • examples/beauty_render.py, a path-traced scene you can fly around, and examples/batch_render.py now opens a window with live worlds. Both fall back to writing a picture when there is no display.

Fixed

  • examples/batch_render.py crashed on a GPU machine without PyTorch: it asked for zero-copy output that nothing could read.
  • Batched worlds. BatchRenderer draws many worlds at once, each seen by its own camera(s) and
    holding the same instances placed differently, and returns (views, H, W, ...) batches of RGB,
    depth, normals and object IDs. Poses (set_instance_transforms, or simulator body poses through
    bind_bodies and set_body_poses), cameras and rays may be CUDA arrays, used where they are.
    Worlds are isolated: a camera never sees another world's instances.
  • The trees over instances are built on the GPU every update (Morton-code sort and parallel Karras
    construction): 82,000 instances in 0.15 ms and 100,000 in under 1 ms, against 89 ms when built on the CPU.
    The layout is now a forest with explicit child pointers, one root per world.
  • NewtonBatchRenderer and MJWarpBatchRenderer: batched Newton and MuJoCo Warp simulations, reading the
    simulators' GPU state in place. neraulgraphics.shapes.look_at makes camera matrices.
  • Sensor outputs. Renderer.render_frame(camera, rgb=, depth=, normals=, object_ids=) returns depth
    (along the view axis, inf where nothing is hit), world-space normals and object-ID images, each
    one exact ray through the pixel's middle. IDs are fixed numbers: OBJECT_NONE, OBJECT_SPHERE + i,
    OBJECT_FLOOR, OBJECT_INSTANCE + i. Asking for fewer images is faster: depth alone does no shading.
  • Renderer.cast_rays(origins, directions, max_distance): ray queries for LiDAR and range sensors.
  • Zero-copy output. With zero_copy=True the images are views of the renderer's buffers, and on a GPU
    they are CUDA arrays for torch.from_dlpack, jax.dlpack.from_dlpack, warp.from_dlpack or
    cupy.from_dlpack, already finished. cast_rays takes CUDA arrays such as PyTorch tensors and
    answers on the GPU. C++: render_frame, render_frame_host, cast_rays, cast_rays_host.
  • The viewer shows the sensor images: keys 1 to 4 switch between the picture, depth, normals
    and object IDs, --mode starts in one, and --snapshot FILE.ppm saves a frame without a window.
  • render_frame and cast_rays on the Newton, MuJoCo and loaded-model renderers, update(state) to
    place shapes without drawing, and object_id_of_shape / object_id_of_geom.