ColorScale Filter added to shaderBlow

The ColorScale filter applys a color to the render image. You can use this filter to tint the render according to one particular color without change any material (underwater scene, night scene, fire scene) or to achieve fade-in/fade-out effect.



Features:

  • Allow to set the color to apply. Default is red.
  • Allow to set intensity of the color. Default is 0.7f. Frag shader clamps color intensity between 0 and 1.



    ColorFilter OFF









    === Usage ===

    Add a ColorScaleFilter instance to a FilterPostProccesor instance. Set color and color intensity. Then add the FilterPostProccesor instance to Application’s viewPort attribute.





    [java]

    this.fpp = new FilterPostProcessor(this.assetManager);

    this.fpp.setNumSamples(4);

    this.colorScale = new ColorScaleFilter();

    this.fpp.addFilter(this.colorScale);



    // colorScale.setFilterColor(ColorRGBA.Red.clone()); // Set Filter color

    // colorScale.setColorDensity(0.5f); // Set Color intensity (between 0 and 1);



    this.viewPort.addProcessor(this.fpp);

    [/java]



    TestCase
3 Likes

Nice start!



@H , what about extend it with Night Vision effect?

http://wtomandev.blogspot.com/2009/09/night-vision-effect.html

(Shader Library) Night Vision Post Processing Filter (GLSL) | Geeks3D



Multiply everything with green colour i.e. (0.0f, 1.0f, 0.0f) vector, for example.

Or even calculate luminance.

@mifth said:
Nice start!

@H , what about extend it with Night Vision effect?
http://wtomandev.blogspot.com/2009/09/night-vision-effect.html
http://www.geeks3d.com/20091009/shader-library-night-vision-post-processing-filter-glsl/

Multiply everything with green colour i.e. (0.0f, 1.0f, 0.0f) vector, for example.
Or even calculate luminance.

I will take a look! thanks!

Hello man! @H



I did some extensions for your cool filter.

I committed everything here: http://code.google.com/p/jmonkeyplatform-contributions/source/list



Just run the TestCase and switch 1,2,3 keys. :slight_smile:



Image:

http://i.imgur.com/naHMa.jpg

2 Likes