User Tag List

Results 1 to 8 of 8

Thread: Easy Blend - Make your own shaders without code!

  1. #1
    No Products Registered

    Join Date
    Sep 2007
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Easy Blend - Make your own shaders without code!

    Hello!

    This shader sprung from an idea given to solve the problem "How can I implement a XOR effect in MMF using HWA?". Well, obviously, bitwise operators weren't available until Shader Model 4.0, so that was right out of the question. Instead, a friend suggested implementing a XOR lookup table, and converting channel values to integer using the smoothstep() function.

    I soon realized that implementing the table as a texture allowed me to use floating point values instead, with an arbitrary channel bit-depth accuracy (!), and furthermore, as a side effect of implementing the lookup table as a texture, any generic texture could be used as a lookup table, essentially making this a generic shader for pretty much any simple expression blend mode.

    What does this mean for you? It means that you no longer have to write or use separate shaders to implement a myriad of blend modes into your application; simply use Easy Blend for pretty much everything, and never worry about shader incompatibilities between people again. What's more, anyone can create a blend mode for a shader now -- all they have to do is open up their favorite image editor, and play around. Or, generate a texture algorithmically using the Surface Object, or whatever you want!

    In my example, I've included a set of common blends you can try out for yourself. The simple explanation for how the blends work is: the X axis represents the background color on the channel specified, whereas the Y axis represents the foreground. The shader looks at that (x,y) location and retrieves the output intensity from the channel specified. You can have seperate intensities for each color channel for the ultimate tweaking! Or, just stick with grayscale for more traditional blend modes. The choice is up to you; the possibilities are endless! :grin:

    Screenshot (using Screen blending):
    Attached files Attached files

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

    Re: Easy Blend - Make your own shaders without code!

    Very nice work This is pretty ingenious.

  3. #3
    No Products Registered

    Join Date
    Sep 2007
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Easy Blend - Make your own shaders without code!

    I've added some new blends to demonstrate some more functionality of Easy Blend. Here are their explanations:

    StainedGlass: this is actually the converse of Subtract. Whereas Subtract subtracts the foreground from the background, StainedGlass subtracts the background from the foreground. The effect it creates is what most people are familiar with in terms of Subtraction effects from the SNES days -- The appearance of stained glass.

    0percent_trans - 100percent_trans: These blends are a proof-of-concept to demonstrate how you can incorporate alpha compositing into an Easy Blend. Since each axis incorporates one of the composited components, by always expressing the position in an axis as a color along its perpendicular axis, we can return a pure foreground, or a pure background. By adjusting the ratio between which axis is expressed on a given color channel, we can individually adjust that channel's alpha component between 0 and 1.

    Invert, InvertBackground: Furthermore, the return value along a particular axis can even be completely inverted. This blend demonstrates that the return value of colors can be fully inverted, resulting in the usual inverted shader, or a novel background inversion shader.


    [align=center]* * *[/align]

    In addition to these blends, I've also created a program using Surface to adjust individual color channels to create your own custom alpha color ratios. Each individual color channel's alpha can be controlled with this blend maker, as well as the ratio of additive or subtractive properties in each color channel. Originally, I wanted this to be able to demonstrate "selective alpha" blends, but unfortunately, didn't quite achieve the effect I was striving for. Instead, what I've created is a sorta color gradient maker and tint blend maker not unlike the Custom blend option in Flash. You can create some wicked cool blends with this program nonetheless, and of course can use Photoshop or GIMP to composite your blends together for even crazier results. (Or, crazier yet, use Easy Blend to composite other blends together for ultimate blend-on-blend control!!)

    [align=center][/align]
    Attached files Attached files

  4. #4
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleUnicode Add-on

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    988
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Easy Blend - Make your own shaders without code!

    Nice work! This is awesome

  5. #5
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Easy Blend - Make your own shaders without code!

    How does this work? Does it output HLSL?

  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
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Easy Blend - Make your own shaders without code!

    Erm, just look at it? It's a single effect that takes an image parameter and uses it to blend the foreground and background.

  7. #7
    Clicker Fusion 2.5iOS 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)
    SolarB's Avatar
    Join Date
    Feb 2012
    Location
    Melbourne
    Posts
    905
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Sorry but where is EzBlend.fx? I don't see it in the zip file.

  8. #8
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,006
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    Try downloading the first zip file
    Want to learn Clickteam Fusion 2.5?




Similar Threads

  1. Flipping(giant, high animated) active objects without shaders(or any better shaders?)
    By DinnerSonic in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 24th September 2013, 12:57 PM
  2. Finding specific strings or actions in the code - is there an easy way?
    By Yos in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 15th October 2012, 10:37 AM
  3. Is there an easy, direct way to make several frames use the same set of events?
    By Dalal in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 21st February 2012, 03:37 PM
  4. Invert blend
    By Looki in forum Shaders
    Replies: 0
    Last Post: 20th March 2010, 01:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •