[XP]Character Shaders

Character Shaders Version: 0.9
By: theory (and misc.)

Introduction

This script does what it says. Allows you to apply shaders to characters. At the moment, it only handles the player. An update, soon, will allow applying shaders to any character. It comes preloaded with a collection of shaders I put together. I can't take credit for the shader designs, simply making them work in RGSS and attaching them to the character. There are 23 shaders included.

Features
  • Soften, Sharpen, Contrast, Negative, Alien, Undead, and many more shaders.
  • Stackable effects- you are not limited to a single shader.
  • Can reset at any time.

Screenshots

Image
Image

Demo

http://www.mediafire.com/file/yzmmdnd2tny/Character%20Shaders.rar

Instructions

Set $shader to the number of the shader that you would like to use, and call Character_Shader.new()

Compatibility

The only thing modified is Scene_Map and an attr_reader is added to SpriteSet_Map, but this shouldn't interfere with anything.

Credits and Thanks

Glitch - For helping me access the player bitmap
The author of Free Window - I used it in the demo. Can't translate that name...
Random sources of information regarding image filters in Ruby.

Author's Notes

As it stands, if you start exit to title screen, it still keeps the shader active into a different game. Pressing F12 clears it, or just copy the contents of the Reset method into the beginning of Scene_Title.
Have you implemented the shading so it can be used in scripts/events? Of are you leaving that to the people who use this script?

Anyway, I'm glad you got this posted. And why am I credited for syntax suggestions? All I did was tell you how to access the character bitmap.

Finally, didn't you also add a line of code to Spriteset_Map, to make the character bitmap accessible? You said that all you modded was Scene_Map.
Nice script. Sepia and silhouette will be useful :)
A small error I noticed: in Silhouette random points become white instead of black.
Yeah, silhouhette isn't perfect yet. I'm working on an update that can apply it to any event, as well as a shader pack that uses external images to add a true shader (fire, ice, stone, etc.). I'll see what I can do about fixing shillouette.
Fixed the Silhouette shader. Replace shader_sill with this one:
Content Hidden Spoiler
  1.  
  2.   def shader_sill
  3.      ra = 500
  4.      re = 0 ; gr = 0 ; bl = 0
  5.      for i in 1..(@bitmap.height-1)
  6.         for j in 1..(@bitmap.width-1)                                             
  7.            for m in -1..1
  8.               for n in -1..1
  9.                  if m != 0 and n != 0
  10.                     a = @bitmap.get_pixel(j+m,i+n)
  11.                     re = re + a.red
  12.                     gr = gr + a.green
  13.                     bl = bl + a.blue
  14.                  end   
  15.               end
  16.            end
  17.            b = @bitmap.get_pixel(j,i)
  18.            re = (b.red-re/8).abs
  19.            gr = (b.green-gr/8).abs
  20.            bl = (b.blue-bl/8).abs
  21.            @bitmap.set_pixel(j,i,Color.new(0, 0, 0, b.alpha) )
  22.         end   
  23.      end               
  24.   end
  25.  
Expand to see the code.
The link is down, for some reason.
CERU wrote:
The link is down, for some reason.


The link works just fine for me. Are you sure you can access mediafire where you are?
Huh, that's odd. I'm not credited here. I help you figure out how to reload a cached bitmap, and I'm not credited, even mentioned anywhere. But other than that, great work theory :thumb:
I checked with a friend (out of state) and he couldn't open the link either.

Now it's back up and I can access it. Odd. I had downloaded from mediafire this morning (before clicking this link), anyways.

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=64607