openglcpp icon indicating copy to clipboard operation
openglcpp copied to clipboard

Collection of C++ OpenGL samples and demos

C++ OpenGL examples and demos

This repository contains sources for assorted OpenGL samples and demos written in C++.

This is a loose collection of OpenGL testing stuff, so no CMake, no cross platform and not much source documentation.

Use at your own risk ;)

Requirements

Samples

SPIR-V shaders

Shows how to load binary SPIR-V Shaders with OpenGL. SPIR-V has initially been introduced as the binary shader format for Vulkan, but is also available on OpenGL via the GL_ARB_gl_spirv extension.

This example loads two basic binary SPIR-V shaders instead of GLSL shaders from text. SPIR-V shaders for OpenGL can be generated using the glslang reference compiler. If you're using Visual Studio, you can use my SPIRV-VSExtension to generate SPIR-V from GLSL directly out of the IDE.

Compute shader particle system

Attraction based compute shader particle system using SSBOs.

Instancing

Mesh instancing (OpenGL 3.3+) demo. Made to compare against the same Vulkan example.

Ray picking

CPU based ray picking for object selection.

Geometry shader

Very simple geometry shader demo.

EGL

Shows how to use EGL for setting up OpenGL ES 2.0 on a windows desktop. Only works for vendors that support EGL on desktop.

Simple STL viewer

A very basic demo for loading and displaying a .stl file.