User Tag List

Results 1 to 9 of 9

Thread: Blend mode: subtract darkness effect.

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

    Join Date
    Oct 2021
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Blend mode: subtract darkness effect.

    Hey there clickers!

    Does anyone know of a good way to do darkness, different from mine?

    I have a day-and-night cycle, with a fading darkness layer. The darkness object covers the entire screen and is set to not follow frame.
    I use subtract, and then inside the layer I have another object that subtracts from the darkness object, which works as a flashlight.
    To avoid any jagged edges, the flashlight is huge and it is not possible for the flashlight object to NOT cover the screen.

    The problem is, I recently started fantasizing about having other light sources as well.
    The only way I can think of doing this is making a massive darkness layer that is entirely black and covers the entire frame, which is then subtracted from.
    The problem with this is, even though it's more efficient than covering the screen with frame sized light sources it still uses too much ram.
    My frame is 12000x12000px so even adding just a stretched black pixel, instantly uses 500Mb of ram.

    If anyone has another method of doing this, I'd love to hear. Thanks!

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

    Join Date
    Oct 2021
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It appears, that without official support for the multiply blend effect there's no good enough alternative for what I wanted to do.
    Meaning, no blend mode shader that I have found is without it's bugs.
    Here is however, what I ended up doing in case someone else is interested in this topic.

    After trying for several days straight, I have decided to drop skewable AI light sources from my project.
    Meaning the only light source in the game that can change shape with scale tweening is the players flashlight.

    However, in case someone is interested in this topic. Here is what I did:

    I downloaded photoshop blend modes (FOR FREE!) from the clickstore.
    Make a layer of darkness and set the layer blend mode to the built-in subtract mode.
    Position darkness objects in that layer with no blend mode.
    Subtract from darkness objects with Clickteams built in subtract effect, since it allows for real time scaling.
    Use photoshop multiply_as for the rest of the lightsources in the game.

    With this setup, multiply-blend objects use black for darkness deletion, and the subtract effect I used for the player uses white.

    Hope this helps someone!

  3. #3
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export 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)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    1,128
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Check these, it adds support to alpha channel to the Photoshop effects from Looki: https://clickstore.clickteam.com/photoshop_blend_modes
    I did the DX11 port for these and a few extra shaders for the pack.

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

    Join Date
    Oct 2021
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by NaitorStudios View Post
    Check these, it adds support to alpha channel to the Photoshop effects from Looki: https://clickstore.clickteam.com/photoshop_blend_modes
    I did the DX11 port for these and a few extra shaders for the pack.
    These are the ones I used. Thank you so much! It's nice to know that they will work with DX11, I'm going as far as I can with dx9, and will switch to 11 when there are no other options left, or possibly ANYWAY at final release, since my estimated development time is minimum 3 years.

  5. #5
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    14,384
    Mentioned
    279 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by MistaSub View Post
    It's nice to know that they will work with DX11, I'm going as far as I can with dx9, and will switch to 11 when there are no other options left, or possibly ANYWAY at final release, since my estimated development time is minimum 3 years.
    Hmm, IMHO if you plan to switch do DX11 at some point, then do it now rather than at the end of the project where you might discover some compatibility issues between the DX9 and DX11 modes. Nowadays all machines support DX11.

  6. #6
    Clicker Multimedia Fusion 2 Developer
    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)

    Join Date
    Aug 2006
    Location
    Uppsala, Sweden
    Posts
    91
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MistaSub View Post
    The only way I can think of doing this is making a massive darkness layer that is entirely black and covers the entire frame, which is then subtracted from.
    The problem with this is, even though it's more efficient than covering the screen with frame sized light sources it still uses too much ram.
    My frame is 12000x12000px so even adding just a stretched black pixel, instantly uses 500Mb of ram.
    Have you tried stretching it by code? It shouldn't use more ram.
    (ie. Make a 12x12 black object and then scale it up at runtime using "Set scale to 1000")

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

    Join Date
    Oct 2021
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by contra View Post
    Have you tried stretching it by code? It shouldn't use more ram.
    (ie. Make a 12x12 black object and then scale it up at runtime using "Set scale to 1000")
    Wait, scaling objects at runtime doesn't use ram? That is very useful information, thank you!

  8. #8
    Clickteam Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform 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)
    BartekB's Avatar
    Join Date
    Aug 2013
    Posts
    676
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    It doesn't sound like you need a 12000x12000 object to cover the entire frame though. You should be fine with just covering the area visible through the camera/window.
    But if it's required for some reason then like contra said you can scale an object which doesn't modify the original image and so the ram stays the same.
    - BartekB, a.k.a Uppernate
    Join the Click Converse Discord! - https://discord.gg/R3WuvF3mHr

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

    Join Date
    Oct 2021
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is what I did, I tried to explain why it doesn't work. But I figured out a workaround with using the multiply-shaders from the clickstore.

Similar Threads

  1. HWA Mode SUBTRACT effect problem
    By Panchos in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 6th August 2013, 08:06 PM
  2. Surface Object Darkness Effect
    By Corlen in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 12th March 2012, 11:07 AM
  3. Subtract effect
    By Felik in forum Hardware Accelerated Runtime
    Replies: 2
    Last Post: 24th October 2011, 01:58 PM
  4. Blend Coefficient with Subtract shader
    By Nifflas in forum Hardware Accelerated Runtime
    Replies: 2
    Last Post: 3rd November 2010, 12:13 PM
  5. Darkness and Flashlight Effect
    By Sumo in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 7th February 2010, 09:54 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
  •