writing intermediate compositor textures to disk

Minor issues with the Ogre API that can be trivial to fix
Post Reply
cyrfer
Orc
Posts: 424
Joined: Wed Aug 01, 2007 8:13 pm
Location: Venice, CA, USA
x 7

writing intermediate compositor textures to disk

Post by cyrfer »

Hi,
I believe I found a bug when using RenderTarget::writeContentsToFile(...) with a RenderTexture obtained from a Compositor's intermediate textures.

I use this function after drawing the scene, and before OGRE draws the next frame, with a keyboard key press handler. I obtain the intermediate texture with:

Code: Select all

TexturePtr texture = TextureManager::getByName("c1/result/Example_RTT_window");
Then I get the hardware pixel buffer and the RenderTexture (as shown on the Wiki).

Code: Select all

RenderTexture renderTex = texture->getBuffer()->getRenderTarget();
I use the file writing support, and I get the image file with no known problems.

The next frame, the CompositorChain is screwed up. Inside CompositorChain::preRenderTargetUpdate(...) the chain of TargetOperations are iterated. The TargetOperation using the RenderTexture I was interested in causes a crash AS it is passed into CompositorChain::preTargetOperation(). Maybe it is NULL, but the debugger does not show it.

[edit]I'm pretty sure the crash occurs because the iterator is dereferenced. It seems as though the chain was modified. How did this happen? [/edit]

Does anyone know why the compositor chain was modified? Thanks for any help.

I'm using the Sinbad Hg trunk, 1.8.not_released.
Post Reply