Getting Started with OpenGL ES 3+ Programming by Hans de Ruiter - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

Table of Contents

Introduction

Who is this For?

Why OpenGL ES 3+ and SDL2?

How to Get the Most Out of These Tutorials

What if I Get Stuck?

Tutorial 1: Getting Started

Setting Up the Development Environment

Setup on Windows

Our First GLES3 & SDL2 Program

Headers and Definitions

SDL and OpenGL Initialization

Opening the Window

Draw Something

Wait Until the User Wants to Quit

The Code in Full

Running the Program

Exercises

Tutorial 2: Hello Triangle

The Theory

Getting Started

The Shaders

The Vertex Shader

The Fragment Shader

Compiling and Linking the Shaders

Compiling a Single Shader

Linking Shaders into a Program

Activating the Shader

Creating the Triangle

The Actual Triangle

Drawing the Triangle

Cleanup

Testing

Exercises

Tutorial 3: Texture Mapping

Getting Started

Installing SDL_image on Windows

Installing SDL_image on Other Platforms

Texture Mapping Shaders

The Vertex Shader

The Fragment Shader

Binding the Sampler2D to a Texture Unit

Texture Loading

Swizzling

Loading the Texture

Destroying/Deleting The Texture

Using the Texture

Vertex Texture Coordinates

Draw

Exercises

Tutorial 4: 3D At Last

The Theory

Getting Started

3D Mathematics

MVP Matrix in the Vertex Shader

Building the 3D Cube

Simulating the Virtual World

Drawing

The Depth Buffer

Exercises

Tutorial 5: Lighting

Theory

Diffuse Lighting

Ambient Light

Putting it All Together

Getting Started

Shaders

The Vertex Shader

The Fragment Shader

Adding the Surface Normals

Generating the New Uniform Variables

Lights, Camera, & Action

Exercises

Tutorial 5a: Animation

Getting Started

The Event Loop

Frame-Rate Independent Animation

The Full Main Loop Code

Exercises

What’s Next

Updated Visual Studio Template

Learn More

Made Something Interesting/Awesome?