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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user