User Tag List

Results 1 to 8 of 8

Thread: [Request] Dithered alpha effect.

  1. #1
    Clicker Fusion 2.5 Developer

    Join Date
    Jan 2013
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question [Request] Dithered alpha effect.

    The Sega Saturn hardware was limited in certain ways so if you tried to use traditional alpha blending it would end up eating any sprites underneath the effect. The alternative to this was that the hardware had the built in option to dither sprites to achieve a similar look since on a CRT TV it would blend and be hard to recognize. The dithering pattern was consistent on screen and it wasn't just manually drawn onto sprites.

    What I'm wondering is if a shader could be written so when applied to an active object it'd achieve an effect like this:

    http://i.imgur.com/5YB54ZK.gif
    Attached thumbnails Attached thumbnails Click image for larger version. 

Name:	ditheredalphaexample.jpg‎ 
Views:	159 
Size:	7.0 KB 
ID:	20101  

  2. #2
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,300
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Yes, that could be done very easily.
    The main hassle is that it would need to know the size of the object, so if it were an animated sprite you'd need to keep passing the new dimensions every time the animation frame changed (unless they're all the same size).
    On a semi-related note, I did a few experiments with dithering a while back: http://create-games.com/forum_post.asp?id=300740 (I know it's not what you want)

  3. #3
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,300
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    I was feeling kind, so I made a shader...



    It simulates alpha channel transparency using uniform dithering - potentially useful if you want quick and easy fading/transparency effects in a retro styled game, where the real thing would look too modern and out of place.

    Opacity can vary in increments of 1/8th, and can use the object's own alpha channel (eg. if the object is to fade gradually at the edges), or a single adjustable value (eg. if the whole object is to fade over time), or a combination of the two.

    Download: https://onedrive.live.com/redir?resi...int=file%2czip

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jun 2006
    Location
    St. Ave France
    Posts
    1,120
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Awesome work!

  5. #5
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,300
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Thanks
    I've fixed a bug with 50% dithering, so it now looks much smoother (also renamed it to "AlphaDither" to avoid clashing with a previous dithering shader I made).

    Download: https://onedrive.live.com/redir?resi...int=file%2czip


  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)
    That's a cool shader One thing I've noticed (like in chrilley's thread) is that you don't need the width/height parameters. MMF automatically passes the width/height of a pixel to the variables fPixelWidth and fPixelHeight if you declare them in your code (as floats, outside of the main function). Just take the reciprocal to get the image size!

  7. #7
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,300
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Thanks - I wasn't aware of that, but it's good to know Guess I have quite a few shaders I need to go back and modify...

  8. #8
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,300
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    I've been playing around with dithering techniques some more, and decided to make a new and improved version of my AlphaDither shader.
    Download: http://1drv.ms/u/s!Atq7cUIJ7uexiRe1GgrJ1hVsVkgU

    There are two key differences:
    * You no longer need to specify the image width & height (thanks Looki) - the only parameter is "multiplier" which multiplies the image's own alpha
    * It now allows for 64 levels of transparency, which gives much smoother results than the previous version, which only allowed for 8

    Enjoy

Similar Threads

  1. [Request] Alpha Threshold shader
    By Fuuriokun in forum Shader Development
    Replies: 2
    Last Post: 6th October 2016, 04:01 PM
  2. One for Yves: Alpha with effect applied to layer
    By BaconUk in forum Hardware Accelerated Runtime
    Replies: 17
    Last Post: 10th March 2013, 08:16 AM
  3. [Request] Alpha Text Object
    By Pkeod in forum Extension Development
    Replies: 56
    Last Post: 27th November 2009, 04:56 AM
  4. [Request] Text Blitter with Alpha
    By aidmm in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 31st January 2008, 03:30 PM
  5. Is add ink effect faster than alpha-blended
    By BrashMonkey in forum Multimedia Fusion 2 - Technical Support
    Replies: 17
    Last Post: 12th July 2006, 01:58 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
  •