Skip to content

roshanpoudyal/3D_interactive_graphics_rendering_engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Playground to practice GPU, OpenCL, OpenGL, Shader Programming.

If I can visualize it, I can understand it.

3D Interactive Graphics Rendering Engine

- Develop a 3D interactive graphics rendering engine which can also be used as game engine.
- A C++ and OpenGL/Shader programming playground (in linux)

Motivation

  1. Get creative with visual effects and particle effects using shader programming.
  2. To practice Shader programming in OpenGL/OpenCL, to understand GPU programming and architecture.
  3. Hope to increase mathematical concepts understanding with shader programming.
  4. Learn parallel computaiton with GPU architecture.
  5. Learn to implement algorithms in GPU to leverage its architecture.

Resources on Computer Graphics and OpenGL:

The red book of OpenGL
A beautiful book open sourced - for physically based rendering:
  • Photorealistic computer graphics is ubiquitous today, with applications that include entertainment—notably, movies and video games; product design; and architecture. Donald Knuth wrote “This book has deservedly won an Academy Award. I believe it should also be nominated for a Pulitzer Prize.” Read about the book Physically Based Rendering, which will link you to the contents of the book to Physically Based Rendering:Contents. And more fun - here is the source code used by the book.
Another great piece of literature on computer graphics:
  • Real Time Rendering is a legend which focuses on modern techniques used to generate synthetic three-dimensional images in a fraction of a second. With the advent of programmable shaders, a wide variety of new algorithms have arisen and evolved over the past few years. This edition discusses current, practical rendering methods used in games and other applications. It also presents a solid theoretical framework and relevant mathematics for the field of interactive computer graphics, all in an approachable style.

Computer Graphics Learning Resources:


OpenGL Learning Resources:


GPU programming, Shader Programming, OpenCL Learning Resources:


Mathematics for Computer Graphics learning resources:

  1. This is common with books on mathematics for visual computing, see this section here.

Painting with math - an Inspiration - the beauty of math and shaders :

  1. Íñigo Quílez uses mathematics and shaders to create beautiful computer graphics like this. Visit his articles page for tutorials on the techniques he developed for his computer graphics experiments, demos, shadertoys and movies. For video tutorials, code and other useful resources visit his productions.
  2. A nice blog post on ray marching with simple sphere example to explain the concept.
  3. Beautiful piece of literature on procedeural modellling with signed distance functions.

Noteworthy open source libraries for developing C++ OpenGL applications:

  • Links and resources:

    • OpenGL Software Development Kit Documentation, Sample Code, Libraries, and Tools for creating OpenGL-based Applications.
      • Here you'll find some of the most valuable resources available to OpenGL developers, all in one place. Use the menu above to navigate to each contribution. Revisit often, as there will be new contributions coming online all the time!
  • Specific Libraries :

    • Raylib is a simple and easy-to-use library to enjoy game programming. Get to know more about it.
    • The G3D Innovation Engine is a commercial-grade C++ 3D engine available as Open Source. Its design emphasizes rapid prototyping and innovation, particularly of rendering and game algorithms. G3D provides a set of routines and structures so common that they are needed in almost every graphics program. Get to know more about it here.
    • Dear ImGui is a bloat-free graphical user interface library for C++. It outputs optimized vertex buffers that you can render anytime in your 3D-pipeline enabled application. It is fast, portable, renderer agnostic and self-contained (no external dependencies).
    • spdlog is very fast, header only, C++ logging library.
    • Open Asset Import Library (assimp) : A library to import and export various 3d-model-formats including scene-post-processing to generate missing render data.
    • GLAD is a C++ (multi-Language) GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specs. Here is the online GLAD generator.
    • GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan development on the desktop. It provides a simple API for creating windows, contexts and surfaces, receiving input and events.
    • OpenGL Mathematics (GLM) is a header only C++ mathematics library for graphics software based on the OpenGL Shading Language (GLSL) specifications. Here is its github repository.

Getting started on developing graphical application with Raylib (has very good C++ bindings) as base library:


Getting started with developing any graphical application with The G3D :

Description : The G3D Innovation Engine is a commercial-grade C++ 3D engine available as Open Source. Its design emphasizes rapid prototyping and innovation, particularly of rendering and game algorithms. G3D provides a set of routines and structures so common that they are needed in almost every graphics program. G3D is a carefully designed, feature-rich base on which to prototype your 3D application. It includes contributions from professional game developers, CAD and DCC developers, students, industry researchers, and professors. Any 3D graphical application imaginable is possible with The G3D.

  1. Here is a nice overview of G3D. Here are the features of G3D. Some external overview resource.
  2. Source code is available via svn repositories. A minimal download is also available with just the engine and without sample game assets.
    1. Here you will find description on contents of this library.
  3. G3D is well documented with :
    1. API documentation.
    2. Here is an overview of API concepts, which also has got nice paragraph on saying how to get started with a sample starter project. See this section and this section on getting started with sample project.
    3. Installation instructions for Linux.
  4. You can also get started with the Graphics Programming Projects which uses G3D as the source code to get started with.
    1. You can surf the projects listed in the library.
    2. To see in which order the projects should be completed see these dependencies description. Looks like there are no strict dependencies.

Getting Started with OpenGL application development on Linux:

  1. Setup OpenGL environment on Linux:

  2. Setup an OpenGL application Software Development Kit (SDK) on Linux:

    • Follow the instruction documented here to compile, build and use the libraries mentioned in learnopengl.com to develop OpenGL application SDK framework in Linux.
  3. How to build this OpenGL application :

  • It should be already noted that we use cmake and make to compile and build our application. Following easy to follow steps guide the same:
    1. Create a build folder in root directory of our project : mkdir build
    2. Enter this build folder : cd build
    3. Run cmake pointing the correct CMakeLists.txt file in root directory of our project to compile it : cmake ..
    4. Run make to build our project : make
    5. You will get the executables built in this build folder.

Note that

  1. You can also use Glitter to get started with OpenGL, it is is a dead simple boilerplate for OpenGL, intended as a starting point for the tutorials on learnopengl.com and open.gl. See its sample usage on how to use Glitter.
  2. Alternatively, you could use GFX - a minimalist and easy to use graphics API.

More of my related and future possible projects:

  1. Learn building rendering engine : related project
  2. Learn building physics engine : related project and this as well
  3. Learn building math engine
  4. Learn building AI for your game : related project
  5. Build a simple game with it

Future direction:

  1. Implement catlikecoding tutorials by using only shaders in the basic OpenGL framework you built here. If it is possible to do this just using shaders, why don't you give it a try as well.
    1. Basically use the environment created in this project to work on this project.
  2. Do all of this OpenGL project to display graphics in Android (mobile) platform using Android Studio.