Skip to content

The animation engine for agents: blazingly fast math and 3D videos with Manim's Python API, on a Rust GPU core.

Python

Credit Filament for the 3D lighting adapted from it

Sina Atalay7ea9ad5fdd73
diff --git a/LICENSE-THIRD-PARTY b/LICENSE-THIRD-PARTY
index 1737e594..e214242e 100644
--- a/LICENSE-THIRD-PARTY
+++ b/LICENSE-THIRD-PARTY
@@ -1,16 +1,18 @@
What ManimGX's wheels hold that others hold the copyright in: modules of its Python
-package, and the crates compiled into the engine (the extension, on each platform,
-Pyodide's, and the player for a page, which the extension carries), with the sources
-the workspace's crates fetch; with the licenses and notices they come with, each
-text once, after what it covers. FFmpeg is under the LGPL-2.1-or-later, and x264, in
-every wheel but Pyodide's, under the GPL-2.0-or-later, which makes such a wheel, as
-a whole, GPL-3.0-or-later. Its complete source and build recipes are on the GitHub
-release of its version, https://github.com/academa-labs/manimgx/releases/tag/vX.Y.Z
-for ManimGX X.Y.Z: manimgx-X.Y.Z-source.tar.xz, ManimGX's committed repository with
-every crate rust/Cargo.lock names and each archive a workspace's crate fetches, with
-the Linux builds' Mesa/glslang archives and exact distribution source RPMs. System
-build tools remain prerequisites. The Linux wheels' lavapipe is in LICENSE-LAVAPIPE.
-Written by scripts/release/licenses.py. The Windows wheels' DXC is in LICENSE-DXC.
+package, files of its engine (its 3D lighting, adapted from Google's Filament,
+https://github.com/google/filament), and the crates compiled into the engine (the
+extension, on each platform, Pyodide's, and the player for a page, which the
+extension carries), with the sources the workspace's crates fetch; with the licenses
+and notices they come with, each text once, after what it covers. FFmpeg is under
+the LGPL-2.1-or-later, and x264, in every wheel but Pyodide's, under the
+GPL-2.0-or-later, which makes such a wheel, as a whole, GPL-3.0-or-later. Its
+complete source and build recipes are on the GitHub release of its version,
+https://github.com/academa-labs/manimgx/releases/tag/vX.Y.Z for ManimGX X.Y.Z:
+manimgx-X.Y.Z-source.tar.xz, ManimGX's committed repository with every crate
+rust/Cargo.lock names and each archive a workspace's crate fetches, with the Linux
+builds' Mesa/glslang archives and exact distribution source RPMs. System build tools
+remain prerequisites. The Linux wheels' lavapipe is in LICENSE-LAVAPIPE. Written by
+scripts/release/licenses.py. The Windows wheels' DXC is in LICENSE-DXC.
===============================================================================
ab_glyph 0.2.32 (Apache-2.0): LICENSE
@@ -8206,6 +8208,93 @@ EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
+===============================================================================
+manimgx 0.1.1: rust/engine/src/bloom.wgsl (Apache-2.0)
+manimgx 0.1.1: rust/engine/src/dfg.bin (Apache-2.0)
+manimgx 0.1.1: rust/engine/src/light.wgsl (Apache-2.0)
+manimgx 0.1.1: rust/engine/src/occlusion.rs (Apache-2.0)
+manimgx 0.1.1: rust/engine/src/occlusion.wgsl (Apache-2.0)
+manimgx 0.1.1: rust/engine/src/tone.wgsl (Apache-2.0)
+-------------------------------------------------------------------------------
+Copyright 2015 The Android Open Source Project
+Copyright 2016 The Android Open Source Project
+Copyright 2021 The Android Open Source Project
+Copyright The Android Open Source Project
+
+Apache License
+Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
===============================================================================
memmap2 0.9.11 (MIT OR Apache-2.0): LICENSE-APACHE
-------------------------------------------------------------------------------
diff --git a/README.md b/README.md
index 16497ccc..27950cc5 100644
--- a/README.md
+++ b/README.md
@@ -155,7 +155,10 @@ and links to the documentation as Markdown.
community-maintained fork.
The Rust renderer uses [wgpu](https://wgpu.rs) for native GPU rendering and WebGPU in
-the browser. [Typst](https://typst.app) typesets text and math, with
+the browser. Its 3D lighting is adapted from Google's
+[Filament](https://github.com/google/filament): physically based materials,
+image-based lighting, ambient occlusion, bloom and AgX tone mapping.
+[Typst](https://typst.app) typesets text and math, with
[mitex](https://github.com/mitex-rs/mitex) translating LaTeX input to Typst.
[x264](https://www.videolan.org/developers/x264.html) encodes native video exports as
H.264; [FFmpeg](https://ffmpeg.org) decodes imported audio, using
diff --git a/REUSE.toml b/REUSE.toml
index c7651bce..98cff008 100644
--- a/REUSE.toml
+++ b/REUSE.toml
@@ -46,6 +46,12 @@ path = "rust/mitex-spec-gen/spec.rkyv"
SPDX-FileCopyrightText = "the mitex authors (Myriad-Dreamin, OrangeX4, Enter-tainer, Shichien)"
SPDX-License-Identifier = "Apache-2.0"
+# the DFG table scripts/engine/dfg_table.py writes: whose that script is
+[[annotations]]
+path = "rust/engine/src/dfg.bin"
+SPDX-FileCopyrightText = ["2026 Academa, Inc.", "2015 The Android Open Source Project"]
+SPDX-License-Identifier = "Apache-2.0"
+
# documents from elsewhere: the Contributor Covenant, adapted
[[annotations]]
path = ".github/CODE_OF_CONDUCT.md"
diff --git a/docs/content/changelog.md b/docs/content/changelog.md
index 9aa3cc03..c2ce557c 100644
--- a/docs/content/changelog.md
+++ b/docs/content/changelog.md
@@ -29,6 +29,7 @@ The notable changes to ManimGX, release by release. The format follows
### Fixed
- Preserve the benchmark comparison images' aspect ratios when PyPI narrows the README table.
+- Credit Filament, whose code the 3D lighting is adapted from, in the README and the wheels' third-party notices.
## 0.1.1
diff --git a/docs/content/developer-guide/project-management.md b/docs/content/developer-guide/project-management.md
index 9cdc83ac..b771a008 100644
--- a/docs/content/developer-guide/project-management.md
+++ b/docs/content/developer-guide/project-management.md
@@ -224,9 +224,10 @@ to `main` and every pull request, in the Test workflow (see
ManimGX is under the MIT License, in
[`LICENSE`](https://github.com/academa-labs/manimgx/blob/main/LICENSE): GitHub, PyPI and
-npm show it. Some files are others': modules ported from Manim CE, the Noto fonts, the
-corpus's scenes from CE's documentation, the command spec made from mitex's Typst package, a
-few documents and images. The repository says whose each file is, and under which license, as
+npm show it. Some files are others': modules ported from Manim CE, the engine's 3D lighting
+adapted from [Filament](https://github.com/google/filament)'s, the Noto fonts, the corpus's
+scenes from CE's documentation, the command spec made from mitex's Typst package, a few
+documents and images. The repository says whose each file is, and under which license, as
[REUSE](https://reuse.software) specifies:
- a file with code from elsewhere says it in its first lines: an `SPDX-FileCopyrightText`
@@ -359,14 +360,14 @@ Beside it, at the root, the notices `license-files` names besides `LICENSE`:
- [`LICENSE-THIRD-PARTY`](https://github.com/academa-labs/manimgx/blob/main/LICENSE-THIRD-PARTY):
what the wheels hold that others hold the copyright in, with the licenses and notices it
- comes with: the package's files that name others (the modules ported from Manim CE), with
- their copyright lines and their licenses' texts from `LICENSES/`; and every crate compiled
- into the engine, in each build a wheel holds (each platform's extension, Pyodide's, the
- player for a page), with the license and notice files it ships, the workspace's crates
- those of what they fetch (x264's, FFmpeg's, libopus's, mitex's). `just licenses` writes it
- again after `Cargo.lock` changes (so does `just upgrade`), or after code carrying
- third-party notices moves between files. A test fails while the notice is stale, or
- while a license in it is not among ManimGX's.
+ comes with: the package's and the engine's files that name others (the modules ported from
+ Manim CE, the engine's 3D lighting), with their copyright lines and their licenses' texts
+ from `LICENSES/`; and every crate compiled into the engine, in each build a wheel holds
+ (each platform's extension, Pyodide's, the player for a page), with the license and notice
+ files it ships, the workspace's crates those of what they fetch (x264's, FFmpeg's,
+ libopus's, mitex's). `just licenses` writes it again after `Cargo.lock` changes (so does
+ `just upgrade`), or after code carrying third-party notices moves between files. A test
+ fails while the notice is stale, or while a license in it is not among ManimGX's.
- [`LICENSE-LAVAPIPE`](https://github.com/academa-labs/manimgx/blob/main/LICENSE-LAVAPIPE):
the notices of the lavapipe the Linux wheels hold: Mesa's, with the copyright lines of the
sources it is built from, and those of what it holds, of the libraries it links to and of
diff --git a/pyproject.toml b/pyproject.toml
index eadada27..b1f6d2e3 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -8,13 +8,13 @@ description = "The animation engine for agents: blazingly fast math and 3D video
requires-python = ">=3.13"
# what the distributions hold: ManimGX (MIT, LICENSE); what others hold the copyright in
# (LICENSE-THIRD-PARTY, which scripts/release/licenses.py writes, checking that this covers it): the
-# modules ported from Manim CE, the crates compiled into the engine, x264 (GPL-2.0-or-later),
-# FFmpeg (LGPL-2.1-or-later) with libopus, and mitex's Typst package among them, Typst's fonts
-# (OFL-1.1, LPPL-1.3c as the GUST Font License, GPL-3.0-or-later with its font exception,
-# DejaVu's Bitstream Vera and Arev terms), HTML data (W3C) and citation styles (CC-BY-SA-3.0);
-# and in the Linux wheels, Mesa's lavapipe with LLVM (Apache-2.0 WITH LLVM-exception;
-# LICENSE-LAVAPIPE); and Windows wheels' DXC (NCSA, LICENSE-DXC). The Noto fonts are
-# manimgx-fonts'.
+# modules ported from Manim CE, the engine's 3D lighting (Apache-2.0), the crates compiled into
+# the engine, x264 (GPL-2.0-or-later), FFmpeg (LGPL-2.1-or-later) with libopus, and mitex's
+# Typst package among them, Typst's fonts (OFL-1.1, LPPL-1.3c as the GUST Font License,
+# GPL-3.0-or-later with its font exception, DejaVu's Bitstream Vera and Arev terms), HTML data
+# (W3C) and citation styles (CC-BY-SA-3.0); and in the Linux wheels, Mesa's lavapipe with LLVM
+# (Apache-2.0 WITH LLVM-exception; LICENSE-LAVAPIPE); and Windows wheels' DXC (NCSA,
+# LICENSE-DXC). The Noto fonts are manimgx-fonts'.
license = "MIT AND GPL-2.0-or-later AND LGPL-2.1-or-later AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSL-1.0 AND ISC AND MPL-2.0 AND Unicode-3.0 AND Zlib AND 0BSD AND OFL-1.1 AND LPPL-1.3c AND GPL-3.0-or-later WITH Font-exception-2.0 AND Bitstream-Vera AND LicenseRef-Arev-Fonts AND W3C-20150513 AND CC-BY-SA-3.0 AND Apache-2.0 WITH LLVM-exception AND NCSA AND MIT-Khronos-old"
license-files = ["LICENSE", "LICENSE-THIRD-PARTY", "LICENSE-LAVAPIPE", "LICENSE-DXC"]
authors = [{ name = "Academa Team", email = "[email protected]" }]
diff --git a/rust/engine/src/bloom.rs b/rust/engine/src/bloom.rs
index 1faa4e26..f263fd4e 100644
--- a/rust/engine/src/bloom.rs
+++ b/rust/engine/src/bloom.rs
@@ -1,8 +1,8 @@
-//! A 3D view's bloom (`Camera.bloom`): the glow a lens and a sensor spread around the light they take in, as
-//! Filament's bloom has it in its interpolating mode (`bloom.wgsl`), which keeps the light: a share of the light the view
-//! shows is spread over levels of half the size each and added back up, the rest stays where it is, and each pixel is
-//! shown with the glow over it. The view's composite leaves its pixels' paint and light for it (`vector::Out::Color`'s
-//! `light_out`) instead of showing them; a view without lit content, or without bloom, shows its pixels as it did.
+//! A 3D view's bloom (`Camera.bloom`): the glow a lens and a sensor spread around the light they take in, which keeps
+//! the light (`bloom.wgsl`): a share of the light the view shows is spread over levels of half the size each and added
+//! back up, the rest stays where it is, and each pixel is shown with the glow over it. The view's composite leaves its
+//! pixels' paint and light for it (`vector::Out::Color`'s `light_out`) instead of showing them; a view without lit
+//! content, or without bloom, shows its pixels as it did.
/// The levels: the view halved, then halved again while a level keeps this many texels across its narrower side (a
/// 1920x1080 view's: 960x540 down to 15x9, seven, the coarsest level's texel an eighth of the view's height; half the
diff --git a/rust/engine/src/bloom.wgsl b/rust/engine/src/bloom.wgsl
index 61a5d131..db32b706 100644
--- a/rust/engine/src/bloom.wgsl
+++ b/rust/engine/src/bloom.wgsl
@@ -1,11 +1,14 @@
-// A 3D view's bloom (`bloom.rs`): the glow a lens and a sensor spread around the light they take in, as Filament's
-// bloom has it (PostProcessManager::bloom; materials bloomDownsample, bloomUpsample) in its interpolating mode, which
-// keeps the light: a share of each pixel's light (the view's strength) is spread over the view, the rest stays where
-// it is. The share is taken from the light the view shows (its composite's: what lies nearer has hidden the light
-// behind it), at half the view's size (`spread`), then halved level by level (`down`), and the levels are added back up
-// from the coarsest (`up`), each as much of the glow as any other, so that it falls off about as the square of the
-// distance, out to the coarsest level's reach, as a lens's glare does. Each pixel is then shown with the glow over it
-// (`show`).
+// SPDX-FileCopyrightText: 2026 Academa, Inc.
+// SPDX-FileCopyrightText: The Android Open Source Project
+// SPDX-License-Identifier: Apache-2.0
+// Modified by Academa, Inc.
+
+// A 3D view's bloom (`bloom.rs`): the glow a lens and a sensor spread around the light they take in, which keeps the
+// light: a share of each pixel's light (the view's strength) is spread over the view, the rest stays where it is. The
+// share is taken from the light the view shows (its composite's: what lies nearer has hidden the light behind it), at
+// half the view's size (`spread`), then halved level by level (`down`), and the levels are added back up from the
+// coarsest (`up`), each as much of the glow as any other, so that it falls off about as the square of the distance,
+// out to the coarsest level's reach, as a lens's glare does. Each pixel is then shown with the glow over it (`show`).
// The view's glow: the share of its light spread, the share each level spreads (strength / levels), its tone mapping
// (`tone.wgsl`'s `toned`).
@@ -33,9 +36,9 @@ fn tap(uv: vec2<f32>, t: vec2<f32>, x: f32, y: f32) -> vec3<f32> {
}
// Texel `id` of `level` from the level before it (`source`, twice its size): the mean of the 6 x 6 texels around it,
-// weighted toward its middle, by 13 bilinear taps (Jimenez's, as Filament's: the four around its centre, half the weight,
-// and four overlapping squares of four around them, an eighth each), which keeps the light (each texel of the level
-// before counts a quarter in all, as in a 2 x 2 box) and lets little alias where a small light moves across the texels.
+// weighted toward its middle, by 13 bilinear taps (Jimenez's: the four around its centre, half the weight, and four
+// overlapping squares of four around them, an eighth each), which keeps the light (each texel of the level before
+// counts a quarter in all, as in a 2 x 2 box) and lets little alias where a small light moves across the texels.
fn halved(id: vec2<u32>) -> vec3<f32> {
let uv = (vec2<f32>(id) + 0.5) / vec2<f32>(textureDimensions(level));
let t = 1.0 / vec2<f32>(textureDimensions(source));
@@ -64,7 +67,7 @@ fn down(@builtin(global_invocation_id) id: vec3<u32>) {
}
// Each level added up, from the coarsest: its own share and the coarser levels' (`source`, half its size), read through
-// a tent over the 3 x 3 of its texels around each (Filament's), which keeps the light.
+// a tent over the 3 x 3 of its texels around each, which keeps the light.
@compute @workgroup_size(8, 8)
fn up(@builtin(global_invocation_id) id: vec3<u32>) {
if (any(id.xy >= textureDimensions(level))) {
diff --git a/rust/engine/src/environment.rs b/rust/engine/src/environment.rs
index 57733690..5552d9a8 100644
--- a/rust/engine/src/environment.rs
+++ b/rust/engine/src/environment.rs
@@ -1,18 +1,18 @@
//! Environments: light from all around a 3D view, a picture of its surroundings (an equirectangular Radiance image,
//! RGBE: a byte of red, green, blue and a shared exponent a pixel), lighting its mobjects with a material from every
-//! direction, metals reflecting it. Filament's image-based light: its diffuse light nine spherical harmonics (computed
-//! here, from the picture), its specular light a cube of the picture prefiltered by the GGX lobe a roughness a level
-//! (on the GPU, when a view first shows it: `environment.wgsl`), read by the split sum (`light.wgsl`).
+//! direction, metals reflecting it. Image-based light: its diffuse light nine spherical harmonics (computed here, from
+//! the picture), its specular light a cube of the picture prefiltered by the GGX lobe a roughness a level (on the GPU,
+//! when a view first shows it: `environment.wgsl`), read by the split sum (`light.wgsl`).
#[cfg(feature = "render")]
-/// A cube's side, in texels (about a fifth of a degree a texel: cmgen's cubes in new_filament's assets).
+/// A cube's side, in texels (about a fifth of a degree a texel).
pub(crate) const SIDE: u32 = 512;
#[cfg(feature = "render")]
/// Its roughness levels, 512 to 16 texels a side: level l is the GGX lobe of perceptual roughness r with
-/// l = (LEVELS - 1) r (2 - r) (Filament's mapping).
+/// l = (LEVELS - 1) r (2 - r).
pub(crate) const LEVELS: u32 = 6;
#[cfg(feature = "render")]
-/// The samples a level's texel averages (cmgen's): fewer blur the glossy levels (each sample then reads a coarser mip),
+/// The samples a level's texel averages: fewer blur the glossy levels (each sample then reads a coarser mip),
/// measured in experiments/b4-ibl.
const SAMPLES: u32 = 1024;
#[cfg(feature = "render")]
@@ -165,7 +165,7 @@ pub(crate) fn direction(u: f64, v: f64) -> [f64; 3] {
/// The diffuse light of a picture: nine spherical harmonics of its light, each weighted by its pixel's solid angle,
/// convolved with the cosine lobe (Ramamoorthi and Hanrahan's 1, 2/3, 1/4 a band) and divided by pi, each with its
/// basis function's constant, so that a matte white surface facing n shows c0 + c1 y + c2 z + c3 x + c4 xy + c5 yz
-/// + c6 (3 z^2 - 1) + c7 zx + c8 (x^2 - y^2) (cmgen's `--sh-shader`, Filament's `irradianceSH`).
+/// + c6 (3 z^2 - 1) + c7 zx + c8 (x^2 - y^2) (`light.wgsl`'s `irradiance`).
pub(crate) fn harmonics(width: u32, height: u32, rgbe: &[u8]) -> [[f32; 4]; 9] {
let mut sum = [[0f64; 3]; 9];
// every pixel of a picture up to 1024 wide, else every k-th (a smooth function needs no more)
diff --git a/rust/engine/src/light.wgsl b/rust/engine/src/light.wgsl
index 4cb39319..4c78b32e 100644
--- a/rust/engine/src/light.wgsl
+++ b/rust/engine/src/light.wgsl
@@ -1,14 +1,18 @@
-// Light on a surface with a material, as Filament shades it (its standard model: GGX distribution, height-correlated
-// Smith visibility, Schlick Fresnel, Lambert diffuse), from a view's lights: the radiance the surface sends toward the
-// eye, which the view's tone mapping shows (`tone.wgsl`). A light's intensity is what a white matte surface shows: 1
-// makes one facing it white (its illuminance is π times the intensity; an ambient light's radiance is the intensity,
-// from every direction).
+// SPDX-FileCopyrightText: 2026 Academa, Inc.
+// SPDX-FileCopyrightText: The Android Open Source Project
+// SPDX-License-Identifier: Apache-2.0
+// Modified by Academa, Inc.
+
+// Light on a surface with a material (GGX distribution, height-correlated Smith visibility, Schlick Fresnel, Lambert
+// diffuse), from a view's lights: the radiance the surface sends toward the eye, which the view's tone mapping shows
+// (`tone.wgsl`). A light's intensity is what a white matte surface shows: 1 makes one facing it white (its
+// illuminance is π times the intensity; an ambient light's radiance is the intensity, from every direction).
// A light (see `feed.lighting`): where (an ambient light: nowhere; a sun: the unit direction toward it; a point or
// spot: its position; an environment: its picture's +x) and its kind (0 ambient, 1 sun, 2 point, 3 spot, 4
// environment); its color in linear light times its intensity, and how far a point or spot reaches (an environment:
// its cube's roughest level); a spot's axis (where it points; an environment: its picture's up, +z, and the light a 1
-// in its cube stands for) and its cone's falloff, scale and offset (Filament's); then its shadow map's layer (-1: none), a texel's world size (a spot's: at
+// in its cube stands for) and its cone's falloff, scale and offset; then its shadow map's layer (-1: none), a texel's world size (a spot's: at
// unit distance along its axis), whether the map is a perspective one (`shadow.rs`), and where the map sees from
// (clip = shadow · world).
struct Light {
@@ -20,7 +24,7 @@ struct Light {
};
const LIGHT_PI: f32 = 3.14159265358979;
-const MIN_PERCEPTUAL_ROUGHNESS: f32 = 0.045; // below it, highlights alias and f16 overflows (Filament's)
+const MIN_PERCEPTUAL_ROUGHNESS: f32 = 0.045; // below it, highlights alias and f16 overflows
fn d_ggx(roughness: f32, NoH: f32) -> f32 {
let one_minus = 1.0 - NoH * NoH;
@@ -46,15 +50,14 @@ fn f_schlick(f0: vec3<f32>, LoH: f32) -> vec3<f32> {
// The radiance a surface at p, facing n (either side: the one toward v), sends toward v (a unit vector toward the
// eye), lit by the view's lights (`light_count`, `light_at`, `shadowed`, `dfg_at`, `environment_at`, `harmonic`: its
// host's): its base color in linear light, how metallic, how rough (perceptual), how much a dielectric reflects head
-// on. The specular lobe keeps the light single scattering loses on a rough surface (Filament's energy compensation,
-// from the DFG table's albedo of a white conductor, y): a white rough metal under a uniform light shows that light,
-// at any roughness. Light from all around (an ambient light, an environment) lights by the split sum, as Filament's
-// image-based light does: the specular lobe's albedo, mix(dfg.x, dfg.y, f0), times the light the lobe gathers (an
-// environment's cube at the roughness's level, toward the lobe's dominant direction), and the diffuse part the light
-// the specular lobe does not reflect (1 - its albedo). Of that light, `ao` reaches p (its view's ambient occlusion; 1:
-// all of it): the diffuse part takes it as it is, the specular lobe as much of it as a lobe that narrow sees (Lagarde
-// and de Rousiers' approximation), each with the light that bounces between the surfaces that shut it out (`bounced`),
-// as Filament's multiple-bounce ambient occlusion has them.
+// on. The specular lobe keeps the light single scattering loses on a rough surface (energy compensation, from the
+// DFG table's albedo of a white conductor, y): a white rough metal under a uniform light shows that light, at any
+// roughness. Light from all around (an ambient light, an environment) lights by the split sum: the specular lobe's
+// albedo, mix(dfg.x, dfg.y, f0), times the light the lobe gathers (an environment's cube at the roughness's level,
+// toward the lobe's dominant direction), and the diffuse part the light the specular lobe does not reflect (1 - its
+// albedo). Of that light, `ao` reaches p (its view's ambient occlusion; 1: all of it): the diffuse part takes it as it
+// is, the specular lobe as much of it as a lobe that narrow sees (Lagarde and de Rousiers' approximation), each with
+// the light that bounces between the surfaces that shut it out (`bounced`).
fn reflected(base: vec3<f32>, metallic: f32, perceptual_roughness: f32, reflectance: f32, normal: vec3<f32>, p: vec3<f32>, v: vec3<f32>, ao: f32) -> vec3<f32> {
let n = select(normal, -normal, dot(normal, v) < 0.0);
let perceptual = clamp(perceptual_roughness, MIN_PERCEPTUAL_ROUGHNESS, 1.0);
@@ -119,8 +122,8 @@ fn reflected(base: vec3<f32>, metallic: f32, perceptual_roughness: f32, reflecta
// A surface's perceptual roughness widened by how far its normal turns across a pixel (`turn`: the normal's change a
// pixel across and a pixel down, each squared, summed): a highlight narrower than the pixel then shows its light
// averaged over the pixel, not its light at the one point shaded, which a glint misses or hits, by orders of magnitude,
-// from frame to frame (Filament's normal filtering: Kaplanyan 2016; Tokuyoshi and Kaplanyan 2019; its variance 0.15 and
-// threshold 0.2). A flat surface keeps its roughness.
+// from frame to frame (normal filtering: Kaplanyan 2016; Tokuyoshi and Kaplanyan 2019; its variance 0.15 and threshold
+// 0.2). A flat surface keeps its roughness.
fn over_pixel(perceptual: f32, turn: f32) -> f32 {
let roughness = perceptual * perceptual;
let kernel = min(2.0 * 0.15 * turn, 0.2);
diff --git a/rust/engine/src/occlusion.rs b/rust/engine/src/occlusion.rs
index eb5ce842..a65a6843 100644
--- a/rust/engine/src/occlusion.rs
+++ b/rust/engine/src/occlusion.rs
@@ -1,21 +1,25 @@
+// SPDX-FileCopyrightText: 2026 Academa, Inc.
+// SPDX-FileCopyrightText: 2016 The Android Open Source Project
+// SPDX-License-Identifier: Apache-2.0
+// Modified by Academa, Inc.
+
//! A 3D view's ambient occlusion (`Camera.ambient_occlusion`): how much of the light from all around reaches the
-//! surface each pixel shows, as the surfaces near it shut it out — Filament's scalable ambient obscurance (McGuire,
-//! Mara and Luebke 2012), as new_filament ports it (`occlusion.wgsl`). The view's opaque depth comes first, its opaque
-//! meshes' (`vs_depth`) and then its opaque paths' where nearer (`vector::Out::Opaque`); from it come distances along
-//! the view, a pyramid of them, the occlusion and its low-pass, which the view's lit passes read (`light.wgsl`: what
-//! an ambient or environment light gives a surface, times it).
+//! surface each pixel shows, as the surfaces near it shut it out — scalable ambient obscurance (McGuire, Mara and
+//! Luebke 2012; `occlusion.wgsl`). The view's opaque depth comes first, its opaque meshes' (`vs_depth`) and then its
+//! opaque paths' where nearer (`vector::Out::Opaque`); from it come distances along the view, a pyramid of them, the
+//! occlusion and its low-pass, which the view's lit passes read (`light.wgsl`: what an ambient or environment light
+//! gives a surface, times it).
use std::f32::consts::TAU;
-/// The taps a pixel's occlusion is sought with, and the turns of their spiral (Filament's high quality; its spiral's
-/// start interleaved 4 x 4: `occlusion.wgsl`'s `start`).
+/// The taps a pixel's occlusion is sought with, and the turns of their spiral (its start interleaved 4 x 4:
+/// `occlusion.wgsl`'s `start`).
const SAMPLES: f32 = 16.0;
const TURNS: f32 = 7.0;
-/// How far a surface's depth is taken nearer than it is, as a share of its distance (Filament's default bias): no
-/// surface shuts out its own light.
+/// How far a surface's depth is taken nearer than it is, as a share of its distance: no surface shuts out its own
+/// light.
const BIAS: f32 = 0.0005;
-/// The depth within which the low-pass takes a neighbour as the surface's own, as a share of the radius (Filament's
-/// defaults: 5 cm of 30).
+/// The depth within which the low-pass takes a neighbour as the surface's own, as a share of the radius (5 cm of 30).
const SAME_SURFACE: f32 = 1.0 / 6.0;
/// The passes: a mesh's depth as its view sees it (the raster pipeline's `vs_depth`), and the occlusion's: distances,
@@ -80,7 +84,7 @@ impl Occlusion {
/// Where a view of `size` finds its occlusion.
pub(crate) fn occluded(&self, device: &wgpu::Device, [width, height]: [u32; 2]) -> Occluded {
- // the pyramid's levels: down to about 32 pixels across the view's longer side, 2 to 8 of them (Filament's)
+ // the pyramid's levels: down to about 32 pixels across the view's longer side, 2 to 8 of them
let levels = (32 - width.max(height).leading_zeros()).saturating_sub(5).clamp(2, 8);
let sizes: Vec<[u32; 2]> = (0..levels).map(|l| [(width >> l).max(1), (height >> l).max(1)]).collect();
let texture = |label: &str, [w, h]: [u32; 2], levels: u32, format, usage| {
@@ -112,8 +116,7 @@ impl Occlusion {
}
/// A view's occlusion, once its opaque depth is drawn: `projection` the view's (rows; a 3D view's: depth z / w =
- /// near / distance, see `feed.view`), how much (`amount`, Filament's intensity) and how far around (`radius`, in
- /// the world's units).
+ /// near / distance, see `feed.view`), how much (`amount`) and how far around (`radius`, in the world's units).
pub(crate) fn encode(&self, queue: &wgpu::Queue, encoder: &mut wgpu::CommandEncoder, o: &Occluded, projection: &[[f32; 4]; 4], amount: f32, radius: f32) {
let length = |r: [f32; 4]| (r[0] * r[0] + r[1] * r[1] + r[2] * r[2]).sqrt();
let unit = length(projection[3]); // w a unit along the view: one over the focal distance
@@ -122,7 +125,7 @@ impl Occlusion {
let [width, height] = o.sizes[0];
let params: [f32; 16] = [
tan_x, tan_y, near, (o.sizes.len() - 1) as f32,
- radius, 2.0, TAU * peak * amount / SAMPLES, BIAS, // (twice the power: Filament's 1)
+ radius, 2.0, TAU * peak * amount / SAMPLES, BIAS, // (twice a power of 1)
peak * peak, 1.0 / (radius * radius), 0.5 * height as f32 / tan_y, 0.0,
0.0, TURNS * TAU / (SAMPLES - 0.5), SAMPLES, 1.0 / (SAME_SURFACE * radius),
];
diff --git a/rust/engine/src/occlusion.wgsl b/rust/engine/src/occlusion.wgsl
index 82070dfc..12be68c0 100644
--- a/rust/engine/src/occlusion.wgsl
+++ b/rust/engine/src/occlusion.wgsl
@@ -1,7 +1,11 @@
-// A 3D view's ambient occlusion (`occlusion.rs`): Filament's scalable ambient obscurance (materials/ssao: sao.mat,
-// saoImpl.fs, mipmapDepth.mat, bilateralBlur.mat), as new_filament ports it (engine_ao, engine_depthmip,
-// engine_aoblur), over the view's opaque depth: as distances along the view (`linearize`), a pyramid of them
-// (`depth_mip`), the occlusion (`sao`), and its low-pass, which stops where depth jumps (`blur`).
+// SPDX-FileCopyrightText: 2026 Academa, Inc.
+// SPDX-FileCopyrightText: 2021 The Android Open Source Project
+// SPDX-License-Identifier: Apache-2.0
+// Modified by Academa, Inc.
+
+// A 3D view's ambient occlusion (`occlusion.rs`): scalable ambient obscurance, over the view's opaque depth: as
+// distances along the view (`linearize`), a pyramid of them (`depth_mip`), the occlusion (`sao`), and its low-pass,
+// which stops where depth jumps (`blur`).
// The view: its half extent at unit distance (x, y), its near plane's distance, its pyramid's coarsest level; the
// occlusion's radius, twice its power, its intensity's share a tap, its bias; its peak squared, one over its radius
@@ -50,7 +54,7 @@ fn depth_mip(@builtin(global_invocation_id) id: vec3<u32>) {
// Where a pixel's spiral starts, as a share of a turn and of a tap's step out: one of 16, interleaved 4 x 4 in Bayer's
// order, so the low-pass (as wide as the interleave) averages every start in every neighbourhood: 16 taps look as
-// smooth as 32 interleaved-gradient ones (Jimenez 2014, Filament's), which streak at 16 (experiments/ambient-occlusion).
+// smooth as 32 interleaved-gradient ones (Jimenez 2014), which streak at 16 (experiments/ambient-occlusion).
const STARTS = array<f32, 16>(0.0, 8.0, 2.0, 10.0, 12.0, 4.0, 14.0, 6.0, 3.0, 11.0, 1.0, 9.0, 15.0, 7.0, 13.0, 5.0);
fn start(p: vec2<u32>) -> f32 {
@@ -68,9 +72,8 @@ fn depth_texel(p: vec2<i32>) -> f32 {
// A tap at uv on the pyramid's level `level`: the distance its texel there holds (its edge held beyond it), and where
// that distance was seen — the view's own pixel it is a copy of (the child rule, down to level 0), at its centre. A
-// tap is a real point of a surface, where it is: Filament's places the distance at uv itself, which lifts a tap off
-// a slanted plane by the depth's change over the texel's offset, and a flat floor seen at a slant shuts out its own
-// light.
+// tap is a real point of a surface, where it is: the distance placed at uv itself would lift a tap off a slanted plane
+// by the depth's change over the texel's offset, and a flat floor seen at a slant would shut out its own light.
fn tap(uv: vec2<f32>, level: u32) -> vec3<f32> {
let size0 = vec2<i32>(textureDimensions(depth0));
if (level == 0u) {
@@ -131,7 +134,7 @@ fn visibility(id: vec2<u32>) -> f32 {
for (var i = 0.0; i < samples; i += 1.0) {
let t = sq((i + noise + 0.5) / (samples - 0.5));
let r = max(1.0, t * disk);
- // (the view's y grows downward, Filament's upward: the tap mirrored keeps its spiral)
+ // (the view's y grows downward: the tap mirrored, the spiral turns as it would with y up)
let q = uv + r * vec2<f32>(dir.x, -dir.y) * texel;
dir = vec2<f32>(dir.x * ci - dir.y * si, dir.x * si + dir.y * ci);
let level = u32(clamp(floor(log2(r)) - 3.0, 0.0, params.proj.w));
diff --git a/rust/engine/src/render.rs b/rust/engine/src/render.rs
index eea601cb..6345ae01 100644
--- a/rust/engine/src/render.rs
+++ b/rust/engine/src/render.rs
@@ -1181,7 +1181,7 @@ impl Gpu {
compare: Some(wgpu::CompareFunction::LessEqual),
..Default::default()
});
- // the split sum's DFG terms (Filament's, with its multiple-scattering term: scripts/engine/dfg_table.py), NoV across,
+ // the split sum's DFG terms (with the multiple-scattering term: scripts/engine/dfg_table.py), NoV across,
// perceptual roughness down: 64 KB, made once
let size = wgpu::Extent3d { width: 128, height: 128, depth_or_array_layers: 1 };
let table = device.create_texture(&wgpu::TextureDescriptor { label: Some("dfg"), size, mip_level_count: 1, sample_count: 1, dimension: wgpu::TextureDimension::D2, format: wgpu::TextureFormat::Rg16Float, usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST, view_formats: &[] });
diff --git a/rust/engine/src/shadow.rs b/rust/engine/src/shadow.rs
index 9b61e8de..a1e4f67d 100644
--- a/rust/engine/src/shadow.rs
+++ b/rust/engine/src/shadow.rs
@@ -3,7 +3,7 @@
//! to the sphere around the casters and as deep as what their shadows can fall on; a surface with a material compares
//! its depth with the map (`light.wgsl`'s `shadowed`).
-/// A map's side, in texels (Filament's default).
+/// A map's side, in texels.
pub(crate) const SIZE: u32 = 2048;
/// The most maps a view draws (its first suns and spots that cast shadows).
pub(crate) const MOST: usize = 4;
diff --git a/rust/engine/src/tone.wgsl b/rust/engine/src/tone.wgsl
index 4375e09d..4efe85cb 100644
--- a/rust/engine/src/tone.wgsl
+++ b/rust/engine/src/tone.wgsl
@@ -1,3 +1,8 @@
+// SPDX-FileCopyrightText: 2026 Academa, Inc.
+// SPDX-FileCopyrightText: 2021 The Android Open Source Project
+// SPDX-License-Identifier: Apache-2.0
+// Modified by Academa, Inc.
+
// How light shows on a display: the radiance a view's lit content sends toward the eye, scaled by the exposure,
// clipped or rolled off by AgX, encoded as sRGB (as every color is: `paint.wgsl`'s are).
@@ -7,8 +12,8 @@ fn gamma(c: vec3<f32>) -> vec3<f32> {
return select(1.055 * pow(l, vec3<f32>(1.0 / 2.4)) - 0.055, 12.92 * l, l <= vec3<f32>(0.0031308));
}
-// AgX (Sobotka's, as Filament has it): the sRGB scene value into its working space (Rec.2020, inset), its log2 over
-// 16.5 stops through a sigmoid, back out (outset), to linear sRGB.
+// AgX (Sobotka's; its matrices Blender's, its curve the iolite engine's minimal AgX): the sRGB scene value into its
+// working space (Rec.2020, inset), its log2 over 16.5 stops through a sigmoid, back out (outset), to linear sRGB.
const AGX_IN: mat3x3<f32> = mat3x3<f32>(
vec3<f32>(0.544904663, 0.140439629, 0.088826896),
vec3<f32>(0.373779945, 0.754110565, 0.178877349),
diff --git a/scripts/engine/dfg_table.py b/scripts/engine/dfg_table.py
index 3477b406..b6eda3f8 100644
--- a/scripts/engine/dfg_table.py
+++ b/scripts/engine/dfg_table.py
@@ -1,13 +1,17 @@
+# SPDX-FileCopyrightText: 2026 Academa, Inc.
+# SPDX-FileCopyrightText: 2015 The Android Open Source Project
+# SPDX-License-Identifier: Apache-2.0
+# Modified by Academa, Inc.
+
# /// script
# requires-python = ">=3.13"
# dependencies = ["numpy"]
# ///
-"""Write the DFG table the engine lights with (rust/engine/src/dfg.bin): Filament's split-sum terms of the GGX
-specular lobe with height-correlated Smith visibility, 128 x 128, NoV across (x) and perceptual roughness down (y),
-at the texels' centres, each texel two half floats: x = the integral of Fc V (Fc = (1 - VoH)^5), y = the integral of V
-(Filament's DFV_Multiscatter), by 1024 Hammersley samples of the GGX distribution, as new_filament's dfg.wgsl and
-Filament's CubemapIBL::DFG compute them. A surface's specular albedo is mix(x, y, f0), and its single scattering
-keeps y of a white conductor's light (the rest Filament's energy compensation gives back).
+"""Write the DFG table the engine lights with (rust/engine/src/dfg.bin): the split-sum terms of the GGX specular lobe
+with height-correlated Smith visibility, 128 x 128, NoV across (x) and perceptual roughness down (y), at the texels'
+centres, each texel two half floats: x = the integral of Fc V (Fc = (1 - VoH)^5), y = the integral of V, by 1024
+Hammersley samples of the GGX distribution. A surface's specular albedo is mix(x, y, f0), and its single scattering
+keeps y of a white conductor's light (the rest the energy compensation gives back).
uv run scripts/engine/dfg_table.py
"""
diff --git a/scripts/release/licenses.py b/scripts/release/licenses.py
index 78d79c1d..28d76905 100644
--- a/scripts/release/licenses.py
+++ b/scripts/release/licenses.py
@@ -1,8 +1,9 @@
"""Write LICENSE-THIRD-PARTY: what ManimGX's wheels hold that others hold the
copyright in, with the licenses and notices it comes with, each text once, after what it covers:
-- the package's files that name others (REUSE: by their SPDX lines, or REUSE.toml), with their
- copyright lines and their licenses' texts from LICENSES/: the modules ported from Manim CE;
+- the package's and the engine's files that name others (REUSE: by their SPDX lines, or
+ REUSE.toml), with their copyright lines and their licenses' texts from LICENSES/: the modules
+ ported from Manim CE, the engine's 3D lighting;
- the crates compiled into the engine, in every build of it a wheel holds, with the license and
notice files each ships: the workspace's crates, those of the sources they fetch (x264's,
FFmpeg's and libopus's, mitex's); a crate from crates.io that ships none, its license's text
@@ -25,7 +26,10 @@ import tomllib
from pathlib import Path, PurePosixPath
ROOT = Path(__file__).resolve().parents[2]
+# the repository's files a wheel holds: the package's, installed as they are, and the engine's,
+# compiled into its extension
SOURCES = PurePosixPath("src")
+ENGINE_SOURCES = PurePosixPath("rust/engine/src")
OUT = ROOT / "LICENSE-THIRD-PARTY"
ENGINE = ROOT / "rust" / "engine"
# the engine's builds a wheel holds, as (target, features): the extension on each platform a
@@ -98,9 +102,10 @@ def holder(line: str) -> str:
def others() -> dict[tuple[str, tuple[str, ...]], list[str]]:
- """The package's files that others hold copyright in, as REUSE finds them (`reuse lint`,
- which `just check` runs), named as the wheel holds them: by license and copyright lines,
- ManimGX's left out (those of the holder REUSE.toml gives its own files)."""
+ """The package's and the engine's files that others hold copyright in, as REUSE finds
+ them (`reuse lint`, which `just check` runs), named as the wheel holds them (the
+ engine's, compiled into it, by their path in the repository): by license and copyright
+ lines, ManimGX's left out (those of the holder REUSE.toml gives its own files)."""
reuse = tomllib.loads((ROOT / "REUSE.toml").read_text(encoding="utf-8"))
own = holder(reuse["annotations"][0]["SPDX-FileCopyrightText"])
project = tomllib.loads((ROOT / "pyproject.toml").read_text(encoding="utf-8"))
@@ -117,13 +122,17 @@ def others() -> dict[tuple[str, tuple[str, ...]], list[str]]:
for file in json.loads(report.stdout)["files"]:
path = PurePosixPath(file["path"])
lines = {notice(c["value"]) for c in file["copyrights"]}
- if not path.is_relative_to(SOURCES) or not (
- theirs := {line for line in lines if holder(line) != own}
- ):
+ if path.is_relative_to(SOURCES):
+ shown = path.relative_to(SOURCES).as_posix()
+ elif path.is_relative_to(ENGINE_SOURCES):
+ shown = path.as_posix()
+ else:
+ continue
+ if not (theirs := {line for line in lines if holder(line) != own}):
continue
expression = " AND ".join(e["value"] for e in file["spdx_expressions"])
paths, holders = groups.setdefault(expression, ([], set()))
- paths.append(f"{name}: {path.relative_to(SOURCES).as_posix()}")
+ paths.append(f"{name}: {shown}")
holders |= theirs
return {
(expression, tuple(sorted(holders))): sorted(paths)
@@ -243,9 +252,11 @@ def write(
found.setdefault(written, []).append(f"{declared}: no license file")
header = header or (
"What ManimGX's wheels hold that others hold the copyright in: modules of its"
- " Python package, and the crates compiled into the engine (the extension, on"
- " each platform, Pyodide's, and the player for a page, which the extension"
- " carries), with the sources the workspace's crates fetch; with the licenses"
+ " Python package, files of its engine (its 3D lighting, adapted from Google's"
+ " Filament, https://github.com/google/filament), and the crates compiled into"
+ " the engine (the extension, on each platform, Pyodide's, and the player for a"
+ " page, which the extension carries), with the sources the workspace's crates"
+ " fetch; with the licenses"
" and notices they come with, each text once, after what it covers. FFmpeg is"
" under the LGPL-2.1-or-later, and x264, in every wheel but Pyodide's, under"
" the GPL-2.0-or-later, which makes such a wheel, as a whole, GPL-3.0-or-later."
diff --git a/src/manimgx/drawing/paint.py b/src/manimgx/drawing/paint.py
index 2ab8fdf7..95dd1c47 100644
--- a/src/manimgx/drawing/paint.py
+++ b/src/manimgx/drawing/paint.py
@@ -1106,7 +1106,7 @@ type Colors = ParsableManimColor | Sequence[ParsableManimColor]
@dataclass(frozen=True)
class Material:
- """How a surface reflects light: Filament's standard model, its base color the mobject's fill.
+ """How a surface reflects light: a physically based model, its base color the mobject's fill.
A mobject with a material is lit by the scene's lights
([`SunLight`][manimgx.SunLight], [`PointLight`][manimgx.PointLight],
diff --git a/src/manimgx/rendering/feed.py b/src/manimgx/rendering/feed.py
index 8487bebd..0870213b 100644
--- a/src/manimgx/rendering/feed.py
+++ b/src/manimgx/rendering/feed.py
@@ -347,9 +347,9 @@ def lighting(camera: "Camera", lights: "list[Light]") -> list[float]:
light: nowhere; a sun: its direction; a point or spot: its point; an environment: its
picture's right) and its kind; its color in linear light times its intensity, and a
point's or spot's reach (an environment: its picture's id, 0 the studio); a spot's axis
- (an environment: its picture's up) and the scale and offset of its cone's falloff
- (Filament's), and whether it casts shadows (an environment: its picture's sun, which
- the engine lights by as a sun of the view's). A scene with no lights has the camera's: a sun
+ (an environment: its picture's up) and the scale and offset of its cone's falloff,
+ and whether it casts shadows (an environment: its picture's sun, which the engine
+ lights by as a sun of the view's). A scene with no lights has the camera's: a sun
from its light source, and a dim ambient light (as Manim's shading always has its light).
"""
if not lights:
diff --git a/src/manimgx/scene.py b/src/manimgx/scene.py
index b5333f01..72473abc 100644
--- a/src/manimgx/scene.py
+++ b/src/manimgx/scene.py
@@ -231,15 +231,15 @@ class Camera:
self.ambient_occlusion = 0.0
"""How strongly the light from all around (an ambient or an environment light) is
shut out of corners, creases and the ground under things, where the surfaces near
- them block it: 0 not at all (off), 1 Filament's strength, more darker. Only
+ them block it: 0 not at all (off), 1 the standard strength, more darker. Only
mobjects with a [material][manimgx.Material] are lit by that light, and only opaque
ones shut it out or are darkened; a sun's, a point's or a spot's light is left as it
is.
- It is found from what the view shows (Filament's screen-space ambient
- obscurance): a surface the view cannot see, such as a wall seen edge-on, shuts
- nothing out. Light bounces between the surfaces that shut it out, so light-colored
- ones darken less, and white ones hardly at all."""
+ It is found from what the view shows (screen-space ambient obscurance): a
+ surface the view cannot see, such as a wall seen edge-on, shuts nothing out.
+ Light bounces between the surfaces that shut it out, so light-colored ones
+ darken less, and white ones hardly at all."""
self.ambient_occlusion_radius = 0.3
"""How far around a point the surfaces that shut light out of it are sought, in
scene units: about the size of the creases and contacts to darken."""
@@ -247,8 +247,8 @@ class Camera:
"""How much of the light that mobjects with a [material][manimgx.Material] send
into the view the lens spreads around it, as a glow (bloom), from 0 to 1: 0 none
(off), 0.05 a lens's faint glow, plain around light brighter than white, 1 all of
- it. What the glow spreads, the light leaves (Filament's interpolating bloom): the
- view keeps the light it has, spread.
+ it. What the glow spreads, the light leaves: the view keeps the light it has,
+ spread.
It is spread from the light the view shows: what lies nearer, a mobject fixed in
the frame too, hides the light behind it. It falls off with the distance from
diff --git a/tests/integration/test_light.py b/tests/integration/test_light.py
index 9aa63e01..708c793b 100644
--- a/tests/integration/test_light.py
+++ b/tests/integration/test_light.py
@@ -164,7 +164,7 @@ def test_a_white_rough_metal_in_a_uniform_light_shows_that_light_at_any_roughnes
):
# a white furnace: a surface that loses no energy shows its surroundings' light and no
# more, rough metal as smooth (the light single scattering loses on a rough surface is
- # given back, as Filament does)
+ # given back)
def level(roughness: float) -> float:
def build(scene: m.ThreeDScene) -> None:
sphere = m.Sphere(radius=2.0, resolution=(48, 48), stroke_width=0)