Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
87d9f60
Added PBR2 material and option to load using glTF
Jun 19, 2025
e251bcb
Try mixins for reusing defines in materials
Jun 19, 2025
146a006
Move UV defines into a mixin
Jun 20, 2025
70a0b65
Add mixin for imageProcessing support in materials
Jun 20, 2025
73876ab
Fix compile warnings
Jun 20, 2025
81956a5
Fix error with es6 build and imageProcessing mixin
Jun 23, 2025
30f25e8
Separating reflection (IBL) defines and uniforms
Jun 24, 2025
9f9f76a
Remove pbrBaseMaterial as base class for PBR2
Jun 24, 2025
38ae487
Rename PBR2 to OpenPBR
Jun 24, 2025
8db16f7
Minor changes
Jun 25, 2025
70ba584
Fixes for OpenPBRMaterial.
Jun 26, 2025
81f2725
Adding properties to OpenPBRMaterial
Jul 10, 2025
8ca060d
fix build
sebavan Jul 10, 2025
08a9613
WIP glTFLoader dynamic material load
MiiBond Jul 10, 2025
b5de49b
Finish glTFLoader dynamic material load
Jul 11, 2025
d438866
Revert "Finish glTFLoader dynamic material load"
Jul 15, 2025
fe673ad
Revert "WIP glTFLoader dynamic material load"
Jul 15, 2025
b7d1b10
WIP replacing PBR props with OpenPBR props
Jul 17, 2025
803ffd8
Change albedo to base color
Jul 17, 2025
e976d10
WIP glTFLoader dynamic material load
MiiBond Jul 10, 2025
9a42745
Finish glTFLoader dynamic material load
Jul 11, 2025
79c0c88
Fix dynamic loading of materials in glTF loader
Jul 18, 2025
9209fd5
Add more OpenPBR properties
Jul 18, 2025
e9cd701
Add geometry_normal to OpenPBR material
Jul 21, 2025
46f32dc
Remove lightmap from OpenPBR
Jul 21, 2025
61f2112
Starting to refactor glsl shaders for OpenPBR
Jul 30, 2025
f6a8ec4
Revert settings.json
Jul 30, 2025
b336ff5
Added OpenPBR inspector data and WIP on coat noramls
Jul 31, 2025
6e81105
Refactoring OpenPBR analytic light shaders
Aug 1, 2025
550be96
WebGPU OpenPBR base layer support for direct lighting
Aug 4, 2025
cdaca4b
Fix AO compilation errors for OpenPBR
Aug 5, 2025
a393cb7
Update and rename openPbrUboDeclaration.fx to openpbrUboDeclaration.fx
MiiBond Aug 5, 2025
782c051
Update and rename openPbrUboDeclaration.fx to openpbrUboDeclaration.fx
MiiBond Aug 5, 2025
546f870
Fix default glTF PBR values
Aug 5, 2025
9cdd408
Fixes for vis tests
Aug 5, 2025
5843413
Fix specular extension loading
Aug 5, 2025
7c61a61
Fix for mixin constructor names
Aug 6, 2025
a6aaf1a
Adding support to export GLB with OpenPBR
Aug 6, 2025
76880cf
Add vis test for OpenPBR normal mapping
Aug 6, 2025
15ccf2f
OpenPBRMaterial export to glTF for diffuse roughness
Aug 6, 2025
f8c233b
Add coat_darkening to OpenPBR
Aug 7, 2025
f31dc83
Updates for coat darkening
Aug 8, 2025
a317b97
Import and export support for EXT_materials_clearcoat_darkening
Aug 8, 2025
8fb962b
Fix import in glTFExporter
Aug 18, 2025
80b92b2
Fix build errors
Aug 18, 2025
9b35115
OpenPBR and glTF support for coat color
Aug 19, 2025
ec2cce9
Remove unused vis test image
Aug 19, 2025
8d59e43
Fix for UMD build tests
MiiBond Aug 20, 2025
6d94bb4
Split OpenPBR metal and rough textures
MiiBond Aug 20, 2025
e800ddb
WIP adding anisotropy params
MiiBond Aug 20, 2025
fb6be12
Fix uniform names for OpenPBR when not using UBO
MiiBond Aug 20, 2025
37ef9d9
More OpenPBR fixes for non-UBO
MiiBond Aug 21, 2025
2899e88
possible fix
MiiBond Aug 21, 2025
aa94392
possible fix
MiiBond Aug 21, 2025
69e5823
possible fix
MiiBond Aug 21, 2025
3a9f6b7
Revert baseParticleSystem
MiiBond Aug 22, 2025
1ba1430
WIP - OpenPBR anisotropy
MiiBond Aug 22, 2025
c6366dc
Adding asset with tangents for aniso tests
MiiBond Aug 25, 2025
0d5918f
WIP OpenPBR anisotropy export
Aug 25, 2025
4ea3f9a
Update OpenPBR aniso reference images
Aug 25, 2025
abe9516
Update OpenPBR aniso vis tests
Aug 26, 2025
03bee59
Update vis reference for anisotropy
Aug 27, 2025
41ca3f0
WIP OpenPBR anisotropy for IBL
Aug 27, 2025
4aacaf1
Fix import
Aug 27, 2025
294a1e5
Fix import issue
Aug 27, 2025
a597577
Fix import issue
Aug 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/dev/buildTools/src/addJSToCompiledFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ function ProcessSource(sourceCode: string, forceMJS: boolean) {
const extension = forceMJS ? ".mjs" : ".js";
return (
sourceCode
// replace imports from directories with index.js (mixins are generating them)
.replace(/import\("([./]+)"\)/g, `import("$1/index${extension}")`)
// replace imports and exports with js extensions
.replace(/((import|export).*["'](@babylonjs\/.*\/|\.{1,2}\/)((?!\.scss|\.svg|\.png|\.jpg).)*?)("|');/g, `$1${extension}$5;`)
.replace(/((import|export)\(["']((@babylonjs\/.*\/|\.{1,2}\/)((?!\.scss|\.svg|\.png|\.jpg).)*?))(["'])\)/g, `$1${extension}$6)`)
Expand Down
79 changes: 45 additions & 34 deletions packages/dev/buildTools/src/generateDeclaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,45 +76,56 @@ function GetModuleDeclaration(
line = line.startsWith(" ") ? " //" + line.substring(3) : "// " + line;
}

// replace type imports from directories with index (mixins are generating them)
line = line.replace(/import\("([./]+)"\)/g, `import("$1/index")`);

[
// Declaration
/declare module ['"](.*)['"]/,
/declare module ['"](.*)['"]/g,
// From
/ from ['"](.*)['"]/,
/ from ['"](.*)['"]/g,
// Module augmentation
/ {4}module ['"](.*)['"]/,
/^module ['"](\..*)['"]/,
/ {4}module ['"](.*)['"]/g,
/^module ['"](\..*)['"]/g,
// Inlined Import
/import\(['"](.*)['"]/,
/import\(['"]([^'"]*)['"]/g,
// Side Effect Import
/import ['"](.*)['"]/,
/import ['"](.*)['"]/g,
].forEach((regex) => {
const match = line.match(regex);
if (match) {
if (match[1][0] === ".") {
const newLocation = path.join(sourceDir, match[1]).replace(/\\/g, "/");
line = line.replace(match[1], newLocation);
} else {
let found = false;
Object.keys(mapping).forEach((devPackageName) => {
if (match[1].startsWith(devPackageName)) {
line = line.replace(
match[1],
getPublicPackageName(
mapping[(isValidDevPackageName(devPackageName, true) ? devPackageName : kebabize(config.devPackageName)) as DevPackageName][buildType],
match[1]
) + match[1].substring(devPackageName.length)
);
found = true;
}
});
if (!found) {
// not a dev dependency
// TODO - make a list of external dependencies per package
// for now - we support react
if (match[1] !== "react" /* && !match[1].startsWith("@fluentui")*/) {
// check what the line imports
line = "";
const matches = line.matchAll(regex);
if (matches) {
for (const match of matches) {
const group = match[1];
if (group[0] === ".") {
const newLocation = path.join(sourceDir, group).replace(/\\/g, "/");
// replaceAll only avaialable by modifying the typescript lib
// which we prefered to not change for now
line = (line as any).replace(group, newLocation);
// while (line.indexOf("//") > -1) {}
} else {
let found = false;
Object.keys(mapping).forEach((devPackageName) => {
if (group.startsWith(devPackageName)) {
line = line.replace(
group,
getPublicPackageName(
mapping[(isValidDevPackageName(devPackageName, true) ? devPackageName : kebabize(config.devPackageName)) as DevPackageName][
buildType
],
group
) + group.substring(devPackageName.length)
);
found = true;
}
});
if (!found) {
// not a dev dependency
// TODO - make a list of external dependencies per package
// for now - we support react
if (group !== "react" /* && !group.startsWith("@fluentui")*/) {
// check what the line imports
line = "";
}
}
}
}
Expand Down Expand Up @@ -319,8 +330,8 @@ function GetPackageDeclaration(
while (i < lines.length) {
let line = lines[i];

if (/import\("\.(.*)\)./g.test(line) && !/^declare type (.*) import/g.test(line)) {
line = line.replace(/import\((.*)\)./, "");
if (/import\("\.([^)]*)\)./g.test(line) && !/^declare type (.*) import/g.test(line)) {
line = line.replace(/import\(([^)]*)\)./g, "");
}

if (!line.includes("const enum") && !line.includes("=")) {
Expand Down
8 changes: 8 additions & 0 deletions packages/dev/buildTools/src/packageMapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ const packageMapping: {
// },
namespace: {
core: (filePath?: string) => {
filePath = filePath?.replaceAll("\\", "/");
if (
filePath &&
(filePath.includes("/Debug/axesViewer") ||
Expand All @@ -304,6 +305,7 @@ const packageMapping: {
gui: "BABYLON.GUI",
materials: "BABYLON",
loaders: (filePath?: string) => {
filePath = filePath?.replaceAll("\\", "/");
if (filePath) {
if (filePath.includes("/glTF/1.0")) {
// was .endsWith
Expand All @@ -320,6 +322,7 @@ const packageMapping: {
},
serializers: "BABYLON",
inspector: (filePath?: string) => {
filePath = filePath?.replaceAll("\\", "/");
if (filePath) {
if (filePath.includes("shared-ui-components/") || filePath.includes("/sharedUiComponents/")) {
// was .endsWith
Expand All @@ -331,6 +334,7 @@ const packageMapping: {
return "INSPECTOR";
},
"node-editor": (filePath?: string) => {
filePath = filePath?.replaceAll("\\", "/");
if (filePath) {
if (filePath.includes("shared-ui-components/") || filePath.includes("/sharedUiComponents/")) {
// was .endsWith
Expand All @@ -342,6 +346,7 @@ const packageMapping: {
return "BABYLON.NodeEditor";
},
"node-geometry-editor": (filePath?: string) => {
filePath = filePath?.replaceAll("\\", "/");
if (filePath) {
if (filePath.includes("shared-ui-components/") || filePath.includes("/sharedUiComponents/")) {
// was .endsWith
Expand All @@ -353,6 +358,7 @@ const packageMapping: {
return "BABYLON.NodeGeometryEditor";
},
"node-render-graph-editor": (filePath?: string) => {
filePath = filePath?.replaceAll("\\", "/");
if (filePath) {
if (filePath.includes("shared-ui-components/") || filePath.includes("/sharedUiComponents/")) {
// was .endsWith
Expand All @@ -364,6 +370,7 @@ const packageMapping: {
return "BABYLON.NodeRenderGraphEditor";
},
"node-particle-editor": (filePath?: string) => {
filePath = filePath?.replaceAll("\\", "/");
if (filePath) {
if (filePath.includes("shared-ui-components/") || filePath.includes("/sharedUiComponents/")) {
// was .endsWith
Expand All @@ -375,6 +382,7 @@ const packageMapping: {
return "BABYLON.NodeParticleEditor";
},
"gui-editor": (filePath?: string) => {
filePath = filePath?.replaceAll("\\", "/");
if (filePath) {
if (filePath.includes("shared-ui-components/") || filePath.includes("/sharedUiComponents/")) {
// was .endsWith
Expand Down
Loading
Loading