Jump to content
  • Advertisement
Sign in to follow this  
Funkymunky

[web] Convolution filter divisor? (flash)

This topic is 4269 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I have a question about a convolution filter that I'm applying in actionscript. Right now it's a basic blur filter, ie: 1, 0, 1, 0, 1, 0, 1, 0, 1 Every frame I draw a rectangle with a BitmapData called "pattern". I call pattern.applyFilter to apply the convolution filter to it, then do a basic bitmap fill and draw the rectangle. My question has to do with the divisor used in the construction of the convolution filter. The default is supposed to be 1, but if i set the divisor to 1 it results in a solid color filling the rectangle. If I use 0 (which is supposed to be ignored and replaced with the default) I get the same solid color. If I omit the divisor, it works properly as a blur filter... So wtf? Why can't I set the divisor to the default value and get the same result?

Share this post


Link to post
Share on other sites
Advertisement
This answer may be totally missing the point and useless, but here goes:

Dividing any number by 1 will give you the original number.

Dividing any number by 0 will give you a result of infinity, which defaults to NaN or some such thing.

I would imagine matrix multiplication works similarly.

Share this post


Link to post
Share on other sites
What I'm saying is that the default divisor is 1, but I get a different result if I manually set the divisor as 1 (or as 0, which causes the function to use the default anyway according to the documentation)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!