On Sun, 2009-09-13 at 01:29 -0400, john delahey wrote:

> I want to do 2 shader passes on an actor. I tried something like this:
> 
> .......
> CutterActor *tex0 = clutter_clone_texture_new(offscreen_actor);
> clutter_actor_set_shader(tex0, shader0);
> CutterActor *tex1 = clutter_clone_texture_new(tex0);
> clutter_actor_set_shader(tex1, shader1);
> .......

What is clutter_clone_texture_new? Did you mean clutter_clone_new? If so
then that call won't help you chain shaders and it does not use FBOs. I
think it should work if you replace clutter_clone_texture_new with
clutter_texture_new_from_actor which does use an FBO. I haven't tested
it though.

> What I get is tex1 is a copy of offscreen_actor with shader1 applied,
> while I wanted to get tex1 to be a copy of tex0 (after shader0 is
> applied on tex0) with shader1 applied. Am I doing something wrong?
> 
> I though about doing it instead in the paint callback of an actor.
> There I would use COGL to create a framebuffer objects and perform the
> passes directly. Is it the right way to do it?

That would also work and would probably be quite a nice way to do it but
it would be more effort than using clutter_texture_new_from_actor.
However texture_new_from_actor does a fair amount of work to set up the
projection matrices and clipping stack which you could avoid if you just
want to render a non-transformed texture so it may be a performance
benefit.

Regards,
- Neil

-- 
To unsubscribe send a mail to [email protected]

Reply via email to