On Thu, Nov 19, 2009 at 3:27 PM, Tristam MacDonald <[email protected]>wrote:

> On Thu, Nov 19, 2009 at 3:06 PM, Jonathan Hartley <[email protected]>wrote:
>
>> I just realised I understand even less than I thought I did.
>>
>> The 'glColor3f(1.0, 0.0, 0.0)' in 'on_draw()', four lines from the
>> bottom of that linked to code snippet. Modifying it demonstrates that
>> it controls the color of the texture that then gets blitted to the
>> screen. How the heck does that work? Surely the color of the pixels in
>> the texture are already set long before 'on_draw()' gets invoked?
>
>
> If GL_COLOR_MATERIAL is enabled, OpenGL multiplies all texture colours by
> the interpolated vertex colour during texture-mapping.
>
> Thus, as long as the pixels in your texture are something sensible (i.e.
> white), you can use glColor to re-colour the rendered texture on the fly.
>

Scratch that, I was thinking of lighting.

The vertex colour *always* multiplies the texture pixel colour.

-- 
Tristam MacDonald
http://swiftcoder.wordpress.com/

--

You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected].
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=.


Reply via email to