RenderGLB+ is a program built in C++ for rendering 3D objects from GLB files (and other file types soon!) into stunning image renders. This tool leverages OpenGL (GLUT) for rendering and supports various image formats including PNG, JPG, and JPEG. This program supports, GNU/LINUX, macOS, and Microsoft Windows.
- Renders 3D objects from GLB files, rendering with the embedded textures, colors, etc.
- Supports rendering into multiple image formats including PNG, JPG, and JPEG.
- Simple command-line interface for ease of use.
- Detailed help command for quick reference.
- Highly performant.
- Cross-platform, runs on GNU/Linux, macOS, and Microsoft Windows.
- Automatic camera view framing.
- Custom output folder paths.
- Random file name generation.
- NVIDIA GPU and AMD GPU support as well as Apple Silicon (With Rosetta 2).
- Threading.
- Custom scene backgrounds.
- Custom camera positioning, overriding automatic camera view framing.
- Importing multiple GLB files into the scene and rendering them all as one image.
- CPU rendering.
To render a 3D object from a GLB file, use the following command:
./renderglbplus -i <GLB_File_Path> [-o <Output_File_Name>] -o <Output_Folder_Path> -f <File_Type> [-m <Render_Mode>]
- [] wrapping indicates that the parameter is not required.
renderglbplus.exe -i <GLB_File_Path> [-o <Output_File_Name>] -o <Output_Folder_Path> -f <File_Type> [-m <Render_Mode>]
- [] wrapping indicates that the parameter is not required.
- Required:
-i
: Path to the GLB file. - Optional:
-f
: Name of the output image file (without the extension).- Note: If not specified, the program will generate a random string of alphanumeric characters and will use that as the file's name.
- Required:
-t
: Desired output file type - this determines the output file's extension.- Options:
png
,jpg
,jpeg
- Options:
- Optional:
-h
,--help
: Display detailed usage information.- Note: Ignored if other command-line parameters are specified.
- Required:
-o
: Path to the output folder.- Note: Ensure that you have the system user, under which the program will be running, has the correct read/write permissions to the output directory.
- Optional:
-m
: Rendering mode (GPU or CPU).- Default:
gpu
(Recommended). - Options:
gpu
,cpu
. - Note: The program will fail to render in GPU mode and will output an error if your system does not have a proper GPU.
- Default:
Render a GLB file named model.glb
into a PNG image on a GNU/Linux system using the GPU, where the GLB file is in the same path as the RenderGLB+ program:
./renderglbplus -i model.glb -f test_render -o ./ -t PNG -m gpu
Render a GLB file named model.glb
into a PNG image on a Microsoft Windows system using the GPU, where the GLB file is in the same path as the RenderGLB+ program:
renderglbplus.exe -i model.glb -f test_render -o ./ -t PNG -m gpu
-
Clone the repository:
git clone https://github.com/Vixlatio/renderglbplus.git
-
Navigate to the project directory:
cd renderglbplus
-
Compile the source code
Option 1 - Using g++ to build for GNU/Linux and macOS:
mkdir build && cd build && cmake .. && make
Option 2 - Using g++ to build for Microsoft Windows systems:
g++ -o renderglbplus.exe main.cpp stb/stb_image_write.h tinygltf/tiny_gltf.cc -lglut -lGL -lGLU -lpng -ljpeg -lm
Optionally, you may download and use a prebuilt version of the program directly from the Releases section of this repository.
- x86_64 processor
- x11 (Wayland is not supported)
- GNU/Linux, macOS, or Microsoft Windows
- g++ compiler (v11.4.0)
- cmake (v3.29.0)
- libpng
- libjpeg
- libgl-dev
- libglu1-mesa-dev
- libgl1-mesa-dev
- libglfw3-dev
- freeglut3-dev (Linux) OR OpenGL (Windows)
-
Install prerequisites via apt:
sudo apt-get install freeglut3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev libgl-dev libpng-dev libjpeg-dev
For more information about OpenGL (GLUT), visit their website: https://www.opengl.org/resources/libraries/glut/glut_downloads.php
-
Install prerequisites via brew:
brew install freeglut mesa-glu
brew install --cask xquartz
Instructions coming soon.
Contributions are welcome! If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.