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

    nicer and faster SSAO

    I had some spare time and inspiration from mtracer and Arkano22 and I made yet another Screen-Space Ambient Occlusion filter.
    And there is a reason why I reinvented stuff that already exists and works.
    faster - code kept as simple as possible.
    more natural - samples are gathered circularly making occlusion softer, also AO is not rendered on lit and bright areas. In real life Ambient Occlusion is noticeable only in shadows.

    Feel free to use and modify the filter..

    screenshots:





    notice the difference in bright areas, where AO makes the light look dull.


    YouTube video:
    (click on the image to view)


    glsl frag. shader: http://www.pasteall.org/12299

    blend: http://www.pasteall.org/blend/2442

    latest version - (workd for ATI hardware)
    http://www.pasteall.org/blend/2460
    or
    Attachment 103261

    controls:
    wasd+mouse - mouselook
    LMB - shoots a sphere
    1 - disables filters
    2 - ssao+tex
    3 - ssao+light
    4 - plain ssao
    Attached Files Attached Files
    Last edited by martinsh; 12-Apr-10 at 13:12.



  2. #2
    Looks more than awesome! It doesn't work for me (Ati) the only version that works is the 4th (plain) and with that I get visual errors(picture)




  3. #3
    Member martinsh's Avatar
    Join Date
    Oct 2006
    Location
    valence, france
    Posts
    761
    Originally Posted by Tohinho View Post
    Looks more than awesome! It doesn't work for me (Ati) the only version that works is the 4th (plain) and with that I get visual errors(picture)

    those visual errors look really weird..
    got any errors in console?
    for each of the filters. that could help me fix it.



  4. #4
    Member diskette's Avatar
    Join Date
    Dec 2008
    Location
    Brasil - RS
    Posts
    48
    Nice work!
    Some progress with the real motionblur?



  5. #5
    Member Ace Dragon's Avatar
    Join Date
    Feb 2006
    Location
    Wichita Kansas (USA)
    Posts
    21,701
    This specific type of SSAO is extremely easy to use, just download the .blend, append the 'Fx' object into your game, and you're ready to go, no additional setup and real easy to tweak when you find the values used for distance, power, and how dark a pixel must be for the effect to be seen.

    It's also very fast in 2.5.
    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



  6. #6
    Member leonnn's Avatar
    Join Date
    Dec 2008
    Location
    Brazil - PR - Maringá
    Posts
    2,515
    Runs prety quick and the quality is very nice, thanks a lot for this, you help us a lot with your filters thanks!

    My wow its very nice, my FPS count dont drop, thanks again, awesome filter!
    Last edited by leonnn; 08-Apr-10 at 20:36.



  7. #7
    Member gillstudio's Avatar
    Join Date
    Nov 2009
    Location
    Washington
    Posts
    254
    Amazing! I've been looking for something like this. Runs well too!

    gill



  8. #8
    Member
    Join Date
    Sep 2007
    Location
    Viña del Mar, Chile
    Posts
    1,030
    In general there are a few implicit int to float warnings that are easy to solve martinsh, but I'm having an issue with the 'max' function, since the debugger says that: 'max': no matching overloaded function found.
    On SSAO: lines 66,67,68 and the max issue on line 81 (with a float to vec3 cast issue too).
    On SSAO Light: on lines 65, 66, 67, and the max issue on line 79 (with a float to vec3 cast issue too).
    Hope it helps.



  9. #9
    Originally Posted by martinsh View Post
    those visual errors look really weird..
    got any errors in console?
    for each of the filters. that could help me fix it.
    I could get "2 - ssao+tex" to work by making a change to ssao in the text editor at line 81.
    change:
    luminance = clamp(max(0.0,......
    to:
    luminance = clamp(max(vec3(0.0,0.0,0.0),.....
    That is, "max(0.0" has to be changed everywhere it appears in the line to "max(vec3(0.0,0.0,0.0)"

    I couldn't figure any way to make game mode acknowledge this change so I had to save the blend then reopen it.
    I get the little black dots, too. Also a textured cube I added didn't seem to get the effect.

    I'm using an old ATI card so I don't have high expectations.



  10. #10
    Member
    Join Date
    Feb 2008
    Location
    Saskatchewan
    Posts
    750
    Well, it looks cool, but it doesn't want to work on my computer.
    I can run it in 2.49b or 2.50 and I still end up with this.

    I also don't get very good framerate.

    Edit: Theres also no errors in the console.
    Attached Images Attached Images
    Pre-procrastinating. Put it off now so you don't have to put it off later.



  11. #11
    Ahh thank's for the tip Martinsh I get this

    the filter
    Fragment shader failed to compile with the following errors:
    ERROR: 0:81: error<#202> No matching overloaded function found max
    ERROR: 0:81: error<#202> No matching overloaded function found max
    ERROR: 0:81: error<#202> No matching overloaded function found max
    ERROR: 0:81: error<#160> Cannot convert from 'const float' to 'highgp 3-component vector of float'
    ERROR: error<#273> 4 compilation errors. No code generated



  12. #12
    Member martinsh's Avatar
    Join Date
    Oct 2006
    Location
    valence, france
    Posts
    761
    This one should work also on ATI cards. Thanks guys!
    http://www.pasteall.org/blend/2442
    Thanks to Moguri, I included mouse-look script for Blender 2.5, just replace "Mouselook.py" to "Mouselook_2.5.py" in the Python Controller. Mouselook_2.5.py works also in 2.49 but due constant failure to import bge.logic it consumes quite alot of Logic, so I included both - 2.49 and 2.5 versions.

    IAmThisGuy: I have no idea why it looks like that, seems like a Z-Buffer failure..

    I also reduced sample count to gain performance.
    Last edited by martinsh; 09-Apr-10 at 04:27.



  13. #13
    Member JohnnyBlack's Avatar
    Join Date
    Nov 2009
    Location
    Earth>Romania
    Posts
    1,777
    as always..........no result!

    NOTE: ATI USER!



  14. #14
    Yeah! It works, and how it works. I can fill up the whole thing with spheres (image) and it still runs with 50 FPS. This is unbelievable! I still get some artefacts but they are way smaller and way less frequent than before (red marked)



    Thanks Martinsh



  15. #15
    Some problems on Ati HD3650m (no console errors)
    http://www.pasteall.org/pic/2552

    but Wow the video you posted looks so darn great!



  16. #16
    Member martinsh's Avatar
    Join Date
    Oct 2006
    Location
    valence, france
    Posts
    761
    Now I am on my dad`s PC with ATI HD 4650 and I am also seeing same weirdness. With some tweaking I have fixed these visual errors, though I have no idea what is causing it.

    download:
    http://www.pasteall.org/blend/2444
    or
    ssao_ati.blend

    @diskette:
    not yet. I have to bug some BGE devs to implement some stuff needed for motionblur..
    Last edited by martinsh; 09-Apr-10 at 07:11.



  17. #17
    Member zapman's Avatar
    Join Date
    Mar 2006
    Location
    Munich
    Posts
    331
    wow, video looks great!
    I hope I can make use of it in my next BGE game. I certainly adds a lot of beauty to any scene!

    Thx Martinsh!!
    -----------------------------------------------------------
    "GRAVIBALLS" Game v1.1 with .blend file
    [wip]: spacial perception game



  18. #18
    Member
    Join Date
    Feb 2008
    Location
    Saskatchewan
    Posts
    750
    Well, it's probably my graphics card. I've been looking at getting a new one, so this just adds to the reasons.
    Pre-procrastinating. Put it off now so you don't have to put it off later.



  19. #19
    Member Dilopho DD's Avatar
    Join Date
    Nov 2008
    Location
    /home/thomas/Blender
    Posts
    555
    Amazing Martinish!
    truly amazing.
    Can I use this in my project?
    it looks EPIC with it!


    Dilopho DD
    Last edited by Dilopho DD; 09-Apr-10 at 10:46.



  20. #20
    Thanks Martinsh its sweet! But I have another problem which isn't that big but if you want to hear it: When I go far away I see stripes on objects if I move the stripes are changing. It's not so important to fix it...



Page 1 of 4 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
  •