Graphical Programming with OpenGL
Course Objectives and Structure
This project was undertaken as part of my engineering coursework, where I learned the basics of graphical programming with OpenGL. The course aimed to introduce us to creating 3D scenes using modern rendering techniques. Through 12 instructional videos, I explored and practiced concepts such as shaders, texture mapping, camera systems, and dynamic lighting.
The final project involved designing an interactive and animated 3D scene that incorporates all the concepts learned. For my project, I created a village nestled in a forest, featuring cartoon-style 3D models, a dynamic day-night cycle, and a virtual camera that allows exploration of the environment.
Objectifs et structure du cours
The course, titled Introduction to Modern OpenGL, focuses on the foundations and practical applications of OpenGL using a progressive approach. Here are the main steps:
Creating a Window and Managing User Inputs
Using the GLFW library, I learned to initialize an OpenGL window and capture keyboard and mouse inputs to interact with the scene.Rendering Simple Shapes
By sending data to the GPU, I started with drawing triangles, which form the basis of all 3D geometry.Shaders and Textures
Shaders, written in GLSL, allow direct control of object rendering. I also explored how to apply textures to enhance the visual appearance of models.Coordinate System and Virtual Camera
By configuring model, view, and projection matrices, I simulated a dynamic camera for scene navigation.Advanced Lighting
Finally, I implemented multiple types of lighting, including point lights, directional lights, and spotlights, to add an extra layer of realism to the scene.
Final Project Challenge: An Interactive 3D Scene
The final project involved designing a 3D scene that utilized all the techniques learned during the course. My goal was to create an immersive and interactive environment while customizing the rendering to reflect my personal style.
Scene Description
My scene depicts a village nestled in a forest, featuring "cartoon-style" elements such as colorful houses, simplified trees, and accessories like campfires and animals. Here are its main characteristics:
Visual Elements : All models were loaded from external files and rendered using OpenGL functionalities.
Dynamic Lighting : The lighting system includes simulated day-night transitions achieved by progressively varying light intensity and background color.
Interactive Camera : A virtual camera enables scene exploration, controlled via the keyboard (W, A, S, D) for movement and the mouse for adjusting the view angle.
Additional Interactivity : A toggleable flashlight allows users to illuminate dark areas, enhancing the immersive experience.
Technical Structure and Features
The project is built on a modular architecture, facilitating code management and extensibility. Below are the main modules and their functions:
Camera Management : The virtual camera offers smooth navigation, combining FPS-like movements with mouse-based rotations.
GLSL Shaders : Shaders handle object rendering, including lighting and texture management.
Lighting : I implemented various types of lights (spotlights, point lights) to enhance realism in the scene.
Textures : Textures enrich the visual elements by applying realistic or stylized patterns to objects.
Animation and Interactivity : Features like the flashlight and day-night transitions bring additional depth and engagement to the scene.
Transformation Matrices
Three essential matrices govern the arrangement and perspective of objects in the scene:
Model Matrix : Positions, orients, and scales objects.
View Matrix : Defines the camera's point of view.
Projection Matrix : Adds realistic perspective to create a sense of depth.
Results and Demonstration
The final render is an immersive scene featuring seamless light transitions. Here’s what you can expect to see in my demonstration video:
Exploration of the Village : Navigate through the village using the interactive camera.
Day/Night Cycle Simulation : Experience dynamic lighting transitions that mimic the passage of time.
Flashlight Usage : Illuminate specific areas with the flashlight for a more interactive experience.
This demonstration highlights the project's technical and visual accomplishments, showcasing a well-rounded application of modern OpenGL techniques.
Access the GitHub Repository
The GitHub repository for this project is available via the button below. This repository includes:
Code from the Guided Lessons : All steps from the course have been coded and are accessible for review, offering insights into the concepts and their practical implementation.
Code for the Final Render : The complete source code for my 3D scene can be found in the "Rendu" folder, showcasing the integration of all learned techniques.
