Graphics Reference
In-Depth Information
Point parameters . In OpenGL you can specify the properties of a geometric
point. This data is available to your shaders:
struct gl_PointParameters
{
float size;
float sizeMin;
float sizeMax;
float fadeThresholdSize;
float distanceConstantAttenuation;
float distanceLinearAttenuation;
float distanceQuadraticAttenuation;
};
uniform gl_PointParameters gl_Point;
In the items below, we introduce some shortcut names for a number
of properties of materials and lights. These are used to show how the later
derived materials states are computed.
Materials. When you use the OpenGL lighting model, you specify properties
of the materials that make up a graphics primitive. This data is available to
your shaders:
struct gl_MaterialParameters
{
vec4 emission; // Ecm
vec4 ambient; // Acm
vec4 diffuse; // Dcm
vec4 specular; // Scm
float shininess; // Srm
};
uniform gl_MaterialParameters gl_FrontMaterial;
uniform gl_MaterialParameters gl_BackMaterial;
Lights. When you specify a light in OpenGL, you specify a number of proper-
ties, from the light's colors to the light's position, to the type of light it is to be.
You also specify the kind of light model to be used. This data is available to
your shaders:
struct gl_LightSourceParameters
{
vec4 ambient; // Acli
vec4 diffuse; // Dcli
vec4 specular; // Scli
Search WWH ::




Custom Search