Giter Site home page Giter Site logo

vixlatio / renderglbplus Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 489 KB

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, both, GNU/LINUX and Microsoft Windows.

Home Page: https://vixlatio.com

License: MIT License

CMake 3.18% C 37.20% C++ 59.62%
3d-models glb rendering-2d-graphics model-to-image

renderglbplus's Introduction

RenderGLB+ (NOT READY FOR USE, WILL NOT WORK AS INTENDED)

An open-source project by Vixlatio PTY LTD

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.

Features

  • 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.

Planned Features

  • 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.

Usage

To render a 3D object from a GLB file, use the following command:

GNU/Linux and macOS:

./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.

Microsoft Windows systems:

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.

Command-line Options

  • 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
  • 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.

Examples

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

Manual complilation

  1. Clone the repository:

    git clone https://github.com/Vixlatio/renderglbplus.git
    
  2. Navigate to the project directory:

    cd renderglbplus
    
  3. 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
    

Using a prebuilt version

Optionally, you may download and use a prebuilt version of the program directly from the Releases section of this repository.

Requirements

  • x86_64 processor
  • x11 (Wayland is not supported)
  • GNU/Linux, macOS, or Microsoft Windows

Prerequisites

  • 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)

GNU/Linux installation

  1. 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

macOS installation

  1. Install prerequisites via brew:

    brew install freeglut mesa-glu

    brew install --cask xquartz

Microsoft Windows installation

Instructions coming soon.

Contributing

Contributions are welcome! If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

renderglbplus's People

Contributors

bytedefined avatar electrics01 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

electrics01

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.