Skip to content

neraulgraphics 0.4.0

Choose a tag to compare

@github-actions github-actions released this 10 Nov 22:42
· 21 commits to main since this release

Newton and MuJoCo adapters, model loading, textures, and a CPU backend so it runs on any machine.

Added

  • A CPU backend. The renderer runs on every core of the machine when there is no NVIDIA GPU,
    drawing the same picture as the GPU (the two run the same rendering code). Renderer takes
    device="auto" | "cuda" | "cpu" (C++: Device), Renderer.device says which was chosen, and
    cuda_available() says whether a GPU is usable. NERAULGRAPHICS_DEVICE=cpu overrides auto;
    NERAULGRAPHICS_THREADS sets the CPU thread count. A machine with no GPU used to raise
    CudaError; it now falls back to the CPU.
  • CUDA is optional at build time (-DNERAULGRAPHICS_CUDA=AUTO|ON|OFF; AUTO uses it if a CUDA
    compiler is found). Without it the library needs only a C++17 compiler and depends on no CUDA
    library or driver.
  • Wheels for macOS (Apple Silicon), Windows and Linux aarch64, CPU-only, alongside the Linux x86_64
    CUDA wheels. The release workflow can publish to PyPI by trusted publishing, once enabled.
  • docs/portability.md: what runs where, and how other GPUs could be supported.
  • neraulgraphics.newton.NewtonRenderer and neraulgraphics.mujoco.MuJoCoRenderer:
    render a Newton or MuJoCo simulation. Shapes become mesh instances once; each
    render(state) only moves them. Sphere, box, capsule, cylinder, cone, ellipsoid,
    plane and mesh shapes, with colours from the model.
  • neraulgraphics.shapes: capsule, cylinder, cone, plane and sphere generators, and the
    pose math (pose_matrices, compose_poses) the adapters use.
  • examples/ with Newton, MuJoCo and model-viewing scripts, and mujoco and images extras.
  • Smooth shading and textures. Mesh takes optional per-vertex normals and uvs; a new
    Texture (RGBA8, sRGB, bilinear filtered, repeating) can be put on an Instance with its
    texture index, and multiplies into the material's diffuse colour. Renderer takes textures.
  • neraulgraphics.load, load_gltf and load_obj: glTF 2.0 (.gltf and .glb) and
    Wavefront OBJ with materials, colour textures, vertex normals and node transforms, returning a
    LoadedScene whose .renderer() frames the model and lights it.
  • Renderer.ambient (C++: set_ambient): light reaching every surface regardless of the lights,
    so faces turned from every light are not black. Defaults to 0; the adapters and loaders
    default to 0.2.
  • Simulator planes draw as a checkerboard ground.

Changed

  • make_camera computes in double precision on the CPU, so a camera is identical on both backends.
  • Python wheel tests now render for real on build machines, on the CPU backend.

Known limits

  • Textures are not mip-mapped, so distant fine patterns grain until samples accumulate.
  • The CPU backend is roughly 40 to 100 times slower than a recent GPU (at 1280x720 a 16-core CPU takes 17 to 41 ms for 138k-triangle models).
  • glTF: no animation or skinning (bind pose is drawn), normal maps, transparency or Draco.