This repository is a learning project that explores the fundamentals of 3D rendering with OpenGL. It includes a collection of experiments and demonstrations, integrated with ImGui for easy exploration and modification of parameters.
Here are some project screenshots and a video:
- Render Game Window (Clear Color)
- Render Triangle
- Render Square
- Load 2D Texture
- Render Sphere (UV Sphere)
- Cube Rendering With Lighting Effect and Materials
- Multiple material options
- Phong lighting model
- Cube With Texture and Lighting
- Textured Cube with texture Diffuse, Emission and Specular
- Phong lighting model with Attenuation
- Fractal Brownian Motion Plane With Lighting
- Fractal Brownian Motion Plane with Wireframe view, Rotation and each point movement.
- Phong lighting model
- Load and Tessellate Height Map
- Load Height Map from png
- Uses Tessellation and interpolation to generate 3D Height map from png
- Uses FOV to dynamically change the tessellation levels
- Renders Normals
- Uses Frustum culling
- Load 3D model using Assimp
- Load 3D model from obj file
- Render 3D model with Phong lighting model
- Renders Normals
- Particles in 3D (Implements in CPU)
- Uses CPU to create, update and destroy particles from emitter
- Max number of particle alive per frame is ~30K (with Avg of 22 FPS)
- Particles in 3D (Implements in GPU Nvidia GTX 1050)
- Uses CPU to create, update and destroy particles from emitter
- Max number of particle alive per frame is ~1.5 million (with Avg of 120 FPS)
- Fire Particle Simulation
- Uses GPU to create, update and destroy fire particles from emitter
- Each has its own temp and other properties.
- Procedural Terrain Generation
- Uses SimpleX/Perlin noise to generate height map
- Uses height map to generate 3D terrain
- Uses Frustum culling before mesh generation, Multithreading, Dynamic tessellation based on FOV, and camera distance for performace optimization.
Particle system: Initial Implemented using Array of Structures (AoS), with commit [cc8fe1647093a94a01c6ae96c84aa74215fd3172]
You can follow same instructions on https://github.com/Shreyas9699/opengl-base-template
to set it up.
OR
You can follow The Cherno Instructions
- OpenGL 3.3 or higher
- GLFW
- GLEW
- GLM
- stb_image
- ImGui
- Use the ImGui interface to modify rendering parameters in real-time.
- Explore different rendering techniques by selecting from the available demos.
- 2025-04-16: Update particle system from Array of Structures (AoS) to Structure of Arrays (SoA)
- The Cherno for the OpenGL tutorials and guidance.
- LearnOpenGL for providing excellent tutorials and resources.
- The Book of shader to guide through the complex shader.