Skip to main content
grasp.study
About
Explore
Pricing
Log in
Try it for free
Back to course
👋
Welcome to a Grasp lesson
Create a free account
to keep studying and create your own study path.
3D game development with C/C++
·
Module 6
Texturing and Basic Lighting
1
Loading Image Data with stb_image
Load image data from a file using a library like stb_image.
OpenGL Texture Creation and Data Binding
Create an OpenGL texture object and bind image data to it.
3
Mapping Textures with UV Coordinates
Define texture coordinates (UVs) as a vertex attribute to map textures onto a mesh.
4
Texture Sampling in Fragment Shaders
Sample from a texture in the fragment shader.
Phong Lighting in GLSL
Implement the Phong lighting model (ambient, diffuse, specular) in the fragment shader.
6
Surface Normals for Lighting
Define surface normals as a vertex attribute for lighting calculations.
7
Normal Transformation for Correct Lighting
Transform normals into world space to ensure correct lighting on rotated objects.
8
Shader Uniforms: Light & Camera Data
Pass light properties (e.g., position, color) and camera position to the shader as uniforms.
Previous module
Rendering in 3D Space
Next module
Core Game Architecture