neraulGraphics
A raytracing rendering engine for games and simulation, usable as a library from Python or C++. It runs on an NVIDIA GPU through CUDA when there is one, and on the CPU everywhere else. Actively developed.
Hand it a scene and a camera, get an image back. Every pixel is traced with real rays, so mirrors, shadows and reflections work without tricks, and the picture sharpens the longer the camera holds still.
Features
- Runs anywhere. An NVIDIA GPU is used automatically when present; otherwise every CPU core is. Same picture either way, on Linux, macOS and Windows.
- Library first.
pip installandimport neraulgraphics, orfind_package(neraulgraphics)in C++. No window or engine to adopt. - Meshes and instancing. Share triangle meshes between any number of instances. Moving an instance only updates a small BVH, so thousands of moving bodies stay cheap.
- Dynamic scenes.
set_instance_transforms()takes a pose per instance each frame, with poses as position plus(x, y, z, w)quaternion, the convention Warp, MuJoCo and Newton use. - Load models.
ng.load("model.glb")reads glTF, GLB and OBJ with materials, colour textures, smooth normals and node hierarchies. - Newton and MuJoCo adapters.
NewtonRenderer(model).render(state)andMuJoCoRenderer(model).render(data): shapes become instances once, and each frame only poses are updated. - Reflections, soft shadows, anti-aliasing, plus progressive refinement while the camera is still.
- Interactive viewer with free-fly camera:
make raytracer. - Clear errors. Bad scenes raise
ValueError(Python) orstd::invalid_argument(C++) saying what is wrong, instead of crashing.
Install
pip install git+https://github.com/aneangel/neraulGraphics
That builds from source, so it needs CMake and a C++17 compiler. If the CUDA toolkit is installed it also builds the GPU backend for your card; if not, it builds the CPU backend, which needs nothing else. Prebuilt wheels are on the releases page: Linux x86_64 with the GPU backend (needing only the NVIDIA driver, and using the CPU if there is no GPU), and CPU-only for macOS (Apple Silicon), Windows and Linux aarch64.
neraulgraphics.cuda_available() says whether a GPU will be used, and
ng.Renderer(..., device="cpu") forces the CPU. At 1280x720 a 16-core CPU renders a
138,000-triangle model in about 17 to 41 ms; a GPU takes under 1 ms.
Quick start
import neraulgraphics as ng
red = ng.Material(diffuse_color=(0.6, 0.15, 0.15))
renderer = ng.Renderer(
800, 450, spheres=[],
lights=[ng.Light((-10, 20, 10), intensity=1.6, radius=1.0)],
floor=ng.Plane(y=-2, half_extent_x=12, z_min=-30, z_max=-2),
meshes=[ng.make_icosphere(1.0)],
instances=[ng.Instance(0, ng.make_transform((0, 0, -8), scale=2.0), red)],
)
camera = ng.make_camera((0, 1, 0), (0, 0, -8), width=800, height=450)
for frame in range(64): # more frames, smoother image
image = renderer.render(camera, frame) # (450, 800, 3) uint8 numpy array
Move things every frame with renderer.set_instance_transforms(matrices), an
(N, 3, 4) float array, then render with frame=0.
Loading a model
scene = ng.load("duck.glb") # .glb, .gltf or .obj
image = scene.renderer(1280, 720).render()
The renderer picks a camera and lights from the model's size; view.camera(position)
takes over the camera. For more control, hand scene.meshes, scene.instances and
scene.textures to ng.Renderer yourself. Reading texture images needs Pillow
(pip install neraulgraphics[images]). Not supported: animation and skinning (a
skinned model draws in its bind pose), normal and roughness maps, transparency,
Draco-compressed glTF. See examples/view_model.py for a turntable.
Rendering a simulation
from neraulgraphics.newton import NewtonRenderer # or neraulgraphics.mujoco.MuJoCoRenderer
view = NewtonRenderer(model, 1280, 720) # shapes become mesh instances, once
for _ in range(steps):
solver.step(state_0, state_1, control, contacts, dt)
image = view.render(state_1) # (720, 1280, 3) uint8; only poses are read
It draws spheres, boxes, capsules, cylinders, cones, ellipsoids, planes and meshes, with the
colours the model gives them, and frames the scene and lights it for you. Pass your own
camera= (from view.camera(position, target)) or lights= to take control. A real
articulated humanoid renders in under a millisecond a frame. Runnable versions are in
examples/.
C++:
find_package(neraulgraphics 0.4 REQUIRED)
target_link_libraries(my_app PRIVATE neraulgraphics::core)
#include <neraulgraphics/renderer.h>
neraulgraphics::Renderer renderer(width, height, spheres, lights, floor, meshes, instances);
const uint32_t *pixels = renderer.render(camera, frame, 1); // ARGB, width*height
Build and run
make raytracer # builds ./raytracer
./raytracer --instances 5000 # viewer with 5000 spinning bodies
make test # needs a GPU
Needs CMake 3.28+, a C++17 compiler and SDL2. If CUDA 12+ is installed the viewer uses your
GPU (built for RTX 50-series by default; make raytracer CMAKE_ARGS="-DCMAKE_CUDA_ARCHITECTURES=native"
for other cards), and otherwise it renders on the CPU. -DNERAULGRAPHICS_CUDA=OFF skips CUDA
even when it is installed.
Status
Pre-1.0: the API may change between minor versions (see the changelog). Planned next: GPU-side instance updates for 100k+ moving bodies, texture mip-mapping, and backends for AMD, Intel and Apple GPUs (see portability).
More detail, benchmarks and viewer controls are in the guide.
License
Credits
Grew out of ssloy/tinyraytracer.
Metadata
Release files for neraulgraphics 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| neraulgraphics-0.4.0.tar.gz | 321.6 kB | With provenance | Details for neraulgraphics-0.4.0.tar.gz |
Built distributions (wheels)
Total release size: 4.2 MB
Release files / neraulgraphics-0.4.0.tar.gz
| Download URL | neraulgraphics-0.4.0.tar.gz |
|---|---|
| Size | 321.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5973720831cb7e64a66d0d1627f6365d4702b35b3e57f273f1ecb6b2451574af
|
|
BLAKE2b-256 checksum How to use checksums |
dcd8e5885227f2eb246459edd6a79115c9bcb28c3c92356cdbb46974c68d7327
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / neraulgraphics-0.4.0-cp312-abi3-win_amd64.whl
| Download URL | neraulgraphics-0.4.0-cp312-abi3-win_amd64.whl |
|---|---|
| Size | 370.5 kB |
| Tags | CPython 3.12 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c3f78dc1327abd324e91c449ace8c7a8b83bf8abe9d61e2636747c0ea946fba5
|
|
BLAKE2b-256 checksum How to use checksums |
7b583eed4dddf0a7dddb06aef9be6ce4b6fe8f21ba5865e99415029bbfd5ab76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / neraulgraphics-0.4.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | neraulgraphics-0.4.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 571.6 kB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
8b8e48860db77bdab389f9d8e6948b21ebc1ed77acafcf62a2389344ce1f1597
|
|
BLAKE2b-256 checksum How to use checksums |
a62a98a0298648c60f3d7248671de6a7a70578a4413afcad203e0ac6714aae10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / neraulgraphics-0.4.0-cp312-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
| Download URL | neraulgraphics-0.4.0-cp312-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 174.5 kB |
| Tags | CPython 3.12 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
d6436600eb93d1e1b505631f9b99e8f2d6dd60797cf081306f6fa8520d4a030c
|
|
BLAKE2b-256 checksum How to use checksums |
fd9b600109f59db39c654e43215b509ac8f7ccff915a71702723cec7f722ffc2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / neraulgraphics-0.4.0-cp312-abi3-macosx_11_0_arm64.whl
| Download URL | neraulgraphics-0.4.0-cp312-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 153.7 kB |
| Tags | CPython 3.12 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e932b490873bffc182e5a8d2c5070770d6fd58cb9ace25ec159723a5c456375a
|
|
BLAKE2b-256 checksum How to use checksums |
278fcf7c2db4e4b3db47c46909726feb986c4afe3e893074402c83c2edf51f35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / neraulgraphics-0.4.0-cp311-cp311-win_amd64.whl
| Download URL | neraulgraphics-0.4.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 371.2 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9547c34ebaaccb0b7f77a802d7166eeebdc007d6b046e907e6ff39667f0b7a63
|
|
BLAKE2b-256 checksum How to use checksums |
34bf54e449361303a810805ca6408681f80ed82e7ffba544607dd97ec6a0973b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / neraulgraphics-0.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | neraulgraphics-0.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 575.1 kB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
8733e60406a0182c5711a7ab1683218cb7122e088bd63fb944fff1f170a873d4
|
|
BLAKE2b-256 checksum How to use checksums |
03ed7381c66a19f5d98938a2e6887f3c846e4181181920943c26125637d619ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / neraulgraphics-0.4.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
| Download URL | neraulgraphics-0.4.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 178.7 kB |
| Tags | CPython 3.11 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
e6d865912d51363949eeb6410ae5a082555214a479dce1a54b778c819c470753
|
|
BLAKE2b-256 checksum How to use checksums |
69183aeaf2de5c273b86f86e6b08257772d66fd62f6f2ef46facf7a889dafa48
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / neraulgraphics-0.4.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | neraulgraphics-0.4.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 155.6 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7611f300842fdafc433166f1a1ae059b04c0a5e8e208287c8e2cbbcff6dfc0fa
|
|
BLAKE2b-256 checksum How to use checksums |
34b05d7f50c145c459cffa22cc47ba0cb93f487dab83164751218bac27efcb5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / neraulgraphics-0.4.0-cp310-cp310-win_amd64.whl
| Download URL | neraulgraphics-0.4.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 370.9 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8d54d42e176e10cdf63092cd8b220760e38f6933206b774578f545451649f3d5
|
|
BLAKE2b-256 checksum How to use checksums |
0daa9bc7fc883ee43b9f18f2dbc6c1756470a9628b5dd98a49c45474a4557af0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / neraulgraphics-0.4.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | neraulgraphics-0.4.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 575.4 kB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
687e5d54b85dddb8801001a23d3fc49a2492dd6b357033a783452e382f926e42
|
|
BLAKE2b-256 checksum How to use checksums |
0fda26d02c8d704c628ae68738950f4a6947d4de4959bd0f2ea108c4ecb18640
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / neraulgraphics-0.4.0-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
| Download URL | neraulgraphics-0.4.0-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 179.1 kB |
| Tags | CPython 3.10 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
c33248184dc895424b2d1ce84555148de59b6091228bddfff9f0828ab6ddbd43
|
|
BLAKE2b-256 checksum How to use checksums |
ea42f62910f1981010fedd5423103b57e06c60010ef0fc141dabd7caad98a982
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / neraulgraphics-0.4.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | neraulgraphics-0.4.0-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 156.0 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
126df3b041f79ab0ffd74ff657cd8881b1877738d7b009f165052c01b53b65f7
|
|
BLAKE2b-256 checksum How to use checksums |
5a96da49f94a5d9626fb9efdc255029d401a66664b80a8efb70fbf3838d05596
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logSecurity for neraulgraphics 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 13 files in this release have been uploaded with provenance metadata.
Attestation for neraulgraphics-0.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.