User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 20

Thread: Depth Mask Shaderor another solution?

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleMac Export Module

    Join Date
    Sep 2006
    Location
    UK
    Posts
    842
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Depth Mask Shaderor another solution?

    Hi, I was wondering if it is possible to use have a shader that modifies an active such as its brightness, but based on a mask (that is invisible to the screen?)

    If not is there any other way of doing this without hindering performance?

    Thanks

  2. #2
    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)
    pretty sure it's possible with a shader,
    but don't know if such a shader already exists,
    have you looked around i.e. among Looki's and Sphax shaders?

    If it does not exist and nobody picks this up,
    I could make it (when I find a spot ),
    should be pretty quick but please specify what you need in detail:

    1) modify an active brightness -- ok

    2) based on a mask -->
    some mixed thoughts:

    a) you would provide a mask same "box" size as the active current animation frame?
    This is mostly important if your graphics are pixel-art style

    b) is it a single mask or do you need to load different masks while the animation plays?

    c) can you sacrifice the alpha channel of the active animation?
    If so, you could use it as the brightness mask for the shader, so you won't have extra image parameters to feed the shader,
    and you could easily modify/animate the mask directly from the animation editor if needed.

  3. #3
    Clicker 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)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,237
    Mentioned
    85 Post(s)
    Tagged
    0 Thread(s)
    What about just something like this? It's not quite a mask as much as a 'pre-baked' mask, I guess. Does the trick, though, unless you need something more procedural (eg. moving the mask to affect different parts of the active at random)
    Attached files Attached files

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleMac Export Module

    Join Date
    Sep 2006
    Location
    UK
    Posts
    842
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Volnaiskra View Post
    What about just something like this? It's not quite a mask as much as a 'pre-baked' mask, I guess. Does the trick, though, unless you need something more procedural (eg. moving the mask to affect different parts of the active at random)
    Thanks but unfortunatly thats not quite what im after, i will try to explain further...

    I basically want to have an active or image that I move with mouse/touch where the brightness of individual pixels are decided by a mask or black and white image thats not visible to the screen.

    A simple example, if the mask is full screen half white half black (would normally be more complex than this) that is not visible to the user, and I then have the active in the white section, as I move it over to the black all the pixels that are over the black part of the mask will be brighter.

    Quote Originally Posted by schrodinger View Post
    pretty sure it's possible with a shader,
    but don't know if such a shader already exists,
    have you looked around i.e. among Looki's and Sphax shaders?

    If it does not exist and nobody picks this up,
    I could make it (when I find a spot ),
    should be pretty quick but please specify what you need in detail:

    1) modify an active brightness -- ok

    2) based on a mask -->
    some mixed thoughts:

    a) you would provide a mask same "box" size as the active current animation frame?
    This is mostly important if your graphics are pixel-art style

    b) is it a single mask or do you need to load different masks while the animation plays?

    c) can you sacrifice the alpha channel of the active animation?
    If so, you could use it as the brightness mask for the shader, so you won't have extra image parameters to feed the shader,
    and you could easily modify/animate the mask directly from the animation editor if needed.
    Thats great if you could, however after doing some research im not sure its possble at all, correct me if im wrong but shaders in clickteam cannot have an image assigned to them? (which would be my mask?) Maybe a layer?

    The mask will be the same size as the frame.

    Mask could be static, no animation.

    Unfortunately the active would needs its alpha channel.

    Thanks

  5. #5
    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)
    Yes you can feed a "image" parameter to a shader,
    both in edit-time (shaders with "image" parameters will appear with a "edit" button where you can load an image through the animation editor)
    and in runtime (by loading an image file through the "effect" - "set effect image parameter")

    Though I'm still not sure I understand completely your needs:
    this mask will be applied to all active objects in a layer?
    Perhaps you could apply this mask to the layer itself?
    Or will actives have individual different masks? (or there will be objects NOT processed by the mask, such as backgrounds etc., so you would anyway need to "tell" some objects from the others and having it on a layer could be a problem)

    And this mask will ONLY change the brightness of actives,
    basing on the mask's own brightness (i.e. how much white/black)
    right?

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleMac Export Module

    Join Date
    Sep 2006
    Location
    UK
    Posts
    842
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by schrodinger View Post
    Yes you can feed a "image" parameter to a shader,
    both in edit-time (shaders with "image" parameters will appear with a "edit" button where you can load an image through the animation editor)
    and in runtime (by loading an image file through the "effect" - "set effect image parameter")

    Though I'm still not sure I understand completely your needs:
    this mask will be applied to all active objects in a layer?
    Perhaps you could apply this mask to the layer itself?
    Or will actives have individual different masks? (or there will be objects NOT processed by the mask, such as backgrounds etc., so you would anyway need to "tell" some objects from the others and having it on a layer could be a problem)

    And this mask will ONLY change the brightness of actives,
    basing on the mask's own brightness (i.e. how much white/black)
    right?
    Ahh cool, ok didnt know that.

    It is a difficult one to explain, but yes you are close with what you have asked.

    From my idea initially there will be 3 "components", a background image, an active object and then a "mask" image which isnt visible to the user. The mask image is a "grey scale" image of the background, the active objects pixels brighness changes depending on how it moves over the masked image. Does this make any more sense?

    So although the "mask" image isnt visible, the active object uses the mask's data to determine its pixels brightness.

    The background image should be uneffect by all this.

    Can the shader applied to an active object, get data from a "layer", but have that layer invisible?

    Thanks
    andy

  7. #7
    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)
    I think I'm close to understanding your needs,
    but perhaps if you could provide a picture mockup it would be the icing on the cake

    Can the shader applied to an active object, get data from a "layer", but have that layer invisible?
    I think not, but I'm confident we can find some workaround.

    The thing I'm most confused with now is how you'd like to interact with this mask,
    if you can feed a picture to the shader (same size as the frame right?) then no problem,
    but perhaps you want to feed it a layer's background or something? ("get the data from a layer")
    (...or maybe you said this just because I was suggesting to use the whole layer in previous post.. sorry if I'm adding entropy to the thread )

    Also, will there be scrolling involved? (tha application window will be smaller than the frame area?)

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleMac Export Module

    Join Date
    Sep 2006
    Location
    UK
    Posts
    842
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by schrodinger View Post
    I think I'm close to understanding your needs,
    but perhaps if you could provide a picture mockup it would be the icing on the cake



    I think not, but I'm confident we can find some workaround.

    The thing I'm most confused with now is how you'd like to interact with this mask,
    if you can feed a picture to the shader (same size as the frame right?) then no problem,
    but perhaps you want to feed it a layer's background or something? ("get the data from a layer")
    (...or maybe you said this just because I was suggesting to use the whole layer in previous post.. sorry if I'm adding entropy to the thread )

    Also, will there be scrolling involved? (tha application window will be smaller than the frame area?)

    Well, im not to sure how it would work myself having not much shader dev experience, the reason i mentioned layers is because if you feed an a greyscale image to an active's shader, how does the active object know its moving over that greyscale image? I basically need the greyscale image to act like a static image at pos 0,0 and do nothing, then as the active object moves over it, its pixels brightness change depending on how black or white that greyscale image is. But I guess the trick is, having all that but not having the greyscale image visible, which is why I though using a shader might be possible.

    If that doesnt make sense I will try to make an image to explain.

  9. #9
    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)
    Ok I think it makes sense
    enough talk let's try to code it, is it something like this?

    brightness_map.zip

    (you should see the brightness map clicking in the b_map edit button inside object's display properties)

    simple instructions on how to use in top row of the code

  10. #10
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleMac Export Module

    Join Date
    Sep 2006
    Location
    UK
    Posts
    842
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wowsers! That was fast and from initial looks its great!

    Let me just do some little testing and ill get back to, but much appreciated and amazing work!

    Thanks
    Andy

Page 1 of 2 1 2 LastLast

Similar Threads

  1. 2D depth like rpg maker?
    By GamerH2 in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 29th January 2016, 08:59 PM
  2. How do I make such depth with layers?
    By Emerson3 in forum Fusion 2.5
    Replies: 7
    Last Post: 5th May 2015, 03:14 PM
  3. Depth VR need your suggestion!
    By VRdepth in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 26th April 2014, 02:24 AM
  4. How can I change the depth of an object?
    By emberjed in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 6th October 2012, 10:18 PM
  5. Depth?
    By Storsorgen in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 13th May 2012, 11:07 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
  •