A question about adding a texture to the compositor.


14-05-2007 21:58:09

Very neat implementation.
I've been able to integrate a compositor into my Python-Ogre code and modify it to my specific needs (basically a form of posterization) but ideally, I need to feed two textures into the compositor, one consisting of the scene and one consisting of a dynamic texture. (most of the texture is precomputed ahead of time, but I have to change one or two bytes in the alpha channel for each frame).

(Within my application the scene texture is added to the dynamic texture rgb channels, posterized and packed into the red channel, while the alpha channel is mapped to the blue channel. This is used to drive a specialized display. The red channel consists of a stack of bits containing an 8-bit trucolor palette of the image [with the dynamic texture rgb channel corresponding to a dither mask] while the blue channel contains header information [which is mapped from the alpha channel] )

I've been able to construct the necessary dynamic texture in python-ogre reasonably easily, but I'm having considerable difficulty in figuring out how to feed it into the compositor. Is it possible to send the dynamic texture "directly" to the compositor or is it necessary to use a render to texture of a full screen quad containing the dynamic texture?

In this application, the image size is fixed at 1024x768 and the dynamic texture is the same size.


15-05-2007 10:03:39

This is mainly a guess, but could you do it by obtaining a materialPtr to your compositor material, and injecting the texture into a pass within that? This kind of compositor voodoo is a bit beyond me...


15-05-2007 17:47:31

Voodoo to me too. Been Cargo Cult programming to get this far. Will look into the suggestion.