Giter VIP home page Giter VIP logo

edaf80_labs's Introduction

--Clone by Sebastian Hegardt and Wilhelm Lundström--

CG_Labs contains the source code for the various Computer Graphics courses taught at Lund University (EDAF80 and EDAN35). All assignments of EDAF80 are available, as well as the second assignment of EDAN35.

The public repository is found at https://github.com/LUGGPublic/CG_Labs.

Dependencies

CG_Labs uses the following dependencies:

  • CMake (>= 3.0): to generate project files and handle dependencies;
  • Git: to clone missing dependencies;
  • GLFW (>= 3.2.1): to create a window and an OpenGL context, as well as handle inputs;
  • GLAD: to load OpenGL extensions;
  • GLM (>= 0.9.8.5): for linear algebra operations;
  • Dear ImGui (>= 1.51): to display information on screen, such as logs;
  • assimp (>= 4.1.0): to load OBJ models;
  • lodepng: to load PNG files;

The project contains the needed files for GLAD and lodepng, and it will download assimp, Dear ImGui, GLM and GLFW if they are not found on your computer, so you only need to make sure that CMake and Git are installed on your computer.

An OpenGL 4.1 context is created by the project. You could possibly lower that to an OpenGL 3.3 context, but it is not supported.

C++14 features are used by this project, so you will need a C++14-capable compiler; if you are using Visual Studio, that means Visual Studio 2015 or later.

The different resources used in the assignments, textures, object files, can be found in this ZIP file, which should be automatically retrieved by CMake.

Building

Visual Studio 2017

We will use the following directory layout:

* some_random_folder // Wherever you want to store the project on your
|                    // computer.
|
|-> * code           // This is what you downloaded from GitHub.

On the contrary to previous versions, Visual Studio 2017 can use CMake files directly, so instead of opening a project, choose “Open a folder” and select the “code” folder. After a few seconds, Visual Studio should start processing the CMake files and downloading the dependencies: this can take some time.

Once Visual Studio is done with the processing, you should now have a new menu called “CMake” in the menu bar. In there you can build and clean the project, edit the CMake configuration, and others.

After building, it is now time to run the assignment. In order to do that, you need to choose the “Startup Item” by clicking on the combo box preceded by a green arrow pointing to the right (similar to the “play” or “start” symbols), and select, for example, “EDAF80_Assignment1.exe”.

Others (also works for Visual Studio 2017)

The project uses CMake to automate the building. It is recommended to build in a separate folder but you can as well build directly within the source directory. We will use the following directory layout:

* some_random_folder // Wherever you want to store the project on your
|                    // computer.
|
|-> * code           // This is what you downloaded from GitHub.
|
|-> * build          // A folder you created, and which will contain all the
                     // build related files.

First, you need to create the project files, be it for Unix Makefiles, Ninja, Xcode, or Visual Studio:

cd build
cmake -G $generator ../code

where $generator can be, among others, "Visual Studio 14 2015 Win64" for Visual Studio 2015 on a 64-bit computer, "Visual Studio 15 2017 Win64" for Visual Studio 2017 on a 64-bit computer, Xcode for Xcode, "Unix Makefiles" for Unix Makefiles. To see the full list of generators supported by CMake, have a look at cmake-generators(7).

If you prefer to use CMake GUI, just set the source directory to “code” and the build directory to “build”. Then, press the “Configure” button, modify some of the variables if needed, and press the button again. Finally, press the “Generate” button to create the project files.

You should now have your project files available in the “build” folder. To build the project, you can either use your IDE’s interface, or run cmake --build . from the “build” folder. You can pass --config Debug|RelWithDebInfo|Release to build in a specific configuration.

Issues with retrieving the resource archive

If CMake fails to retrieve the resource archive, you will need to make sure to extract the zip containing the resources into “code”; this should result in the creation of a folder “res” under “code”.

Miscellaneous

If you are on a laptop and would like to force the assignments to run on the discrete GPU, set the option GLFW_USE_HYBRID_HPG to ON using CMake — either from the CMake GUI or using CMake on the command line.

Licence

edaf80_labs's People

Contributors

oskardamkjaer avatar pierremoreau avatar zorobay avatar

Watchers

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