Strange "stretchy" artifact in shaders?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

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

    Please login to see this picture.

    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.

    Please login to see this link. Please login to see this link.
    Freelance Dev | Currently Working on Jarvis | Please login to see this link.

  • 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.

    Please login to see this link.
    Please login to see this link. | Please login to see this link. | Please login to see this link. | Please login to see this link.

  • Made a black border but now it looks like this:
    Please login to see this picture.

    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...

    Please login to see this link. Please login to see this link.
    Freelance Dev | Currently Working on Jarvis | Please login to see this link.

  • 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.

    Please login to see this link.
    Please login to see this link. | Please login to see this link. | Please login to see this link. | Please login to see this link.

  • 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 :)


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


    VS.


    Please login to see this picture.
    Fills in the "missing information" with the same texture but reversed. Not optimal solution perhaps but better than the former approach me thinks!

    Please login to see this link. Please login to see this link.
    Freelance Dev | Currently Working on Jarvis | Please login to see this link.

  • 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:
    Please login to see this picture.
    (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!

    Please login to see this link. Please login to see this link.
    Freelance Dev | Currently Working on Jarvis | Please login to see this link.

  • 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?

    Please login to see this link. Please login to see this link.
    Freelance Dev | Currently Working on Jarvis | Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!