Git Product home page Git Product logo

vulkan3dmodelviewer's Introduction

3D Model Viewer in Vulkan

Overview

This repository contains a basic 3D model viewer implemented in C++ using the Vulkan library.

Requirements

The provided source codes were tested in Windows 10 using the following libraries:

  • Vulkan SDK 1.3.211.0;
  • glfw3 3.3.7;
  • glm 0.9.9.8;
  • rapidjson;

To run the application, you need to pass the config.json file path as an argument to it (e.g. main.exe config.json). Also, we suggest you move the shaders folder to the same folder where the executable is located.

If you want to recompile the shaders, please update the compileShaders.bat file (Windows) or create a new one following this tutorial.

Compilation/Building for Windows

To compile the source code and build the application for Windows, you may need to:

  • Install Visual Studio (>= 2019);
  • Install vcpkg:
  • Install Vulkan SDK;
  • Run the following vcpkg commands in the command prompt:
    • vcpkg install vulkan-headers;
    • vcpkg install glfw3;
    • vcpkg install glm;
    • vcpkg install rapidjson;
    • vcpkg integrate install;

Then, you can create a new, empty Visual Studio project, add the source codes, and you may need to change the following properties of the project:

  • Configuration Properties -> General -> C++ Language Standard: to ISO C++17 Standard (/std:c++17);
  • Configuration Properties -> C/C++ -> General -> Additional Include Directories: to <VULKAN_MODEL_VIEWER_PATH>\include;%(AdditionalIncludeDirectories);
  • Configuration Properties -> Linker -> General -> Additional Library Directories: to <VULKAN_SDK_PATH>\Lib;%(AdditionalLibraryDirectories);
  • Configuration Properties -> Linker -> Input -> Additional Dependencies: add vulkan-1.lib,

where:

  • <VULKAN_MODEL_VIEWER_PATH> is the path where the repository is stored;
  • <VULKAN_SDK_PATH> is the path where the Vulkan SDK is installed;

Scene Configuration

By default, this project comes with the Viking Room model by nigeloh updated by the Vulkan tutorial. If you want to load your own models in the application, please keep in mind that the current version of the application only supports the loading of a single .obj file (ideally stored in the models folder), associated with a single texture (ideally stored in the textures folder), that already has precomputed normals (vn items). Then, create a configuration file following the examples available in the configs folder to setup the scene to be loaded.

This application was successfully tested using the following models:

Tips: If you want to set up the camera properly, you can move the camera around the scene and press C to capture the camera data and later insert it in the configuration file. Also, if you want to disable the texture visualization, press 'R'. Conversely, press 'T' to enable the texture visualization.

vulkan3dmodelviewer's People

Contributors

marciocerqueira avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.