User Tag List

Results 1 to 7 of 7

Thread: Images And Masks?

  1. #1
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Aug 2006
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Images And Masks?

    Hi, im just wondering is it possible and if yes whats the best way to go about using images with HWA code?

    By this i mean actually loading a image for use within the code either from a location or via a MMF objects image. What im interested in doing is basically things like use a mask/alpha to control a hue effect so you have the normal image as the black part and the white areas adjust the hue depending on the brightness. Or another example would be image mixing with 2 color image inputs and then a mask/alpha to mix between them.

    I can do stuff like 2 image mixing using the alpha object etc simply but i want to do this using the HWA code if possible.

  2. #2
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Images And Masks?

    It's possible in the newer HWA builds, shaders can have image parameters to do this.

    My old normal mapping shader took a different approach, because this wasn't available. It used two objects, with the lower providing colour, and the upper having the normal map shader and being the normal map image data. The shader on the upper object then provided the shading for the lower object using the normal map image data in the upper object.

  3. #3
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Aug 2006
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Images And Masks?

    Thanks for the info, does anyone have a basic code example for this if possible with 2 images within 1 effect/shader?

  4. #4
    Clicker Fusion 2.5 DeveloperSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Images And Masks?

    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=148832#Post1488 32

  5. #5
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Aug 2006
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Images And Masks?

    Thanks, i have a few questions though

    Taking a quick look at that though that looks like it's calling from either a object/layer background though rather than loading in a image path.

    Also with the background -

    sampler2D bkd : register(s1);

    Does this mean the layer below it or everything seen below it? For example if you had 3 layers and this was used on a object on layer 3, the first had some tiles and layer 2 had some transparent overlays. Would it apply to layers 1+2 graphics or just layer 2?

    This bit is slightly confusing me also -

    If your shader accesses other images, add one sampler2D per image :

    sampler2D image1 : register(s1);
    sampler2D image2 : register(s2);
    etc.
    Where is it getting the images from? How do you set the actual path locations of a jpg or loaded image in MMF to load?

  6. #6
    Clicker Fusion 2.5 DeveloperSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Images And Masks?

    You can load an image via the "image parameter" action; plus you can specify an image file loaded on start.

    Background: Everything below.

    Each image parameter has its own sX variable.
    Just write "sampler2D imageX : register(s;", for each image parameter you specify, X being the index starting with 1.
    Note: If BackgroundTexture is set, s1 will feature the background layer, and s2+ will feature the image parameters.

  7. #7
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Aug 2006
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Images And Masks?

    Nice, thanks for the help i will try this

Similar Threads

  1. Collision Masks for every object?
    By Alves in forum Multimedia Fusion 2 - Technical Support
    Replies: 13
    Last Post: 17th January 2010, 11:53 AM
  2. Collision Masks?
    By Atherton in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 25th June 2009, 05:43 PM
  3. Alpha masks
    By uprize in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 11th February 2009, 11:36 PM
  4. Messing with collision masks
    By Ben2theEdge in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 7th January 2007, 03:32 PM
  5. Alpha masks in animations
    By Tinnysp1n in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 27th December 2006, 05:49 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
  •