Page MenuHome

2dFilter actuator is always pulsed
Closed, ArchivedPublic

Description

Group: current SVN version
Category: Game engine

To test this bug you will need:
1) EnableFilterBUG.blend (attached)
2) a graphic card with GLSL support
3) a building environment with debug enable
4) recent svn and some minutes (not so much)


To test the bug add 2 breakpoints in the file RAS_2DFilterManager.cpp

1) line 477: [need_tex_update=true;]
2) line 419: [SetupTextures(need depth, need luminance);]

In my system, even though I'm not using a pulsed sensor, the function UpdateFilter() is being called every frame (more than once I think).
Then the function EnableFilter is been called as well.

In EnableFilter the first BP is called and consequently the second one (it's a code that runs if need_tex_updte == true).

According to my understanding of this part of the code, this is not supposed to be happen and can be causing some real performance decreasing for 2dfilters. I hope I'm wrong, but if the breakpoints never stop been called, then ... Houston we have a problem :)

Blender SVN (ie 17752) Windows Vista 64, cmake + MSVC, NVidia 9600

Event Timeline

Indeed there is an error with the 2D filter actuator: it stays enabled and runs on each frame, which results in the shader program to be recompiled each time... big performance waste.

Hopefully the fix is extremely simple.
Replace the "return true" at line 77 of SCA_2DFilterActuator.cpp by:

// once the filter is in place, no need to update it
return false;

That's it.
Can you test the fix will all the shader stuff that you have?

Benoit so far I tested and this fix helps.
I want to run some more tests though.

And I asked Mike (Pan) to test with some of his shaders as well. As soon as we get a position I let you know.

Thanks a lot !

I did not receive more feedback so I assume the fix is working.

Fix commited in trunk and ticket closed

Benoit Bolsee (ben2610) changed the task status from Unknown Status to Unknown Status.Jan 2 2009, 11:16 PM

Sorry about the lack of feedback. I was trying to talk with zaghaghi about that, but I couldnt find him online since then.

Your fix solves the problem of the 2dfilter been called every logic tic.
We are still re-creating the textures every frame though, instead of only copying. But this is something that was introduced in the last zaghaghi commit (17469) - http://lists.blender.org/pipermail/bf-blender-cvs/2008-November/016678.html

It was introduced as a bug fix, so the better would be to talk with zaghaghi directly.

Thanks Benoit

The commit that you refer to is not on the same file: I patched SCA_2DFilterActuator.cpp while the commit is about RAS_2DFilterManager.cpp.

I am pretty sure of my fix but I will pass the ticker to Zaghaghi to let him comment on that.

hi benoit,

thank you for fixing the bad bug ;), i should take care of these mistakes.

This task was automatically closed as archived as part of migration, because the project or tracker this task belonged to is no longer active.