User Tag List

Results 1 to 3 of 3

Thread: Reflection (Background) Shader

  1. #1
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,540
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Reflection (Background) Shader

    This is a fairly simple shader I created in response to this thread:
    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=190757#Post1907 57


    Unfortunately, I do not know how to create a background shader that uses alpha blending to blend with the same background. This merely reflects the background- but thats still pretty handy.

    If anyone with the technical knowledge knows how to blend a background (ie to make this object semitransparent) please, feel free to alter this shader and post it up!


    Parameters:
    fCoeff:
    Ratio of 0.0 to 1.0 of the image to be reflected. Only one side of this line will be reflected, proportional to how far down it is- in the exact middle (0.5), it creates a 1:1 reflection, whereas at say 0.75, it will be a 3:1 reflection
    Mode:
    Changes the direction of the reflection.
    0 = Bottom
    1 = Top
    2 = Left
    3 = Right


    Example screenshot:




    (Put the effects in your "MMF2/Effect" folder, and then you can access them inside your project. You will need to put the effects in that folder in order to open the example file)
    Attached files Attached files

  2. #2
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,540
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Reflection (Background) Shader

    With the help of Looki, I've updated this shader:
    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=191331#Post1913 31

    It nows has an additional parameter, fBlend
    This is a value from 0.0 to 1.0
    0.0 = Fully Opaque (all reflection)
    1.0 = Fully Transparent (no visible effect)


    This allows it to render semitransparent backgrounds, making it perfect for 'water' effects in a game- simply use an object overlaying the water, and give it this effect.



    Updated Download is attached
    This has been edited since V2
    Now reflects Dyna's code from the post below
    Attached files Attached files

  3. #3
    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: Reflection (Background) Shader

    Erm, Dynasoft actually provided a better way to do this.

    You don't need the Src/Dest stuff, just do
    return float4(tex2D(bg,In).rgb,fAlpha);

Similar Threads

  1. Horizon reflection
    By EdibleWare in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 10th January 2011, 10:35 PM
  2. car reflection effect
    By thewreck in forum File Archive
    Replies: 13
    Last Post: 12th February 2007, 07:39 PM
  3. Water reflection
    By AsparagusTrev in forum File Archive
    Replies: 16
    Last Post: 6th November 2006, 09: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
  •