This project provides a web-based GUI built with React for converting HDR images (HDRIs) into cubemaps. It’s a fast, intuitive, and accessible tool for 3D artists, game developers, and VR/AR creators who need to generate cubemaps for their environments.
- User-Friendly Web Interface: Convert HDRIs to cubemaps directly in your browser.
- HDRI to Cubemap Conversion: Processes high dynamic range images and outputs cubemaps in various formats.
- Cubemap Faces Preview: View each face of the generated cubemap in real-time.
- Custom Resolution: Select your preferred output resolution.
- Drag-and-Drop Functionality: Easily upload HDRI files by dragging them onto the web interface.
- Cross-Browser Compatibility: Works on Chrome, Firefox, Edge, and Safari.
- React: Frontend library for building the user interface.
- Three.js: 3D graphics library used for handling the cubemap generation and preview.
- Tailwind CSS: For styling.
Ensure that you have the following installed:
- Node.js: Download from nodejs.org if you don't have it installed.
- npm or Yarn: Node package manager. Comes with Node.js, but Yarn is also supported.
-
Clone the repository:
git clone https://github.com/hichemfantar/hdri-to-cubemap-converter.git cd hdri-to-cubemap-converter
-
Install the dependencies:
npm install # or yarn install
-
Start the development server:
npm run dev # or yarn dev
-
Open your browser and go to
http://localhost:5173
to see the app.
- Open the app in your browser.
- Drag and drop an HDRI file into the provided area or use the file picker to upload.
- Choose the desired resolution and output format (PNG, JPEG, EXR).
- Preview the cubemap faces in the interface.
- Click the "Download" button to save the cubemap to your device.
npm run dev
: Runs the app in development mode.npm run build
: Builds the app for production.npm run preview
: Preview the production build.npm run lint
: Lints the codebase for style and quality issues.
To deploy the app for production:
-
Run the build command:
npm run build
-
The build artifacts will be stored in the
dist/
folder. -
You can deploy this
dist/
folder to any static hosting service like Netlify, Vercel, or GitHub Pages.
Contributions are highly encouraged! Here's how you can get involved:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
- Add batch processing of multiple HDRIs.
- Enable GPU acceleration for faster conversion.
- Improve error handling and user feedback.
This project is licensed under the MIT License - see the LICENSE file for details.
For any issues or feature requests, feel free to open an issue in the GitHub Issues section.
Main interface showing file upload and conversion options.
Cubemap face preview after HDRI conversion.
Built with React + TypeScript + Vite template.
Built by Hichem Fantar using React and Three.js.
Thanks matheowis for the inspiration.