OpenGL Programming

From Wikibooks, open books for an open world
spacer The latest reviewed version was checked on 21 November 2012. There are template/file changes awaiting review.
Jump to: navigation, search

Welcome to the OpenGL Programming book. OpenGL is an API used for drawing 3D graphics. OpenGL is not a programming language; an OpenGL application is typically written in C or C++. What OpenGL does allow you to do is draw attractive, realistic 3D graphics with minimal effort. The API is typically used to interact with a GPU, to achieve hardware-accelerated rendering.

You are free, and encouraged, to share and contribute to this wikibook: it is written in the spirit of free documentation, that belongs to humanity. Feel free to make copies, teach it in school or professional classes, improve the text, write comments or even new sections.

We're looking for contributors. If you know about OpenGL, feel free to leave comments, expand TODO sections and write new ones!

spacer


spacer

Also see the GLSL Programming book.

spacer

Wikipedia has related information at OpenGL

Contents

  • 1 Introduction
  • 2 Setting Up OpenGL
  • 3 Modern OpenGL
    • 3.1 The basics arc
    • 3.2 The lighting arc
    • 3.3 The scientific arc
    • 3.4 Selected topics
    • 3.5 The post-processing arc
    • 3.6 Mini-portal
    • 3.7 Glescraft
    • 3.8 Using the accumulation buffer
    • 3.9 Cutting-edge OpenGL
    • 3.10 Code quality
    • 3.11 Appendices
  • 4 Legacy OpenGL 1.x
    • 4.1 Starting Tutorial
    • 4.2 Basics
    • 4.3 Intermediate
    • 4.4 Advanced
    • 4.5 Appendices
  • 5 External links
    • 5.1 Wikibooks
    • 5.2 Ports
    • 5.3 Freely-licensed documentation and samples
    • 5.4 Non-freely-licensed documentation
    • 5.5 Websites
    • 5.6 Further reading


[edit] Introduction

  1. About this book
  2. History and Evolution of OpenGL

[edit] Setting Up OpenGL

  • Installation on GNU/Linux
  • Installation on Macintosh
  • Installation on Windows with Code::Blocks
  • Installation for Android NDK development
    • with a GLUT-like wrapper to follow the exercises
  • Installation for iPhone development
  • Installing GLUT

[edit] Modern OpenGL

"Modern" OpenGL is about OpenGL 2.1+, OpenGL ES 2.0+ and WebGL, with a programmable pipeline and shaders.

[edit] The basics arc

01
spacer
spacer
Tutorial 01: newcomer's introduction, first dive into shaders 02
spacer
spacer
Tutorial 02: adding more robustness to our code, transparency
03
spacer
spacer
Tutorial 03: passing information to shaders: attributes, varying and uniforms 04
spacer
spacer
Tutorial 04: transformation matrices: positioning and rotating
05
spacer
spacer
Tutorial 05: adding the 3rd dimension: a cube, plus a camera 06
spacer
spacer
Tutorial 06: textures: displaying a wooden cube
07
spacer
spacer
OBJ format: loading Suzanne the monkey from Blender 08
spacer
spacer
Navigation: navigate in 3D space and manipulate objects in our model viewer

Tutorial_drafts: ideas and notes for upcoming tutorials

[edit] The lighting arc

This series of tutorials is a C++ port of the GLSL wikibook Basic Lighting tutorials.

01
spacer
spacer
Diffuse Reflection: about per-vertex diffuse lighting and multiple light sources of different kinds 02
spacer
spacer
Specular Highlights: about per-vertex lighting
03
spacer
spacer
Two-Sided Surfaces (about two-sided per-vertex lighting) 04
spacer
spacer
Smooth Specular Highlights (about per-pixel lighting)
05
spacer
spacer
Two-Sided Smooth Surfaces (about two-sided per-pixel lighting) 06
spacer
spacer
Multiple Lights (about for-loops for handling multiple light sources)

This series of tutorials is a C++ port of the GLSL wikibook Basic Texturing tutorials.

01
spacer
spacer
Textured Spheres: about texturing a sphere 02
spacer
spacer
Lighting Textured Surfaces: about textures for diffuse lighting
03
spacer
spacer
Glossy Textures: about gloss mapping 04
spacer
spacer
Transparent Textures: about using alpha textures for discarding fragments, alpha testing, and blending
05
spacer
spacer
Layers of Textures: about multitexturing

This series of tutorials is a C++ port of the GLSL wikibook tutorials about Textures in 3D.

01
spacer
spacer
Lighting of Bumpy Surfaces: about normal mapping 02
spacer
spacer
Projection of Bumpy Surfaces: about parallax mapping
03
spacer
spacer
Cookies: about projective texture mapping for shaping light 04
spacer
spacer
Light Attenuation: about texture mapping for light attenuation and lookup tables in general
05
spacer
spacer
Projectors: about projective texture mapping for projectors

There are more tutorials to port at the GLSL wikibook!

[edit] The scientific arc

01