A web-based, real-time visualizer for exploring the behavior of various BxDF (Bidirectional Scattering Distribution Function) sampling models. This tool helps developers and researchers understand and debug how light scatters from a surface by interactively visualizing sampled light paths.
In computer graphics, a BxDF is a mathematical function that describes how light is reflected and refracted at a surface. Understanding the distribution of these light paths is crucial for creating realistic materials.
This tool provides an interactive 3D visualization of this process:
- Hit Point: Light interaction is simulated at the world origin (0, 0, 0).
- Incoming Light: A single or multiple, controllable vector represents the incoming light direction.
- Sampled Vectors: The tool generates and displays numerous outgoing vectors, sampled according to a specific BxDF model, showing the probable directions light will scatter.
It currently serves as a testbed for a refraction BxDF, but is designed to be easily extensible with other models.
To get a local copy up and running, follow these simple steps.
You need to have Bun installed on your machine. You can install it from bun.sh.
- Clone the repository:
git clone [https://github.com/JI20/BxDF-Sampling-Visualizer.git](https://github.com/JI20/BxDF-Sampling-Visualizer.git)
- Navigate to the project directory:
cd BxDF-Sampling-Visualizer - Install dependencies using Bun:
bun install
- Run the development server:
bun run dev
Your local copy should now be running in your browser!
The user interface allows for interactive exploration of the BxDF model.
- Set Incoming Direction: Must be set in the code. The "Set Input Direction" button does not work currently.
- Generate new sample: Click this button to generate and display a single new sampled outgoing ray.
- Show grid / Reset camera: Use these buttons for scene navigation and visibility control.
- Reset content: Clears all generated samples from the scene.
Contributions are what make the open-source community such an amazing place to learn and create. Any contributions you make are greatly appreciated.
Please follow the standard GitHub Fork & Pull Request workflow. For suggestions or bug reports, please open an issue.
Distributed under the MIT License. See the LICENSE file for more information.
Jonas Itt - JI20
Project Link: https://github.com/JI20/BxDF-Sampling-Visualizer