Old Film Effect filter

Home Forum Development User Code & Projects Old Film Effect filter

This topic contains 20 replies, has 10 voices, and was last updated by  H 1 year, 8 months ago.

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • #206547
    +9

    H
    105p
    Participant

    Old Film filter simulate the effect of a classic looking film effect. It’s a port of this shader effect.

    This filter is part of ShaderBlow plugin lib.

    Features:
    * Allow to set the filter’s color. Default is sepia (ColorRGBA(112f / 255f, 66f / 255f, 20f / 255f, 1.0f)).
    * Allow to set the color’s density. Default is 0.7. Shader clamps this value between 0 to 1. The color image gets grayscale when color’s densite is set to 0.
    * Allow to set the noise’s density. Default is 0.4. Shader clamps this value between 0 to 1.
    * Allow to set the scratches’ density. Default is 0.3. Shader clamps this value between 0 to 1.
    * Allow to set the vignetting’s diameter. Default is 0.9. Shader clamps this value between 0 to 1.4. Vignetting effect is made using two circles. The inner circle represents the region untouched by vignetting. The region between the inner and outer circle represent the area where vignetting starts to take place, which is a gradual fade to black from the inner to outer ring. Any part of the frame outside of the outer ring would be completely black.

    NOTE: I chose to clamp this value inside the frag shader code instead of using java code because I thought this way is faster (better from preformace point of view). You can clamp this values using java code if you want.

    The following video shows all the features. First I turned off and on the filter. Then I played a little bit with turning down and up color’s density, noise’s density and scratches’ density. Finally I decreased and increased the vignetting diameter.

    [video]http://www.youtube.com/watch?v=CgFzhkq-MKk[/video]

    Test Case

    Hope you like it!

    #206558

    nehon
    1873p
    Keymaster

    Very nice, good work

    #206559

    Normen Hansen
    2792p
    Keymaster

    Nice stuff, I like that the scratches seem to be procedural (?)

    #206562

    H
    105p
    Participant

    @nehon said:
    Very nice, good work

    Thanks!!

    @normen said:
    Nice stuff, I like that the scratches seem to be procedural (?)

    Thanks!!
    Yes, noise, scratches and vignetting are procedural.

    #206570

    kwando
    264p
    Keymaster

    Nice work! =)

    #206573

    t0neg0d
    1227p
    Participant

    This is really cool stuff!

    #206589

    Wesley Shillingford
    834p
    Participant

    if jME existed in the 50’s, nice!

    #206590

    mifth
    359p
    Participant

    Hey! @H you did really cool filter! I love it a lot!!!!! Certainly need to use it!
    The only feature I would like to see is “animation speed” of noise. At present, speed is hardcoded.

    #206601

    t0neg0d
    1227p
    Participant

    @wezrule said:
    if jME existed in the 50’s, nice!

    I think you mean 30’s… otherwise the filter would come with old style red/blue 3d glasses ;)

    #206658

    H
    105p
    Participant

    @kwando, @t0neg0d and @wezrule,
    Thanks!!

    @mifth said:
    Hey! @H you did really cool filter! I love it a lot!!!!! Certainly need to use it!
    The only feature I would like to see is “animation speed” of noise. At present, speed is hardcoded.

    Thanks!! I will take a look but I’m not sure which part of the noise’s calculations/formula handles the noise’s animation speed. I think noise’s animation speed is related with frameRate, I mean it is not part of the calculations.

    #206660

    mifth
    359p
    Participant

    @H said:
    @kwando, @t0neg0d and @wezrule,
    Thanks!!

    Thanks!! I will take a look but I’m not sure which part of the noise’s calculations/formula handles the noise’s animation speed. I think noise’s animation speed is related with frameRate, I mean it is not part of the calculations.

    I will help you if you don’t find it. Just write here or to my skype if you will need some help. :)

    #206823

    mifth
    359p
    Participant

    @H , I tried to run the filter but had an exception.

    LOG:
    мар 03, 2013 9:38:44 AM com.jme3.scene.Node attachChild
    INFO: Child (BitmapFont) attached to this node (null)
    мар 03, 2013 9:38:44 AM com.jme3.scene.Node attachChild
    INFO: Child (null) attached to this node (Statistics View)
    мар 03, 2013 9:38:44 AM com.jme3.scene.Node attachChild
    INFO: Child (Statistics View) attached to this node (Gui Node)
    мар 03, 2013 9:38:44 AM com.jme3.scene.Node attachChild
    INFO: Child (StatsDarken) attached to this node (Gui Node)
    мар 03, 2013 9:38:44 AM com.jme3.scene.Node attachChild
    INFO: Child (StatsDarken) attached to this node (Gui Node)
    мар 03, 2013 9:38:45 AM com.jme3.material.MaterialDef
    INFO: Loaded material definition: ColorScale
    мар 03, 2013 9:38:45 AM com.jme3.app.Application handleError
    SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
    java.lang.IllegalArgumentException: Material parameter is not defined: InnerVignetting
    at com.jme3.material.Material.checkSetParam(Material.java:444)
    at com.jme3.material.Material.setParam(Material.java:460)
    at com.jme3.material.Material.setFloat(Material.java:601)
    at com.shaderblow.filter.oldfilm.OldFilmFilter.initFilter(OldFilmFilter.java:152)
    at com.jme3.post.Filter.init(Filter.java:234)
    at com.jme3.post.FilterPostProcessor.initFilter(FilterPostProcessor.java:168)
    at com.jme3.post.FilterPostProcessor.reshape(FilterPostProcessor.java:442)
    at com.jme3.post.FilterPostProcessor.initialize(FilterPostProcessor.java:149)
    at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:955)
    at com.jme3.renderer.RenderManager.render(RenderManager.java:1029)
    at com.jme3.app.SimpleApplication.update(SimpleApplication.java:252)
    at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
    at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)
    at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:228)
    at java.lang.Thread.run(Thread.java:722)

    #206834

    Erlend Sogge Heggen
    504p
    Keymaster

    Excellent. I had already pointed this one out to @sploreg for possible use in AotGB.

    #206854

    H
    105p
    Participant

    @mifth said:
    @H , I tried to run the filter but had an exception.

    LOG:
    мар 03, 2013 9:38:44 AM com.jme3.scene.Node attachChild
    INFO: Child (BitmapFont) attached to this node (null)
    мар 03, 2013 9:38:44 AM com.jme3.scene.Node attachChild
    INFO: Child (null) attached to this node (Statistics View)
    мар 03, 2013 9:38:44 AM com.jme3.scene.Node attachChild
    INFO: Child (Statistics View) attached to this node (Gui Node)
    мар 03, 2013 9:38:44 AM com.jme3.scene.Node attachChild
    INFO: Child (StatsDarken) attached to this node (Gui Node)
    мар 03, 2013 9:38:44 AM com.jme3.scene.Node attachChild
    INFO: Child (StatsDarken) attached to this node (Gui Node)
    мар 03, 2013 9:38:45 AM com.jme3.material.MaterialDef
    INFO: Loaded material definition: ColorScale
    мар 03, 2013 9:38:45 AM com.jme3.app.Application handleError
    SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
    java.lang.IllegalArgumentException: Material parameter is not defined: InnerVignetting
    at com.jme3.material.Material.checkSetParam(Material.java:444)
    at com.jme3.material.Material.setParam(Material.java:460)
    at com.jme3.material.Material.setFloat(Material.java:601)
    at com.shaderblow.filter.oldfilm.OldFilmFilter.initFilter(OldFilmFilter.java:152)
    at com.jme3.post.Filter.init(Filter.java:234)
    at com.jme3.post.FilterPostProcessor.initFilter(FilterPostProcessor.java:168)
    at com.jme3.post.FilterPostProcessor.reshape(FilterPostProcessor.java:442)
    at com.jme3.post.FilterPostProcessor.initialize(FilterPostProcessor.java:149)
    at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:955)
    at com.jme3.renderer.RenderManager.render(RenderManager.java:1029)
    at com.jme3.app.SimpleApplication.update(SimpleApplication.java:252)
    at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
    at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)
    at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:228)
    at java.lang.Thread.run(Thread.java:722)

    I’ve ran TestOldFilm class and all have worked fine. Did you run the test or did you try to use the filter on another project?
    If you ran the TestOldFilm test, please make sure that you update all the files (shaders, material def, etc).
    If you tried on onother project (using shaderblow plugin), please build a test case.

    #206855

    H
    105p
    Participant

    @erlend_sh said:
    Excellent. I had already pointed this one out to @sploreg for possible use in AotGB.

    What does AoTGB mean? just curious XD

Viewing 15 posts - 1 through 15 (of 21 total)

You must be logged in to reply to this topic.