User Tag List

Results 1 to 6 of 6

Thread: Overlapping shadows shader options?

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    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)
    DaveC's Avatar
    Join Date
    Jun 2007
    Location
    Perth, Australia
    Posts
    2,112
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)

    Overlapping shadows shader options?

    Hey everyone!

    So in my game, I have loads of objects that spawn and they have their own shadows.. the shadow is simply a seperate object paired to the parent object.. currently it uses the basic semi-transparency effect.. it's fine in isolation, but when many shadows overlap, it gets darker and darker.. what I want is for the shadows to be transparent but to not get any darker.. to stay the same level of darkness no matter how many objects overlap.

    I suspect there is probably a shader for this, so I'm asking here if anyone can tell me where it's at? Thanks in advance!


  2. #2
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,305
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Nope. The only solution would be to put the shadows on a separate layer and apply a multiply or subtract shader effect to the layer - but then you'd need at least three layers (backgrounds / shadows / foreground objects), which seems like a fair amount of hassle for a simple effect, but maybe it's worth it?

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    Another option, you could use the Surface Object as a screen-wide layer of "shadows" (set color/set opacity of pixels).
    Assuming the shadows are static (or mostly static), otherwise it might become quite awkward to handle and probably not efficient enough.

    Perhaps a shader could be made for the purpose, it would need to be applied to all objects, and:
    1) sample the background, don't draw shadow if color is different from (background texture at that position)
    or
    2) use the "depth buffer" to assign apt depth values (i.e. Y position of the pixel + ID/1000.0) to the shadow and so avoid drawing multiple times on the same spot

    Or simpler: a single shader, covering the whole screen, where shadows locations are sent through fake objects (your current shadows) painted in a palette of specific colors you don't use elsewhere; when the shader finds the colors, it replaces them with a darkened version of the background texture (so you'd need to feed a background texture to the shader).

    There might be other ideas too...

    Surface object, if applicable, or multilayer with multiply/subtract effects as Muddymole suggests are probably the simplest approach though

  4. #4
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    643
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    I used @schrodinger 's idea of the surface object, but instead of setting opacity of pixels i just made the whole surface object semi-transparent: merged shadows.mfa

    if you needed custom shadow shapes instead of a generic ellipse, you could also just use the "blit" feature of the surface object to paste an image.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    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)
    DaveC's Avatar
    Join Date
    Jun 2007
    Location
    Perth, Australia
    Posts
    2,112
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    hmm thanks for the feedback... it might be a bit too much hassle for such a minor effect.. I'll experiment with your idea MuddyMole.. my game already has quite a few layers as it is.. so a couple more may not hurt..

  6. #6
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    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
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,037
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    you may have to just do a solid shadow that's a bit darker than the floor. that's if its not a huge deal. ... you may want to animate the shadow if you are going anal on it tho.

Similar Threads

  1. Replies: 0
    Last Post: 7th October 2016, 04:07 AM
  2. Rob The Shadows (WIP)
    By aenever in forum WIP & Released Games & Apps
    Replies: 8
    Last Post: 27th July 2016, 07:56 AM
  3. Replies: 2
    Last Post: 24th January 2014, 04:14 PM
  4. Shadows like in Nox
    By qenio in forum Hardware Accelerated Runtime
    Replies: 3
    Last Post: 2nd December 2009, 09:43 PM
  5. Shadows
    By AusZero in forum The Games Factory 2 - Technical Support
    Replies: 3
    Last Post: 4th February 2007, 11:58 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
  •