Skip to content

Add blender_principled BSDF as a Python plugin - #1822

Open
Speierers wants to merge 1 commit into
masterfrom
blender_principled_bsdf
Open

Add blender_principled BSDF as a Python plugin#1822
Speierers wants to merge 1 commit into
masterfrom
blender_principled_bsdf

Conversation

@Speierers

Copy link
Copy Markdown
Member

This PR provides a reference implementation of a Principled BSDF that matches the implementation in Blender 4.5 Cycles.

@Speierers
Speierers force-pushed the blender_principled_bsdf branch from d08fafa to cb08ce6 Compare December 17, 2025 11:17
ConnorBaker added a commit to ConnorBaker/mitsuba3 that referenced this pull request Sep 3, 2026
…aster

Cluster P2 of the feature port (PORT_LOG.md): the mitsuba-renderer#1822-derived
mitsuba.python.ad.bsdfs package (blender_principled, lobes/tables incl. the
GGX energy tables, refraction, translucent, common) plus the C++ surface it
stands on:

- BSDFSample3::sampled_roughness_squared (b3c64fb) with its zero-sentinel
  and default-member-initializer reasoning intact; DRJIT_STRUCT and the
  wo-ctor updated; binding + docstr entry. Resolved against master's
  doc-conversion churn (the `//! @}` group markers are gone on master; the
  conflict was only ever about those).

- SurfaceInteraction::min_alpha (faec917's interaction half) --
  blender_principled READS it (attr.min_alpha = si.min_alpha), which is why
  it cannot wait for the P5 path.cpp cluster. Resolved against a291652's
  instance -> instance_index rework and the new frame_flipped field: the
  DRJIT_STRUCT/binding lists keep master's members and append min_alpha.

- microfacet.h filter_glossy_alpha + the rough*/principled*/pplastic floor
  and reporting sites, applied clean (3-way) except principled.cpp's comment
  -style collision.

- NOT ported: principledhelpers.h (the fork's delta there IS upstream
  366de60, already on master).

Registration: ad/__init__ re-exports .bsdfs; set_variant's JIT reload list
gains mitsuba.python.ad.bsdfs (same mechanism as P1). Tests: the nine
python_tests suites that exercise this cluster, at their fork-final state
(incl. 26615f7's instance-class monkeypatch fix).

Evidence: pre-compile overlay run against the 0cba523 binary -- 16 passed,
16 failed, and every failure is the SAME AttributeError: SurfaceInteraction3f
has no min_alpha in the old binary. That is the expected signature of a
Python tree running ahead of its C++; the compile of this commit is the
gate, and the P2 row flips to compiled/tested only after it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PebCbQxKGLJZiynQmV1U44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant