Howto:Shader programming in FlightGear: Difference between revisions

m
m (glsl quick ref)
Line 68: Line 68:
There are two types of shaders in GLSL: "vertex shaders" and "fragment shaders".
There are two types of shaders in GLSL: "vertex shaders" and "fragment shaders".
These are executed by vertex and fragment processors in the graphics hardware.
These are executed by vertex and fragment processors in the graphics hardware.
Typically, vertex shader files use the file extension ".vert", while fragment shader files use the ".frag" extension. In FlightGear, these files can be found in the "Shaders" subdirectory of the base package, i.e. $FG_ROOT/Shaders
For a list of currently available shaders, you may want to take a look at: http://cvs.flightgear.org/viewvc/data/Shaders/


So, shaders generally go around in pairs - one shader (the "Vertex shader") is a short program that takes in one vertex from the main CPU and produces one vertex that is passed on to the GPU rasterizer which uses the vertices to create triangles - which it then chops up into individual pixel-sized fragments.  
So, shaders generally go around in pairs - one shader (the "Vertex shader") is a short program that takes in one vertex from the main CPU and produces one vertex that is passed on to the GPU rasterizer which uses the vertices to create triangles - which it then chops up into individual pixel-sized fragments.  
2,561

edits