wayfinder Posted January 9, 2015 Share Posted January 9, 2015 I apply a filter to a rather large group of sprites. How can I exclude one or more specific sprites from being affected by the filter? Is it even possible? Would I have to apply the filter to every sprite in the group separately, and then just leave out the ones I want unaffected? What would that do to performance? I'm talking possibly hundreds of sprites here, and the filter is called with 4 textures... Please help me! Link to comment Share on other sites More sharing options...
wayfinder Posted January 10, 2015 Author Share Posted January 10, 2015 Okay, I tested out applying the filter separately to all the components of the group and it absolutely kills the performance - so that one's out, at least in its current form. I wonder if, since the images would all use the same 4 textures, those could be uploaded to the graphics card just once and then used by all the filters without further performance hits? Is there a way? Link to comment Share on other sites More sharing options...
wayfinder Posted January 13, 2015 Author Share Posted January 13, 2015 Link to comment Share on other sites More sharing options...
ultimatematchthree Posted January 13, 2015 Share Posted January 13, 2015 How about creating another group which contains the same sprites as the first group minus the sprites which you don't want to apply filters to, then apply your filter on the new group? You could perform all your usual game logic on the first group, and use the new group just for applying filters. Link to comment Share on other sites More sharing options...
wayfinder Posted January 14, 2015 Author Share Posted January 14, 2015 As far as I can tell, sprites can only belong to one group and upon adding them to another will be removed from the first... Link to comment Share on other sites More sharing options...
ultimatematchthree Posted January 14, 2015 Share Posted January 14, 2015 Ah right, sorry about that. How about nesting groups? Create a new group that will contain all the display objects you want filtered, then put that under your new group. Meanwhile, your original group will still contain the display objects that shouldn't be filtered, then add your new group to your original group. Not sure if it will work but maybe worth a try? Link to comment Share on other sites More sharing options...
wayfinder Posted January 15, 2015 Author Share Posted January 15, 2015 Then the draw order would be wrong I think there may not actually be a way... Link to comment Share on other sites More sharing options...
MichaelD Posted January 15, 2015 Share Posted January 15, 2015 Does the excluded item have some special property on them? You could run a loop for all the children of the group and when you detect that "special" one remove the filter and just "break;" the loop. Link to comment Share on other sites More sharing options...
wayfinder Posted January 15, 2015 Author Share Posted January 15, 2015 I'm not sure how to do that - the filter is applied after the group has been rendered. The object I want to exclude is somewhere inside the group, possibly half-obscured by other parts of it. By the time the filter gets to do its thing, I don't think I can separate out which pixels belong to which sub-object. Link to comment Share on other sites More sharing options...
MichaelD Posted January 15, 2015 Share Posted January 15, 2015 Are those sprites that you want excluded random? Or do they have some property on them that distiguishes them from the others of the group? Link to comment Share on other sites More sharing options...
wayfinder Posted January 15, 2015 Author Share Posted January 15, 2015 I can give them such a property. Link to comment Share on other sites More sharing options...
Recommended Posts