Yes, I've read the code. It appears to be a collection of index.ts files from various Babylon.js packages. These files serve as the entry points for their respective packages, re-exporting modules and components to make them easily accessible to other parts of the project and external users. This is a common pattern in TypeScript and JavaScript projects for organizing code and managing dependencies.
Specifically, the code snippets show how Babylon.js organizes its features into packages like:
core: The fundamental components of the Babylon.js engine, including scenes, meshes, materials, cameras, lights, etc.
gui: User interface elements for building 2D and 3D GUIs within Babylon.js applications.
User
Is there demo pbr in here?
Assistant
The code snippets you provided don't include any demo code or specific examples of PBR (Physically Based Rendering) materials. They are simply index files that organize and export modules within the Babylon.js library. The actual implementation of PBR materials and any related demos would reside within the Materials directory, likely under the core package.
While the provided materials/src/index.ts file does export various material types, like simple, sky, water, terrain, etc., it doesn't explicitly list a "PBR" material. This doesn't mean Babylon.js doesn't have PBR, but rather that the standard PBR material is likely considered a fundamental part of the Materials module and might be exported directly from that module's main entry point or a sub-module related to standard materials.
To find a PBR demo, you should look at the Babylon.js documentation and examples, specifically searching for PBR materials. The official website and playground are excellent resources for this. You'll likely find examples showcasing the setup and usage of PBR materials and their various properties.
The demo is at that link so is the code in the repo or what?
Assistant
You are right to call me out! My apologies. While the index files I analyzed didn't directly expose a PBR demo, they do export the underlying components that make the demo at https://spector.babylonjs.com/demos/pbr/ possible.
The demo itself wouldn't be directly within these index files. Demos are typically separate examples or test projects showcasing the library's capabilities. The link you provided points to a live demo hosted on the Babylon.js Spector website.
However, the code that powers that demo, including the PBR materials, scene setup, lighting, etc., is derived from the modules exported through those index files, especially the ones in the core package, and likely also materials.
Think of it this way: the index files provide the building blocks (classes, functions, etc.), and the demos assemble those blocks into specific examples. The demo code uses the Babylon.js library, which is structured by those index files. So, while the demo code isn't directly the index files, it relies on them to access the necessary components.
User
Assistant
You're looking for the source code for the Babylon.js PBR demo specifically, and haven't found it in the Demos repository. You're right, that repository seems sparse. The official demos are actually located within the main Babylon.js repository itself. The Demos repo you found might be outdated or for a different purpose.
Here's how you can generally find the demos within the main Babylon.js repository:
Main Repository: Go to the main Babylon.js repository on GitHub (likely https://github.com/BabylonJS/Babylon.js).
Assets/demo directory: Navigate to the assets directory, and then into the demo subdirectory . This is where many of the official demos, including the PBR ones, are stored. You should find various scene files (.babylon or extensions), along with accompanying JavaScript or TypeScript files that set up the scene and handle interactions.
Here it is don’t know why they have to make it so hard to find even github search didn’t find it as it only searched repo names
Assistant
You're absolutely right! The location of the PBR demo source code isn't immediately obvious and can be tricky to find, even with GitHub's search. It seems the demo you linked is specifically associated with the Spector.js project, which explains why it's in the SpectorJSWebsite repository rather than the main Babylon.js repository or the sparsely populated Demos repository. Thanks for finding and sharing the correct location! It helps clarify the sometimes-confusing organization of examples and demos within the broader Babylon.js ecosystem. This information will be helpful for others searching for the same resource.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
serializers: Utilities for exporting scenes to various file formats (OBJ, glTF, STL, USDZ).
Each index.ts file uses export * from "./some/path"; to re-export the contents of other modules. This allows developers to import functionality from the package using a single, concise import statement, rather than having to specify the path to each individual module. For example, instead of:
import { Scene } from "@babylonjs/core/scene";
import { Vector3 } from "@babylonjs/core/Maths/math.vector";
a user can simply write:
import { Scene, Vector3 } from "@babylonjs/core";
This significantly improves code readability and maintainability. It also allows for internal restructuring of the package without breaking external code, as long as the re-exports in the index.ts file are updated accordingly.
in
You can usually find the source code for official Babylon.js demos within their GitHub repository, often in a dedicated "demos" or "examples" folder. Looking there should give you a more concrete view of how the PBR demo is constructed using the building blocks exported via the index files we initially discussed.
BabylonToolkit
Public
Home of the community maintained Unity & Unreal exporters for Babylon.js
47
•
180
•
0
Babylon.js
Public
Babylon.js is a powerful, beautiful, simple, and open game and rendering engine packed into a friendly JavaScript framework.
TypeScript
•
3.4k
•
23k
•
12
Editor
Public
Community managed visual editor for Babylon.js
TypeScript
•
238
•
848
•
6
Exporters
Public
Exporters for Babylon.js and gltf file formats
Mathematica
•
314
•
616
•
0
bgfx.cmake
Public
Independently maintained CMake build scripts for bgfx. Released under public domain.
CMake
•
257
•
6
•
2
bgfx
Public
Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
C++
•
2k
•
4
•
0
Documentation
Public
Babylon.js's documentation website
TypeScript
•
236
•
79
•
1
Website
Public
Main babylon.js website
JavaScript
•
255
•
202
•
0
Assets
Public
A place for public domain digital assets to use.
JavaScript
•
66
•
147
•
0
SmartFilters
Public
TypeScript
•
3
•
5
•
0
BabylonNative
Public
Build cross-platform native applications with the power of the Babylon.js JavaScript framework
C++
•
134
•
784
•
7
[Redacted Person]
Public
Build React Native applications with the power of Babylon Native
C++
•
60
•
384
•
80
SnippetServerExpress
Public
An Express.js implementation of our snippet server, capable of file system, in memory and azure blob storage deployment
TypeScript
•
0
•
0
•
0
twgsl
Public
CMake
•
6
•
16
•
0
Extensions
Public
Extensions for Babylon.js
JavaScript
•
156
•
180
•
0
Controls
Public
Set of web controls using babylon.js and the GPU to render their content in a hardware accelerated way
TypeScript
•
8
•
15
•
0
Spector.js
Public
Explore and Troubleshoot your WebGL scenes with ease.
TypeScript
•
171
•
1.4k
•
2
havok
Public
The Havok Physics plugin runtime files (wasm and js)
TypeScript
•
4
•
17
•
0
JsRuntimeHost
Public
The JsRuntimeHost is a library that provides cross-platform C++ JavaScript hosting for any JavaScript engines with Node-API support such as Chakra, V8, or JavaScriptCore.
C++
•
19
•
17
•
0
UrlLib
Public
UrlLib is a cross-platform C++ library that utilizes platform-specific implementations for URL-related functionality
C++
•
5
•
8
•
0
BabylonNativeExamples
Public
A collection of sample code projects using Babylon Native to illustrate various scenarios
C++
•
3
•
8
•
0
SPIRV-Cross
Public
SPIRV-Cross is a practical tool and library for performing reflection on SPIR-V and disassembling SPIR-V back to high level languages.
GLSL
•
570
•
1
•
0
SnippetServerReference
Public
JavaScript
•
2
•
1
•
0
AndroidExtensions
Public
AndroidExtensions is a C++ utility library for Android development
C++
•
3
•
1
•
0
SpectorJSWebsite
Public
Website for https://github.com/BabylonJS/Spector.js
JavaScript
•
5
•
4
•
0
CMakeExtensions
Public
Helper functions for CMake
CMake
•
2
•
2
•
0
CYOS
Public
Create Your Own Shader
JavaScript
•
9
•
23
•
1
glslang
Public
Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
C++
•
854
•
0
•
0
BlenderExporter
Public
Exports From Blender to Babylon.JS in JSON / .babylon format
Python
•
49
•
294
•
0
BabylonReactNativeSample
Public
Java
•
13
•
37
•
0
SummerFestival
Public
Source code for game tutorial written by [Redacted Person]
TypeScript
•
64
•
134
•
0
Demos
Public
A repository of Babylon.js Demos
TypeScript
•
2
•
5
•
0
BabylonPolymorph
Public
C++
•
10
•
23
•
2
ammo.js
Public archive
Direct port of the Bullet physics engine to JavaScript using Emscripten
C++
•
563
•
2
•
0
SpacePirates
Public
The Space Pirates game is a demo made to celebrate the Babylon.js 5.0 Release.
TypeScript
•
56
•
148
•
0
SpacePiratesAR
Public
Space Pirates Demo with Babylon React-Native and AR.
TypeScript
•
3
•
20
•
0
npm-package-template
Public template
JavaScript
•
17
•
19
•
0
asset-host-template
Public template
6
•
8
•
0
nengi-babylon-3d-shooter
Public archive
nengi+babylon template of a 3d shooter with client-side prediction and lag compensation
JavaScript
•
17
•
0
•
0
BabylonAR
Public archive
Home of the Babylon.AR project
TypeScript
•
17
•
70
•
0
OldDocumentationSite
Public archive
Babylon.js documentation page
JavaScript
•
188
•
66
•
1
webxrTypescriptDefinition
Public
WebXR Typescript definition
1
•
0
•
0
MeshesLibrary
Public archive
Use this repo as a place to share your scenes and meshes
JavaScript
•
40
•
47
•
0
Brand-Toolkit
Public
2
•
13
•
0
Documentation-search-engine
Public
Website used to store documentation search engine
JavaScript
•
5
•
3
•
0
I search their repos where could it be did not find anything other than this Demos repo but it only includes ‘piano’
.glb
Search: If you can't immediately locate the PBR demo, use the GitHub search functionality within the Babylon.js repository. Search for keywords related to "PBR," "physically based rendering," or specific terms related to the demo's content (e.g., if the demo features a specific object, search for that object's name).
Inspect Spector URLs: Sometimes, the URL of the Spector.js demo itself can give you clues. If the URL looks something like https://spector.babylonjs.com/demos/pbr/, the "pbr" portion might correspond to a folder or file name within the repository's demo directory.
By following these steps, you should be able to find the source code for the PBR demo and other official examples within the main Babylon.js repository.