User Tag List

Results 1 to 8 of 8

Thread: Strange "stretchy" artifact in shaders?

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    890
    Mentioned
    13 Post(s)
    Tagged
    1 Thread(s)

    Strange "stretchy" artifact in shaders?

    I've recently begun noticing this little issue with mine and a few other authors shaders:



    It appears as if when the shader has to sample pixels outside of the visible frame it just clamps to the last visible pixel and stretches it. I've made attempts to change the sampler_state addresses to Wrap and Mirror but it doesn't seem to help.

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleInstall Creator Pro
    Julian82's Avatar
    Join Date
    May 2012
    Location
    outbuddies.com
    Posts
    891
    Mentioned
    43 Post(s)
    Tagged
    0 Thread(s)
    Have you tried to put a black margin of 1px around your frame? In theory, the stretch artefact would then be pitch black and not disturb anything.

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    890
    Mentioned
    13 Post(s)
    Tagged
    1 Thread(s)
    Made a black border but now it looks like this:


    Basically the shader grabs that last pixel it can see within the application window view and stretches it instead of all the actual background that lies beyond the border...

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleInstall Creator Pro
    Julian82's Avatar
    Join Date
    May 2012
    Location
    outbuddies.com
    Posts
    891
    Mentioned
    43 Post(s)
    Tagged
    0 Thread(s)
    I guess that behaviour cannot be avoided if you use a shader that includes frame border elements. The shader only takes the renderer output and cannot grab elements outside the visible frame, as these are not rendered. If you use something that distorts margin elements I think one workaround could be a zoom shader on the whole frame. This way actually the visible output is smaller than the rendered texture and you get rid of margin artefacts. This solution is really heavy on resources though, I would not do it, I've done it, and it was bad.

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    890
    Mentioned
    13 Post(s)
    Tagged
    1 Thread(s)
    Well, it's understandable that shaders cannot work with things that isn't rendered but I'd imagine the wrap or mirror sampling would give other effects than clamping.

    So if I set the background texture of my shader to Mirror it should logically just begin making that pattern where the rendered image ends. Right?

    I found a couple of images explaining what I mean but a bit better I hope



    Clamp grabs the last pixel we can see and re-use it to infinity. Ew.


    VS.



    Fills in the "missing information" with the same texture but reversed. Not optimal solution perhaps but better than the former approach me thinks!

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    890
    Mentioned
    13 Post(s)
    Tagged
    1 Thread(s)
    New finding!
    The mirror addressing mode works once the camera has reached the very end of the frame. Meaning it'll clamp until it gets the frame's very border where it finally starts mirroring.

    Here we can see what it looks like:

    (Also I kept the black border from our previous test, hence the black line cutting down where the two parts merge.)

    So it does almost what I want it to except it only happens at the very ends of the frame. So close!

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleInstall Creator Pro
    Julian82's Avatar
    Join Date
    May 2012
    Location
    outbuddies.com
    Posts
    891
    Mentioned
    43 Post(s)
    Tagged
    0 Thread(s)
    Really great work!!

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    chrilley's Avatar
    Join Date
    Jul 2006
    Posts
    890
    Mentioned
    13 Post(s)
    Tagged
    1 Thread(s)
    Well nothing is solved yet so technically I'm still on square one :P

    It's a strange thing. I'd almost dare call it a bug at this point.

    Since it will only wrap/mirror at the very end of the frame border but not inside of it... BartekB even put together a really handy little .mfa that could scale my shader to only the visible parts of the frame that I thought for sure would work but no dice. Same issue.

    It's honestly not as much a problem for me but I can imagine people complaining about it when I put up the water shader I got cooking on the ClickStore. On the other hand several others has told me its just how it works with Fusion so... shrug and move on I guess?

Similar Threads

  1. Replies: 6
    Last Post: 18th August 2015, 02:23 AM
  2. "Rendertarget ping/pong" and "Pixel shaders" Can TGF2 do this?
    By CloudExSolider in forum The Games Factory 2 - Technical Support
    Replies: 13
    Last Post: 7th April 2013, 08:21 PM
  3. Very strange "rapid fire" problem
    By Sterling7 in forum The Games Factory 2 - Technical Support
    Replies: 21
    Last Post: 11th October 2012, 09:09 PM
  4. Strange behaviour with "Look in direction of"
    By JoKa in forum SWF/Flash Export Module Version 2.0
    Replies: 1
    Last Post: 6th April 2010, 06:51 AM
  5. A very strange problem with the "Tray Icon" object
    By bearcub in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 22nd December 2007, 06:44 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
  •