User Tag List

Results 1 to 9 of 9

Thread: Shader with background sampler doesn't work when layer's alpha coef is not zero

  1. #1
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    535
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Shader with background sampler doesn't work when layer's alpha coef is not zero

    As the title said, if an object (not layer) has been attached a shader with background sampler, and the object is in a layer which’s index is greater than 1, when changing the alpha coef of this layer by layer object, object’s shader's effect will disappear. Or to be more specific, background sampler will get nothing.
    The following illustration uses looki's background offset as an example, this issue happens both DX 9 and DX 11, PM enabled or not. Didn't notice such issue before, might be 294 specific, due to the changes made to support shader on other platforms.
    When layer alpha equals zero:



    Not zero:



    Note that shader without background sampler works properly. See the active diamond with matrix dot effect.

    File attached here:

    https://cdn.discordapp.com/attachmen...haderIssue.mfa

    Dot matrix shader (not needed, but also attach it here) :

    https://github.com/defisym/OpenFusio...ders/DotMatrix

    Thanks in advance.

  2. #2
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleFirefly 3D Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    1,437
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    It's kind of known, because I know people use this to make holes on a layer with Subtract effect without having to apply something to a layer, which works on HTML5 as well...

    Here's an example:
    Attached files Attached files

  3. #3
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    535
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by NaitorStudios View Post
    It's kind of known, because I know people use this to make holes on a layer with Subtract effect without having to apply something to a layer, which works on HTML5 as well...

    Here's an example:
    I'm afraid you didn't get me; I mean the case that layer's alpha != 0. The example you provided doesn't involve layer alpha blending coefficient.

  4. #4
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleFirefly 3D Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    1,437
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Let me explain...
    The mfa I've shared above only works if the layer RGB coef is set to anything other than 255,255,255 OR if Blend coef is != 0, so it might be related.

  5. #5
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    535
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by NaitorStudios View Post
    Let me explain...
    The mfa I've shared above only works if the layer RGB coef is set to anything other than 255,255,255 OR if Blend coef is != 0, so it might be related.
    So…according to your explanation, Fusion is not rendering layers offsreen? That's could explain why no backdrop sampled, but it's contradict with layer shaders…

  6. #6
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleFirefly 3D Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    1,437
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Well, I'm not sure, but something changes whenever Blend/RGB coef is set... And I might be intentional, maybe @Yves know the reason

  7. #7
    Clicker Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Dec 2017
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've noticed this a while ago with the Perspective object. When you have an object that samples the background on a layer with an effect/RGBA coeff, the object will only use the background of that specific layer.

    When you apply an effect/RGBA coeff to a layer, Fusion will render all of the objects of that layer to a separate surface. That surface is then rendered onto the main application surface with the layer effect.

    The background texture of an object is just a copy of the main application surface, cropped to the portion of the screen occuppied by the object. If the object is in a layer with an effect though, Fusion will copy the layer surface, not the main one.

  8. #8
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    535
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Rhadamus View Post
    I've noticed this a while ago with the Perspective object. When you have an object that samples the background on a layer with an effect/RGBA coeff, the object will only use the background of that specific layer.

    When you apply an effect/RGBA coeff to a layer, Fusion will render all of the objects of that layer to a separate surface. That surface is then rendered onto the main application surface with the layer effect.

    The background texture of an object is just a copy of the main application surface, cropped to the portion of the screen occuppied by the object. If the object is in a layer with an effect though, Fusion will copy the layer surface, not the main one.
    Ah, then it make sense. Don’t know if it could be easily fixed by using current rendered backdrop before offscreen rendering, instead of using nothing.

  9. #9
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    defisym's Avatar
    Join Date
    Jun 2017
    Location
    Asia
    Posts
    535
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Bump this up…

Similar Threads

  1. Replies: 3
    Last Post: 17th November 2021, 10:20 AM
  2. Canvas Sampler Shader for Html5 Exporter
    By Gigatron in forum HTML5 Export Module 2.5
    Replies: 1
    Last Post: 1st August 2020, 06:00 AM
  3. Replies: 13
    Last Post: 30th May 2020, 12:08 PM
  4. Actives not destroying when alpha coef is invisible.
    By KookieKooker in forum Fusion 2.5
    Replies: 2
    Last Post: 16th January 2020, 08:20 AM
  5. My shader doesn't work on Win 7
    By Nobuyuki in forum Hardware Accelerated Runtime
    Replies: 2
    Last Post: 17th March 2011, 03:26 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
  •