Skip to content

JI20/BxDF-Sampling-Visualizer

Repository files navigation

🚀 BxDF Sampling Visualizer 💡

License: MIT Tech Stack Vite PRs Welcome

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.

image

📚 About The Project

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.

💻 Built With


🔧 Getting Started

To get a local copy up and running, follow these simple steps.

Prerequisites

You need to have Bun installed on your machine. You can install it from bun.sh.

Installation

  1. Clone the repository:
    git clone [https://github.com/JI20/BxDF-Sampling-Visualizer.git](https://github.com/JI20/BxDF-Sampling-Visualizer.git)
  2. Navigate to the project directory:
    cd BxDF-Sampling-Visualizer
  3. Install dependencies using Bun:
    bun install
  4. Run the development server:
    bun run dev

Your local copy should now be running in your browser!


🚀 How to Use

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.

🤝 Contributing

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.


📜 License

Distributed under the MIT License. See the LICENSE file for more information.


📬 Contact

Jonas Itt - JI20

Project Link: https://github.com/JI20/BxDF-Sampling-Visualizer

About

Web 3D Viewer for visualizing the (importance) sampling behavior of BxDFs for Path Tracing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published