bug in loading compositor resources

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

bug in loading compositor resources

Post by cyrfer »

Hi,
I have many compositors defined in a single file, and they use materials that I ALSO defined in the same file (deferred.compositor). I decided to make a 2nd file in the same folder for some new compositors I am writing (Bloom.compositor). One of the compositors in the 2nd file is using a material defined in the 1st file. When I try to use the compositor in the 2nd file, OGRE logs a message saying that no material exists for it.
CompositorChain: Compositor final_bloom_brightPass has no supported techniques.
I know the material exists because I have other compositors using it with no problems. I stepped through the ResourceGroupManager code. I can see the material property being assigned correctly to the render_quad target pass, so the compositor actually does have a good material.

Unfortunately, I also noticed that the new (2nd) script is compiled BEFORE the old (1st) script. Maybe this happens alphabetically? [edit] Yes, yes it does. [/edit]

I think the call to parse the scripts and declare resources should be separated from when the scripts are compiled/translated so that the resource dependencies actually exist.

It would also be helpful if the translator would log what material did not exist. This could be done if OgreScriptTranslator::Translate() called mPass->setMaterial(matPtr) instead of mPass->setMaterialName(string). In fact, it would probably be best if the string function was removed.

I'm using Rev 2930 from the Sinbad repository. Thanks for any help.
User avatar
syedhs
Silver Sponsor
Silver Sponsor
Posts: 2703
Joined: Mon Aug 29, 2005 3:24 pm
Location: Kuala Lumpur, Malaysia
x 51

Re: bug in loading compositor resources

Post by syedhs »

Yes I agree with this. I have similar albeit smaller problem - many times when compositor fail to load eg material is not found, it just silently moves on - no log whatsoever.. I only realized that compositor is not loaded when check the return value of CompositorManager::addCompositor. I can submit a patch for this.
A willow deeply scarred, somebody's broken heart
And a washed-out dream
They follow the pattern of the wind, ya' see
Cause they got no place to be
That's why I'm starting with me
cyrfer
Orc
Posts: 424
Joined: Wed Aug 01, 2007 8:13 pm
Location: Venice, CA, USA
x 7

Re: bug in loading compositor resources

Post by cyrfer »

@syedhs: Thanks for confirming the issue. If you are working on a patch, please let me know when it is complete. Thanks for your help!
cyrfer
Orc
Posts: 424
Joined: Wed Aug 01, 2007 8:13 pm
Location: Venice, CA, USA
x 7

Re: bug in loading compositor resources

Post by cyrfer »

Does anyone know if this recent commit can address the symptom I've seen?
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: bug in loading compositor resources

Post by masterfalcon »

Doubtful, that commit is just to speed up the loading of many small scripts where disk i/o is slow, such as many mobile systems.