Code Monkey home page Code Monkey logo

badhairday's Introduction

Having a bad hair day?

             |||||||
         ____|||||||||__
    ----/               \-------
 ------/                \--~~~--
-------|    O       O   |--------
    ---|        >       |------
       \    ________    /
        \              /
        ^^^^^^^^^^^^^^^^

This is a graphics project for the course Advanced Computer Graphics held by Ingemar Ragnemalm at Linköping University, Sweden during 2017. The project explores simulation of light scattering in hair, for detailed information read the report (in Swedish). The project is built using MicroGlut.

During the course of the project we got really tired of OpenGL runtime errors, so we developed a library for compiling GLSL shaders. The result became a (far from complete) statically compiled graphics pipeline GTL (Graphics Template Library) together with a (ugly hack) shader compilator SBT (Shader Build Tool). GTL provides means of setting attributes in shaders directly in the client code, and getting static compilation errors, if for example an attribute does not exist on a shader or is of wrong type. This can be done after that the shader code has been compiled into a C++ class with SBT.

Project structure

  • common (MicroGLUT)
  • examples (Some example code we based the rest of the code on)
  • gtl (GTL library)
  • lib (Common files for this project)
  • slask (old unused/broken files, but kept for reference)
  • src (main source files)
    • tesselation_bunny.cpp (Base implementation of the tesselation)
    • voxelized_tess_bunny.cpp (Base implementation of the final solution to this project)
    • voxelized_tess_bunny_optimized.cpp (Optimized version of the above)
    • integer_voxelized_tess_bunny.cpp (Implementation based on integer arithmetic, which enables atomic operations on the GPU)
    • integer_voxelized_tess_bunny_optimized.cpp (Optimized version of the above)
  • shaders (.prog shader source code)
  • models (.obj model files)
  • textures (Self-explaining)

SBT and GTL

  • sbt.py, builds a (potentially mixed, with .prog exttension) shader source file into a C++ GTL class
  • sbt_make.py, generates a makefile based on a yaml configuration file listing shader source code to be compiled

Dependencies

  • OpenGL (version >= 4.5)

Installation (Debian)

  • git submodule init
  • git submodule update
  • apt-get install libgl1-mesa-dev libglm-dev libxt-dev
  • make

Running

  • Check out the various executables in the build directory

badhairday's People

Contributors

cdeln avatar

Stargazers

xuwen avatar

Watchers

John Stynsberg 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.