Repository navigation
neraulgraphics 0.4.0
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).Renderertakes
device="auto" | "cuda" | "cpu"(C++:Device),Renderer.devicesays which was chosen, and
cuda_available()says whether a GPU is usable.NERAULGRAPHICS_DEVICE=cpuoverridesauto;
NERAULGRAPHICS_THREADSsets 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.NewtonRendererandneraulgraphics.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, andmujocoandimagesextras.- Smooth shading and textures.
Meshtakes optional per-vertexnormalsanduvs; a new
Texture(RGBA8, sRGB, bilinear filtered, repeating) can be put on anInstancewith its
textureindex, and multiplies into the material's diffuse colour.Renderertakestextures. neraulgraphics.load,load_gltfandload_obj: glTF 2.0 (.gltfand.glb) and
Wavefront OBJ with materials, colour textures, vertex normals and node transforms, returning a
LoadedScenewhose.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_cameracomputes 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.