User Tag List

Results 1 to 10 of 10

Thread: Smooth linear filtering on moving objects

  1. #1
    No Products Registered

    Join Date
    Dec 2008
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smooth linear filtering on moving objects

    Hi guys

    I noticed that despite this version of MMF using hardware acceleration, that it doesn't allow you to position an object at decimal point positions and therefore it isn't able to make an active move smoothly from one pixel to another.

    However, I found a really simple way to get around this limitation by using a pixel shader! And its really easy to impliment!

    All you have to do is go to http://complex.ovh.org/index.php?p=extensions&c=8#prod8 and download the shaders pack. Once installed, select your object that you want to have the smooth linear filtering and give it the 'zoom and offset' pixel shader.

    Now, because MMF doesn't allow you to move an object around in decimal points, you have to use alterable values. Start off by initialising the alterable values like so:

    Start of frame
    - Set Value A to X("Active")
    - Set Value B to Y("Active")

    Then simply add in your events to move your object around, but rather than affecting the X and Y values (because they are limited to integer values), modify Value A and B
    Key left is down
    - Add -0.1 to Value A
    ... etc

    Then the event:
    Always
    Set X to Value A
    Set Y to Value B

    Now, mmf will round X and Y to the lowest integer, so we caculate the offset like this:
    0-(Alterable Value A( "Active" )-X( "Active" ))/(X Right( "Active" )-X Left( "Active" )+0.0)
    ...because the offset value isn't in pixels, its in a range between 0 and 1, 1 being the total width of the object, so we need to divide it by the width of the active. As there is no expression to get the width of an object, we use Right - Left.

    I have attached a mfa file demonstrating the effect. The shape at the top moves around with the linear filtering, while the shape below doesn't.

    Attached files Attached files

  2. #2
    Clicker Multimedia Fusion 2
    SEELE's Avatar
    Join Date
    Jul 2007
    Location
    Terra australis incognito
    Posts
    1,916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Smooth linear filtering on moving objects

    It would be great if this was built in to mmf (as in float point positions)

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Smooth linear filtering on moving objects

    I agree! It's probably a big thing to change though (changing a data type from integer to float for all position things related to MMF2, and getting everything to work with that instead), but let's hope it will work in MMF3.

  4. #4
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    1,812
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Smooth linear filtering on moving objects

    Already been mentioned and acknowledged several times. The reason I don't use it is because it is hardly noticable in most games, unless you have a mouse cursor or something.

  5. #5
    No Products Registered

    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    1,141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Smooth linear filtering on moving objects

    One reason would be that the pixel precise collision detection mmf uses won't really work if the object can be placed at sub-pixel positions.

  6. #6
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Smooth linear filtering on moving objects

    The collision mask could be placed on the nearest integer position, and the sub-pixel stuff could be used for displaying things only.

  7. #7
    No Products Registered

    Join Date
    Jul 2006
    Location
    Texas
    Posts
    1,225
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Smooth linear filtering on moving objects

    I had already created one of these a long time ago. I kept trying to add more cool stuff to it too, like directional blur and stuff like that. I gave up pretty quickly...

  8. #8
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Smooth linear filtering on moving objects

    i think this is pretty cool!

  9. #9
    No Products Registered

    Join Date
    Mar 2009
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Smooth linear filtering on moving objects

    I'm using arrays to get around this, having my run movement go (+1, +2, +1, +1, +2, +1, +2, +2, +1, +2) for example.

  10. #10
    No Products Registered

    Join Date
    Jul 2006
    Location
    Texas
    Posts
    1,225
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Smooth linear filtering on moving objects

    ...what?

Similar Threads

  1. Smooth Moving!
    By XStar in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 24th October 2012, 11:12 PM
  2. Smooth Filtering for rotated Active Picture?
    By AyreGuitar in forum iOS Export Module Version 2.0
    Replies: 3
    Last Post: 13th April 2012, 03:36 PM
  3. Smooth way to associate objects?
    By Gunnar in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 14th March 2011, 11:39 AM
  4. Smooth scrolling with moving camera.
    By Popcorn in forum File Archive
    Replies: 0
    Last Post: 31st August 2009, 08:10 PM
  5. Linear Filtering?
    By stuckboy in forum Hardware Accelerated Runtime
    Replies: 5
    Last Post: 19th July 2009, 01:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •