出典: フリー教科書『ウィキブックス(Wikibooks)』
移動先: 案内検索

OpenGL Programming ブックへようこそ。 OpenGL は 3D グラフィックスの描画に使用するAPIです。 OpenGL はプログラミング言語ではありません。 OpenGL アプリケーションは、一般的に、C言語またはC++で書かれます。 OpenGL の役割は、魅力的で、リアルな3Dグラフィックスを、最小限の労力で描画できるようにすることです。 APIは通常、GPUと連携をとってハードウェア アクセラレーション レンダリングを実現するために使用されます。

このwikibookへの 参加貢献 は自由で、 奨励されています: フリードキュメンテーションの精神で書かれていて、全人類に帰属するものです。 気軽に印刷したり、学校やプロフェッショナルクラスに教えたり、テキストを改善し、コメントを書き、新しいセクションを執筆してください。

私たちは貢献者を探しています。 OpenGLについて知っていることがあれば、お気軽にコメントを残したり、TODOセクションを拡張したり、新しいセクションを書いてくださいね!



  1. この文書について
  2. OpenGLの歴史と進化


Modern OpenGL[編集]

"Modern" OpenGL の範囲は、 OpenGL 2.1+, OpenGL ES 2.0+,および WebGLで、 プログラマブルなパイプラインやシェーダが付属するものです。

The basics arc[編集]

OpenGL Tutorial Triangle.png
チュートリアル 01: newcomer's introduction, first dive into shaders 02
OpenGL Tutorial Triangle interleaved.png
チュートリアル 02: adding more robustness to our code, transparency
OpenGL Tutorial Triangle alpha-blending.png
チュートリアル 03: passing information to shaders: attributes, varying and uniforms 04
OpenGL Tutorial Triangle rotating.png
チュートリアル 04: transformation matrices: positioning and rotating
OpenGL Tutorial Cube primary colors.png
チュートリアル 05: adding the 3rd dimension: a cube, plus a camera 06
OpenGL Tutorial Cube textured.png
チュートリアル 06: textures: displaying a wooden cube
OpenGL Tutorial TODO.png
OBJ format: loading Suzanne the monkey from Blender 08
OpenGL Tutorial TODO.png
Navigation: navigate in 3D space and manipulate objects in our model viewer

Tutorial_drafts: ideas and notes for upcoming tutorials

The lighting arc[編集]

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

OpenGL Tutorial Lightning Diffuse.png
Diffuse Reflection: about per-vertex diffuse lighting and multiple light sources of different kinds 02
OpenGL Tutorial Suzanne specular.png
Specular Highlights: about per-vertex lighting
OpenGL Tutorial LIghtning two-sided.png
Two-Sided Surfaces (about two-sided per-vertex lighting) 04
OpenGL Tutorial Lighting Phong.png
Smooth Specular Highlights (about per-pixel lighting)
OpenGL Tutorial Lighting Phong two-sided.png
Two-Sided Smooth Surfaces (about two-sided per-pixel lighting) 06
OpenGL Tutorial Lighting Phong multi-lights.png
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.

OpenGL Tutorial Textured Spheres.jpg
Textured Spheres: about texturing a sphere 02
OpenGL Tutorial Lighting Textured Surfaces.jpg
Lighting Textured Surfaces: about textures for diffuse lighting
OpenGL Tutorial Glossy Textures.jpg
Glossy Textures: about gloss mapping 04
OpenGL Tutorial Transparent Textures.jpg
Transparent Textures: about using alpha textures for discarding fragments, alpha testing, and blending
OpenGL Tutorial Layers of Textures.jpg
Layers of Textures: about multitexturing

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

OpenGL Tutorial Lighting of Bumpy Surfaces.jpg
Lighting of Bumpy Surfaces: about normal mapping 02
OpenGL Tutorial TODO.png
Projection of Bumpy Surfaces: about parallax mapping
OpenGL Tutorial TODO.png
Cookies: about projective texture mapping for shaping light 04
OpenGL Tutorial TODO.png
Light Attenuation: about texture mapping for light attenuation and lookup tables in general
OpenGL Tutorial TODO.png
Projectors: about projective texture mapping for projectors

There are more tutorials to port at the GLSL wikibook!

The scientific arc[編集]

OpenGL Tutorial Graph 01.png
Graph 01: plotting a simple function, using vertex buffer objects and point sprites 02
OpenGL Tutorial Graph 02.png
Graph 02: plotting a graph from data in a texture
OpenGL Tutorial Graph 03.png
Graph 03: plotting borders and axes, clipping 04
OpenGL Tutorial Graph 04.png
Graph 04: plotting a three-dimensional graph
OpenGL Tutorial Graph 05.png
Graph 05: plotting a surface with hidden line removal

And more to come.

Selected topics[編集]

OpenGL Tutorial Arcball concept.png
Arcball: intuitive object rotation with the mouse 02
OpenGL Tutorial Bounding box.png
Bounding box: draw a cube around your object for editing or debugging purposes
OpenGL Tutorial WIP.png
2D-on-3D: hardware-accelerated 2D programming 04 Video Capture: capture your animation using apitrace (C++) or JavaScript (WebGL)
OpenGL Tutorial Teapot control points.png
Tea time: generating a HD teapot from Bézier surfaces 06
OpenGL Tutorial Stencil.png
Stencil buffer: masking and combining
OpenGL Tutorial TODO.png
Quadrics: creating simple shapes with a bit of maths 08
OpenGL Tutorial Text 01.png
Basic text: rendering text using the FreeType library
OpenGL Tutorial Text 01.png
Optimized text rendering: using a texture atlas containing all glyphs 10
OpenGL Tutorial Object Selection.png
Object selection: unprojecting coordinates and object identification using the stencil buffer
OpenGL Tutorial TODO.png
Anti-Aliasing: smoothing lines

The post-processing arc[編集]

OpenGL Tutorial Post-processing Water.png
Concepts: how to perform full-screen post-processing, first example with a simple animated wave 02
OpenGL Tutorial TODO.png
???: next effect to be decided!


This series shows how to implement a teleportation system similar to Valve's Portal, step-by-step, using OpenGL.

OpenGL Tutorial Mini-Portal Non-Recursive.png
Mini-Portal: a first working see-through portal 02
OpenGL Tutorial TODO.png
Mini-Portal Smooth: smooth transition, understanding the camera
OpenGL Tutorial Mini-Portal.png
Mini-Portal Recursive: recursive portals - display portals within portals 04
OpenGL Tutorial WIP.png
Mini-Portal Optimization: optimization with scissors


This series shows how to render a voxel based world, similar to Minecraft.

OpenGL Tutorial Glescraft 1.png
Glescraft 1: basic voxel rendering 02
OpenGL Tutorial Glescraft 3.png
Glescraft 2: removing unnecessary voxel faces
OpenGL Tutorial Glescraft 6.png
Glescraft 3: texturing, lighting, fog, transparency 04
OpenGL Tutorial Glescraft 7.png
Glescraft 4: first person camera controls
OpenGL Tutorial WIP.png
Glescraft 5: drawing only what is on screen 06
OpenGL Tutorial WIP.png
Glescraft 6: adding and removing voxels
OpenGL Tutorial WIP.png
Glescraft 7: using geometry shaders

Using the accumulation buffer[編集]

OpenGL Tutorial Glescraft-mb.png
Tutorial 01: motion blur 02
OpenGL Tutorial Glescraft-nodof-aa.png
Tutorial 02: full-screen supersampling anti-aliasing
OpenGL Tutorial Glescraft-dof-middle.png
Tutorial 03: depth of field 04
OpenGL Tutorial Glescraft-trans-side.png
Tutorial 04: order-independent transparency

Cutting-edge OpenGL[編集]

If you do not need to target mobile devices or the web, you can upgrade to OpenGL 4.x. It notably introduces 3 new kinds of shaders: Geometry, Tessellation Control and Tessellation Evaluation.

OpenGL Tutorial TODO.png
Tutorial 01: modify and create vertices on the fly with geometry shaders 02
OpenGL Tutorial TODO.png
Tutorial 02: dynamic mesh quality with tesselation

and lots of other features.

Code quality[編集]

OpenGL Tutorial WIP.png
Debugging: tips to help debug your OpenGL code 02
OpenGL Tutorial WIP.png
Performances: measuring and improving your application perfs


Legacy OpenGL 1.x[編集]

"Legacy" OpenGL is about OpenGL 1.x and OpenGL ES 1.x, with a fixed pipeline and no shaders.

Starting Tutorial[編集]

  1. Setting Up A Programming Environment On Windows75%.svg
  2. Setting Up OpenGL In The Programming Environment75%.svg
  3. Drawing Primitives75%.svg
    1. Immediate Mode
    2. Display Lists
    3. Vertex Arrays
  4. Basic Transformations75%.svg
    1. Translation
    2. Rotation
    3. Scaling
    4. Custom Transformations


  1. Structure of a Typical OpenGL Application 100 percent.svg
  2. Drawing Rectangles 75%.svg
  3. Drawing Lines and Points
  4. Drawing Simple 2D Shapes 100 percent.svg
  5. OpenGL Naming Conventions 75%.svg
  6. Using Color 75%.svg
  7. Viewing Transformations 25%.svg
  8. Drawing Simple 3D Objects
  9. Perspective versus Orthographic Projections


  1. Smoothing Polygons with Normals
  2. Adding Lights
  3. Using Materials
  4. Using Textures
  5. Using Mipmaps
  6. Drawing Complex Polygons Using Tessellation


  1. Optimizing OpenGL Code
  2. Drawing Shadows
  3. Drawing Using Quadrics
  4. Drawing Using NURBS and Curves
  5. Ambient Occlusion


  1. Coordinate Transformations
  2. Understanding Transformation Matrices
  3. OpenGL Library Reference. functions and type reference for gl.h glu.h and glut.h
  4. Why OpenGL Exists and What It's Good For
  5. Migrating from 1.x to 2.x: how to upgrade your code to use modern OpenGL


Related WikiBooks:

  • GLSL Programming : wikibook on the use of the OpenGL Shading Language (GLSL) in Unity 3 and Blender 2.5, with much information on lighting and texturing
  • Blender 3D: Noob to Pro: comprehensive book on using the Blender 3D modeling environment


The following websites provide conversion of the tutorials to other programming languages or platforms:

Freely-licensed documentation and samples[編集]

Non-freely-licensed documentation[編集]


Further reading[編集]

  • OpenGL Architecture Review Board, et al: OpenGL Programming Guide: The Official Guide to Learning OpenGL, Version 2, Fifth Edition, Addison-Wesley, ISBN 0-321-33573-2
  • OpenGL Architecture Review Board, et al: OpenGL Reference Manual: The Official Reference Document to OpenGL, Version 1.4, Addison-Wesley, ISBN 0-321-17383-X
  • Wright, Richard S. Jr and Lipchak, Benjamin: OpenGL SuperBible, Third Edition, Sams Publishing, ISBN 0-672-32601-9

{ テンプレート:Status