NGL Demos
The following programs demonstrate NGL along with various graphics techniques. There are now some interactive WebGL Demos, you will need to have WebGL enabled with the browser click on links for demos.
BlankNGLThis is a blank NGL project that creates an empty Qt OpenGL window with basic key control framework, it also has methods implemented for initializeGL, paintGL and resize window git clone git@github.com:NCCA/BlankNGL.git | |
Simple NGL DemoThis demo shows a basic Qt OpenGL window and how to use ngl for a simple drawing project. It uses a simple PBR metal shader. git clone git@github.com:NCCA/SimpleNGL.git | |
SDL NGL DemoThis demo show how to use the NGL library with SDL (2.0). At the University SDL2 is installed, if you need to use it on your own machine use vcpkg. git clone git@github.com:NCCA/SDLNGL.git | |
VAOPrimitives DemoThis demo demonstrates how to use the build in primitives in NGL git clone git@github.com:NCCA/VAOPrimitives.git | |
Vertex Array ObjectsA series of demos used in the lecture on Vertex Array Objects and Vertex Buffers, this also introduces the ngl VAO factories and how to use them . git clone git@github.com:NCCA/VertexArrayObject.git | |
Creating a Virtual CameraThis demo show how to create several Cameras and use them git clone git@github.com:NCCA/Camera.git | |
SDL_TTF Text rendering with SDLThis Demo replaces the ngl::Text class to use SDL_ttf instead of the Qt font rendering. Use this if you are not using Qt for your project git clone git@github.com:NCCA/SDLTTF.git | |
lookAt demosTwo demos showing how to use the lookAt, persprctive and ortho utility methods. The first demo is a simple lookAt example the 2nd creates a simple maya style interface where we can zoom to different windows etc. git clone git@github.com:NCCA/LookAtDemos.git | |
Simple LightingThis demo show how to use the Light and Material classes to generate a series of PointLights and render using Phong shading git clone git@github.com:NCCA/Lights.git | |
Simple SpotlightsThis demo show how to generate a simple spotlight git clone git@github.com:NCCA/SpotLight.git | |
Shading ModelsA series of demos used in the lecture on Shading Models. This builds from simple constant shading to PBR. git clone git@github.com:NCCA/ShadingModels.git | |
Klein Bottle DemoThis program demonstrates the production of a Klein bottle based on the code from this excellent website It uses the ngl::SimpleVAO class git clone git@github.com:NCCA/KleinBottle.git | |
Texturing DemosThese demos are part of the lecture on Texturing in OpenGL git clone git@github.com:NCCA/Textures.git | |
Image Based HeightmapGenerates a heighmap grid where the height of the mesh is based on the Red channel of the image. This demo doesn’t use the ngl::VertexArrayObject class so it also demonstrates the direct access to OpenGL VertexBufferObjects and VAO’s not using NGL. git clone git@github.com:NCCA/ImageHeightMap.git | |
ngl::Obj DemoA demonstration of using the ngl::Obj class to load a mesh git clone git@github.com:NCCA/ObjDemo.git | |
Game Key ControlsThis demo shows how to do game style control and movement of an object in Qt, read the blog post for more details git clone git@github.com:NCCA/GameKeyControl.git | |
Advanced Game Key ControlsThis demo takes the code above and uses a different method to do game style control, it also has the ability to record and playback the keystrokes, including saving them to file. git clone git@github.com:NCCA/AdvancedGameKeyControl.git | |
SDL Joypad DemoA demo using the SDL2 Joypad code, you may need to re-map the controller depending upon type. This is setup to use an XBox controller. git clone git@github.com:NCCA/SDLJoyPad.git | |
Using Interpolation templatesA demonstration of the interpolation templates built into NGL git clone git@github.com:NCCA/Interpolation.git | |
Using ngl::QuaternionThis demo demonstrates how to convert from a Rotation matrix and a Quaternion. Two matrices are generated and the slerp method is used to interpolate between them git clone git@github.com:NCCA/QuatSlerp.git | |
Generating CurvesTwo demos to show the ngl::BezierCurve class, the first demo is a simple 4 point curve the second code bundle contains a simple python script to export all curve cv values from Maya into a text file which is loaded into the program. There is also a demo showing how to use geometry shaders to produce curves git clone git@github.com:NCCA/CurveDemos.git | |
Collision Detection DemosA series of programs showing Ray-Sphere, Ray-Triangle, Sphere-Sphere, Sphere-Plane collision detection algorithms git clone git@github.com:NCCA/Collisions.git | |
Abstract OctreeAn Abstract Octree template to use in your own projects, this code is originally writen by my collegue Dr Xiaosong Yang for his advanced collision detection lectures and templated and ported to ngl by me. git clone git@github.com:NCCA/OctreeAbstract.git | |
Particle Systemssome basic particle system demos. git clone git@github.com:NCCA/ParticleSystem.git | |
Particle FactoryThis demo demonstrates the use of the factory pattern and runtime polymorphism. Note this is not a good way to generate a particle system just a nice visual demo. git clone git@github.com:NCCA/ParticleFactory.git | |
Selection using Unique Colour valuesPicking of objects using Colour values based on this post git clone git@github.com:NCCA/ColourSelection.git | |
ngl::PointBake DemosThis demonstrates loading in a Mesh (obj) and PointBake animation data from my Maya Exporter ( see here ). The basic principle is load an Obj Mesh, then the PointBake per frame animation data, then we update the verts per frame. see NGL::PointBake class for more details and also this blog post git clone git@github.com:NCCA/PointBake.git | |
Blend Shape using ObjsThis demo show how to do basic Blend Shape animaiton using the GPU based on the technique shown here git clone git@github.com:NCCA/MorphObj.git The second demo does the same thing but morph targets are passed as a texture buffer object instead. git clone git@github.com:NCCA/MorphObjTBO.git | |
Facial Animation using Blend ShapesThis demo show how to do basic Blend Shape animation using the GPU based on the technique shown here it loads in a simple list of data for each of the meshes and then morphs them git clone git@github.com:NCCA/FacialAnimation.git | |
Using libassimpThese demos show how to use assimp to load meshes and do skeletal animation with ngl git clone git@github.com:NCCA/AssetImportDemos.git | |
Embedding Python in NGLThis demonstrates how to embed python scripts into NGL (and in general any C++ program) It uses a simple python script to animate two Spheres (a different script for each Sphere) more details here git clone git@github.com:NCCA/EmbedPython.git | |
Qt GUI and NGLThis is the code to accompany the Video Tutorial here git clone git@github.com:NCCA/QtNGL.git | |
Mass Spring System using RK 4 integrationA Simple Mass spring system using RK4 integration, the integrated is an Abstract class so it may be re-implemented to use different equations for the simulations Some of the code is based on this post | |
Affine TransformsThis demo show how to build affine transform using a series of matrices in ngl. This demo also demonstrates how you use Qt GUI components with ngl and OpenGL git clone git@github.com:NCCA/AffineTransforms.git | |
Geometry ShadersA simple demo showing how to draw Face and Vertex Normals using Geometry Shaders git clone git@github.com:NCCA/GeometryShaders.git | |
Tessellation ShaderThis demo is the one written for this blog post and implements this codegit clone git@github.com:NCCA/TessellationShader.git | |
Animated TexturesThis demo uses several sprite sheets of fire to generate an animated fire using billboards. The billboards are generated on the GPU using a geometry shader and the data for the frames / animation is passes using attributes. git clone git@github.com:NCCA/TessellationShader.git | |
Instancing Methods in OpenGLThese three demos show different ways of using Transfrom Feedback to generate instanced geometry. These are Uniform Buffer Object Instancing, Texture Buffer Object instancing and Divisor Instancing. | |
Normal MappingThis demo uses the ngl::Obj and ngl::VertexArrayObject classes to read in a mesh then construct an extended VAO passing in Tangents and Bi-Tangents (BiNormals) to glsl as attributes. This is then used to do normal mapping along the lines of this git clone git@github.com:NCCA/NormalMapping.git | |
Using Frame Buffer ObjectsA number of demos showing how to use Frame buffer objects, including real time shadows and render to FBO demos git clone git@github.com:NCCA/FBODemos.git | |
Sponza DemoA basic framework to load a Wavefront OBJ file with groups and an MTL file with textures and draw the scene as efficiently as possible. The source contains the models and textures from here and is quite large For a detailed look at how this work see the following blog posts initial design The mtl class Grouped Object class git clone git@github.com:NCCA/Sponza.git | |
Using Bullet PhysicsUsing the Bullet Physics with NGL, the demo has basic wrappers for the Physics world and rigid bodies, it also uses the ngl::Obj to load low-res collision meshes and uses higher detail ones for the drawing. For more details read the user guide git clone git@github.com:NCCA/BulletNGL.git git clone git@github.com:NCCA/BulletNGLTower.git | |
Box2D and NGLThis demo uses Box2D to do basic 2D physics using NGL to draw and setup and orthographic 2D world (but rendered in 3D). It creates a number of passive bodies as platforms and one moving kinematic moving platform. The player is moved using impulses applied when the keys are pressed git clone git@github.com:NCCA/Box2D.git The next demo has a simple python maya script to export data that can be used in a C++ program. git clone git@github.com:NCCA/Box2DExport.git |