On Tue, 2009-03-31 at 14:40 +1000, Saul Lethbridge wrote: > Is there any way to create actors that emit light in clutter? I'm > wanting to create a spotlight effect that I can animate and move > around the stage. I noticed some reference to lighting in recent > builds of cogl: cogl_material_set_emission > > Am I on the right track?
Cogl doesn't yet give you a way to add lights to your scene. I had lighting in mind when I wrote CoglMaterials so they do expose GL material properties which you can use if you find a way to add lighting. For now you may be able to break out into raw GL and call glLightfv as appropriate. I can't be sure of what issues you might hit trying this, nor can I guarantee that this code wont be broken when we add proper support into Cogl, but short term it might work for you. Alternatively you can look into adding Cogl support for lighting. If you go for the latter though I'd urge you not to thinly wrap the gl API, instead I think creating a CoglHandle that represents a light object would be a preferable approach, and add methods for changing the ambient, diffuse and specular intensities and position etc. kind regards, - Robert -- Robert Bragg, Intel Open Source Technology Center -- To unsubscribe send a mail to [email protected]
