Rename the third texure coordinate from 'r' to 'p'

Using 'r' to name the third component is problematic because that is
commonly used to represent the red component of a vector representing
a color. Under GLSL this is awkward because the texture swizzling for
a vector uses a single letter for each component and the names for
colors, textures and positions are synonymous. GLSL works around this
by naming the components of the texture s, t, p and q. Cogl already
effectively already exposes this naming because it exposes GLSL so it
makes sense to use that naming consistently. Another alternative could
be u, v and w. This is what Blender and Direct3D use. However the w
component conflicts with the w component of a position vertex.
This commit is contained in:
Neil Roberts
2010-07-12 17:01:32 +01:00
parent 5288f6d88d
commit ec718d4ca4
13 changed files with 65 additions and 53 deletions

View File

@ -1682,10 +1682,10 @@ enable_state_for_drawing_buffer (CoglVertexBuffer *buffer)
COGL_MATERIAL_WRAP_MODE_OVERRIDE_REPEAT;
options.flags |= COGL_MATERIAL_FLUSH_WRAP_MODE_OVERRIDES;
}
if (_cogl_material_layer_get_wrap_mode_r (layer) ==
if (_cogl_material_layer_get_wrap_mode_p (layer) ==
COGL_MATERIAL_WRAP_MODE_AUTOMATIC)
{
options.wrap_mode_overrides.values[i].r =
options.wrap_mode_overrides.values[i].p =
COGL_MATERIAL_WRAP_MODE_OVERRIDE_REPEAT;
options.flags |= COGL_MATERIAL_FLUSH_WRAP_MODE_OVERRIDES;
}