Page 1 of 10 123 ... LastLast
Results 1 to 20 of 198
  1. #1
    Member martinsh's Avatar
    Join Date
    Oct 2006
    Location
    valence, france
    Posts
    761

    HDR + many simple GLSL 2D Filters v2.0

    Hey
    Recently i`ve been trying to implement SSGI (screen space global illumination) and HDR (tonemapping with auto exposure) in Game Engine.

    I couldn`t get SSGI to work as BGE doesn`t have Normal Buffer yet. Otherwise it works really well.
    HDR is still work in progress, but while making it, I came up with these simple filters.




    screenshot:


    and a blend
    Few_Simple_Filters.blend


    Controls:

    1 - noise
    2 - vignette
    3 - retinex

    mouse/wasd - rotate/move camera
    mouse wheel - change retinex value
    up/down - noise amount
    left/right - vignette size

    ______________________________________________
    edit:

    HDR is here:
    HDR.blend

    It will run properly only with Blender 2.49RC3 or newer build.

    Controls: same as before.
    only now press 1 to enable HDR rendering.
    2 - noise
    3 - vignette
    4 - retinex

    screenshot showing difference in exposure:



    video, with filter in motion
    http://www.youtube.com/watch?v=8bO9enLeJig


    Luminance info is taken form 5 points close to center of the screen.
    _________________________________________________

    version 2.0

    HDR2.0.blend

    controls:
    1 - HDR
    2 - Noise
    3 - Vignette
    4 - Retinex
    5 - Gamma correction
    6 - barrel Distortion
    7 - underwater-like screen distortion
    8 - DoF with blurred depth map
    9 - DoF without blurred depth map
    0 - edge blur filter

    i - technicolor 1 Film Filter
    o - technicolor 2 Film Filter
    n - normals
    b - bloom
    l - light scattering

    z - ZX Spectrum 1
    x - ZX Spectrum 2
    r - Radial Blur
    p - BleachBypass
    j - color channel remapping with curves
    Last edited by martinsh; 04-Jul-09 at 14:31.



  2. #2
    Member B-theawsomegeek's Avatar
    Join Date
    May 2009
    Location
    the toilet...ok.. fine, utah. :P
    Posts
    117
    cool!
    nice work!
    i do voice acting, so if anybody needs a voice actor for a animation of anything im here.



    HI, don't forget to be random.... and remember, the world began and will end with cheese, your fate rests with the cheeses, its thought commands all things, like..."bom bom bom" the end of blender! (wakes up) O.O ...no...it cant be....



    To be continued.... maybe...

    CBM "rawrrrr......"



  3. #3
    That's awesome!

    I was thinking today about controlling bloom through properties,
    and the retinex filter does exactly what I wanted.

    Thanks a lot martinsh!



  4. #4
    Member Mico27's Avatar
    Join Date
    Jul 2007
    Location
    Canada, Quebec
    Posts
    605
    mm nice! so the retinex filters is like the reverse of a bloom shader right?



  5. #5
    Member martinsh's Avatar
    Join Date
    Oct 2006
    Location
    valence, france
    Posts
    761
    Well technically yes, reverse of retinex looks like a bloom. Actually that`s how i accidentally came up with retinex. But retinex itself doesn`t look like reverse of bloom .
    Reverse of bloom looks like this:



  6. #6
    Member
    Join Date
    Sep 2007
    Location
    Viņa del Mar, Chile
    Posts
    1,030
    I couldn`t get SSGI to work as BGE doesn`t have Normal Buffer yet.
    Getting it by nodes won't do if it can't be accesed by buffer? It would be like applying the filter on the material tough...

    http://blenderartists.org/forum/showthread.php?t=156301



  7. #7
    Member martinsh's Avatar
    Join Date
    Oct 2006
    Location
    valence, france
    Posts
    761
    I just finished High Dynamic Range 2D Filter.
    Done with cooperation with Mike Pan (mpan3) and Dalai Felinto (dfelinto).

    blend:
    HDR.blend
    It will run properly only with Blender 2.49RC3 or newer build.

    screenshot showing difference in exposure:



    without and with HDR enabled



    video, with filter in motion
    http://www.youtube.com/watch?v=8bO9enLeJig

    Controls: same as before.
    only now press 1 to enable HDR rendering.
    2 - noise
    3 - vignette
    4 - retinex

    Luminance info is taken form 5 points close to center of the screen.
    Last edited by martinsh; 20-May-09 at 15:31.



  8. #8
    I was joking when i said next week, but you really did it. Good job.


    Originally Posted by martinsh View Post
    I couldn`t get SSGI to work as BGE doesn`t have Normal Buffer yet.
    I don't know much about GLSL, but maybe this link could be useful for you:
    http://www.gamerendering.com/2008/09...-screen-space/



    By the way: you can bake the radiosity to texture:
    http://vi-wer.de.tl/Lightmap-Tutorial.htm

    But please use the "selected to Active"-Button in the bake panel.



  9. #9
    Member
    Join Date
    Aug 2006
    Posts
    2,010
    OOh.......MYGAD![/Janice]

    awesome! The first three works but the HDR doesn't run as it should, or not at all. It prints the full script to the console then
    ERROR: 0:36: 'pow' : no matching overloaded function found
    ERROR: 0:36 '=' : cannot convert from const float to 'noperspective 4-component vector of float'
    ERROR 0:38 'pow' : no matching overloaded function found
    ERROR 3 compilation errors. No code generated



  10. #10
    Member Ace Dragon's Avatar
    Join Date
    Feb 2006
    Location
    Wichita Kansas (USA)
    Posts
    21,943
    The work is amazing, however it produces too dark an image to be called a lighting enhancer, so I took the two lines of code that said
    Code:
     float contrast = avgL*4.0;
     float brightness = contrast*0.2;
    And changed it to
    Code:
    float contrast = avgL*2;
    float brightness = contrast*0.23;
    The new values are underlined, and are specifically for allowing the 2D filter to produce a reasonably bright image so as to enhance the atmosphere provided by the current lighting instead of darkening the scene significantly.

    To everyone reading, these two values are all you need for lots of darkness/brightness/contrast variation provided by this filter and you don't really need to be a programmer just to change a couple of numbers.
    Sweet Dragon dreams, lovely Dragon kisses, gorgeous Dragon hugs. How sweet would life be to romp with Dragons, teasing you with their fire and you being in their games, perhaps they can even turn you into one as well.
    Need Cycles materials / node setups: Get them here



  11. #11
    Member gomer's Avatar
    Join Date
    Dec 2004
    Location
    canada
    Posts
    509
    Doesn't seem to work on ATI card.

    Heres a full copy of the error that gets printed: http://www.pasteall.org/5669/text

    It's the same error as the one Sim88 had.



  12. #12
    Looks awesome, they are make magic!



  13. #13
    Member vitorbalbio's Avatar
    Join Date
    Nov 2008
    Location
    Rio de Janeio - Brasil
    Posts
    1,100
    Fantastic Martinsh!!!!
    Absolutaly Amazing!



  14. #14
    wow great work!! many thanx
    dreams come true to BGE



  15. #15
    Member +peter's Avatar
    Join Date
    Mar 2007
    Location
    Ibaraki, Japan
    Posts
    268
    Originally Posted by gomer View Post
    Doesn't seem to work on ATI card.

    Heres a full copy of the error that gets printed: http://www.pasteall.org/5669/text

    It's the same error as the one Sim88 had.
    Same here.
    BLA ... stupid ATI card



  16. #16
    Member mziskandar's Avatar
    Join Date
    Nov 2008
    Location
    Malaysia
    Posts
    359
    Originally Posted by +peter View Post
    Same here.
    BLA ... stupid ATI card
    Joining you with 9600xt
    Not working..
    Visit my Realtime 3D Projects http://digitalspine.blogspot.com



  17. #17
    WOW!!!! It keeps getting better and better!!!



  18. #18
    Member martinsh's Avatar
    Join Date
    Oct 2006
    Location
    valence, france
    Posts
    761
    Here is HDR that should work also on ATI cards. It is without bloom, but you can enable it with retinex filter separately.

    HDR1.3.blend



  19. #19
    martinsh can you look at problematics of tone and gamma corrections and introduce some 2d filter for it please?
    would be nice to have gamma corrected BGE output... it's easier to make more photorealistic look (altought if one want use it it will introduce use of linearized colors for materials/textures.. but who cares it's just one more step to do in gimp)

    see here:
    what's going on - http://www.ypoart.com/tutorials/tone/index.php
    thread about it using composite nodes on render output - http://blenderartists.org/forum/showthread.php?t=119205

    here is your hdr1.jpg with tone and gamma correction to see difference
    Attached Images Attached Images



  20. #20
    This is amazing!

    I remmember previously looking at this, when you had the reflection mirror objects, you used mouse.py to allow the mouse to freely move the camera, you wouldnt happen to have a link to a tutorial for that would you?



Page 1 of 10 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •