Book Image

Lua Game Development Cookbook

By : Mario Kasuba, Mário Kašuba
Book Image

Lua Game Development Cookbook

By: Mario Kasuba, Mário Kašuba

Overview of this book

Table of Contents (16 chapters)
Lua Game Development Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Introduction


This chapter will deal with programming and using dynamic rendering pipeline in OpenGL. While shaders have been available since OpenGL 2.0, their first versions are now considered deprecated. A wide variety of graphic cards now support at least OpenGL 3.3, which implements the currently valid specification of GLSL shaders. This chapter will focus on GLSL version 3.3, which is relevant for OpenGL 3.3.

Shaders are small programs that define the behavior of the graphic card for scene rendering. They are usually written in C-like language and compiled into binary form by the graphical driver. Shader programs are compiled at runtime. Just out of curiosity, a newer version of OpenGL 4.1 allows you to compile shader programs into binary form, which can be saved into a file and used later without re-compilation.

Shaders provide substantially better flexibility than a fixed pipeline and present a door to parallel graphical processing on GPU.

The immediate mode for the fixed rendering pipeline...