Changes

Jump to: navigation, search

Howto:Shader programming in FlightGear

28 bytes added, 16:35, 27 March 2010
m
What is a Shader
= What is a Shader =
A shader is a programmable replacement for parts of the fixed function OpenGL function pipeline, you can imagine it sort of like a "plugin" to customize rendering.Shaders will be compiled when the 3D application starts. They will be validated and optimized for the current hardwarespecific scene elements.
GLSL shaders are not stand-alone applications; they require an application that utilizes the OpenGL API.
A shader is a program, to be run it must be loaded, compiled and linked. Shaders will be compiled when the 3D application starts. They will be validated and optimized for the current hardware. Actually each vertex and fragment shader must have one entry point (the main function) each, but you can create and link more shaders.
GLSL shaders themselves are simply a set of strings that are passed to the hardware vendor’s driver for compilation from within an application using the OpenGL API’s API's entry points. Shaders can be created on the fly from within an application or read in as text files, but must be sent to the driver in the form of a string.
GLSL has explicit ties to the OpenGL API - to the extent that much of the OpenGL 'state' (eg which light sources are bound, what material properties are currently set up) is presented as pre-defined global variables in GLSL.
2,561
edits

Navigation menu