Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Realtime GI System - Indirect Ilumination (WIP)

Discussion in 'Assets and Asset Store' started by CKahler, Jul 23, 2013.

?

Do you need a realtime GI system for your game, and how much money would you spend?

  1. Yes, but only for free !

    97 vote(s)
    36.6%
  2. Yes, I would spend 200 Dollars for it !

    147 vote(s)
    55.5%
  3. No, I don't need it !

    21 vote(s)
    7.9%
  1. Almaj

    Almaj

    Joined:
    Jul 14, 2013
    Posts:
    38
    I'm waiting anxiously for it!
    Also i read somewhere that cryengine is making fake GI, is that true?
     
  2. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    Hi Almaj,
    I'm not using the exact same method like crytek... it's similar. Well the phrase "fake GI" can be interpreted differently. For me "fake GI" is putting some extra lights, like point or spot lights, together to fake the indirect illumination, that is not what I'm approaching here... In another way e.g. mental ray in combination with final gather could also be named "fake GI" because it is not 100% physical correct. In my opinion, the important thing is it should look realistic and it can be used fully dynamic, that means you could exchange the whole scene with another one in realtime and always get the fitting indirect lighting. By the way, I was working in the film industry, making cgi/effects for hollywood movies, for some time and believe me, no one in this business has the time to render a physical correct image, everything is an approximation, it is the job of the artist to make it feel real.
     
  3. Almaj

    Almaj

    Joined:
    Jul 14, 2013
    Posts:
    38
    Tanks CKahler for your great explanation, it's true, in cryengine 3 sometimes i need to add some negative lights in some areas to have a more depth feeling, so lets say that cryengine have Semi-GI right?
    and how about color bleeding, can it be done dynamically with your method?

    Again tanks for your amazing work.
     
  4. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    Here is my new demo:

    [video=youtube_share;xyxmDWUTqpw]http://youtu.be/xyxmDWUTqpw


    And the download link for the standalone (DX11 only!): https://skydrive.live.com/redir?resid=AC03435B5F8329C8!110

    Runs with 90-100 FPS on my GTX 770 (1280 x 1024), this video was captured with 60 FPS.

    ToDos:
    - insert occlusion ( stops color bleeding through geometry )
    - add virtual point lights for sky GI
    - add point- and spot lights to GI
    - add reflections
    - improve speed

    Known Bugs:
    - flickering with the character camera
    - flickering on slow GPUs
    - sun stucks when it is set to low

    Greets,
    Chris ;)
     
  5. Joerg74

    Joerg74

    Joined:
    Mar 28, 2013
    Posts:
    5
    Hi
    look really cool. Thanks for the demo.
    I would like to buy it when I am back from holidays in 3 weeks ;) for my next project.

    Wish you a successful development.

    All the best
    Joerg
     
  6. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Hi Chris, I tried the demo. That's amazing! Great work. It's very strange for me to suddenly get reacquainted with real-time global illumination; it feels like the cryEngine all over again!

    All joking aside, if you can get this thing to run rock-solid and to support already-existing shaders (POM, tessellation, fur...) then this is a sure buy from me.

    To give you a little feedback, I noticed that there's indeed very heavy flickering the further away you move the camera (my graphics card is a GTX Titan). It looks almost like a shadow bias problem...

    $ScreenShot017_2.jpg

    Again, excellent job! I hope you can implement your feature list and fix all the bugs because I'd be definitely willing to use this tech for "Ghost of a Tale"...
     
  7. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    Thanks for the feedback, but thats the unity shadow maps flickering, nothing to do with my system. (Maybe the bias must be higher). If you turn of the Indirect Illumination in the Helper Menu (F1) it should be visible, too.

    Besides, I uploaded the same demo with the Color Space "Gamma". It has a bit more contrast:

    https://skydrive.live.com/redir?resid=AC03435B5F8329C8!111
     
    Last edited: Sep 6, 2013
  8. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Yes, I can confirm it's just Unity shadow bias settings; nothing to do with your GI system... :)

    I just tried the gamma demo and to keep on with the feedback: I noticed that when a colored sphere is just at the edge (outside) of the camera frustum it does not contribute at all to GI. But when I turn the camera just a little bit then the area that was completely dark suddenly lights up in a very noticeable manner (see picture).

    Do you think there could there be a way of alleviating this effect by widening a little the area that gets taken into account for the GI effect? I hope you see what I mean...

    $ScreenShot021_2.jpg
     
  9. Seikan1

    Seikan1

    Joined:
    Jul 8, 2013
    Posts:
    49
    Hi CKahler, thank you for the demo.
    However, i see some hard unnatural darkening of the light when i am close to the surface ( GTX680, driver 320.18 ). Are you using some eye adaptation post process? Because sky is darker and GI light is gone ?
    There are two screens with slight rotated camera view.

    $Clipboard01.jpg $Clipboard02.jpg

    I guess it happen because GI is calculated always in view frustum, but if strong indirect light come from outside it didn't take it into calculations? Should it be corrected by increasing offset GI frustum matrix by few degrees?
     
    Last edited: Sep 6, 2013
  10. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    Thanks for the feedback guys, I will experiment with the view frustum matrix. And yes, I'm using some post process effects that could darken the screen.
     
    Last edited: Sep 6, 2013
  11. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,446
    Not a bad demo... now if the man standing on top of this structure was skinned, I will be very impressed :)
     
  12. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Well, the character is a skinned animated character as far as I can see (you can control him by pressing "X" and then the usual WASD control keys)...
     
  13. darthviper107

    darthviper107

    Joined:
    May 22, 2013
    Posts:
    15
    It actually works pretty well running on a GTX 460

    So right now it uses one light for the sun, how many lights will it be able to support? What about emissive materials?
     
  14. Loards

    Loards

    Joined:
    May 2, 2013
    Posts:
    112
    Really cool demo, im running it in a GT 660 and works very well, just i have a problem whit the sun, i always have a sunset, i cant raise the sun, to be like in morning or the middle of the day. is really good that your system works with skinned models :)
     
    Last edited: Sep 6, 2013
  15. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Beautiful! Modest performance on an Alienware M17x with a 2gig 580m at 1080p, and slightly better at 720p obviously.

    I'd have to play with settings to get better performance but I did notice one interesting thing...

    ...if I turned the GI solution OFF the performance was exactly the same, which I suspect is a good thing! :D

    Can't wait to play with this honestly...yay!!

    -Steve
     
  16. EvilFox

    EvilFox

    Joined:
    Jul 23, 2013
    Posts:
    83
    Looks pretty good. While I would like to try sponza (or bootcamp) with many settings :)
    Pleased that you have taken precisely this sky (my favorite), but the water is not as good as the looks here: http://www.youtube.com/watch?v=2AVh1x-Uqjs (This is of course just nitpicking :)


    I have noticed such problems (in addition to other listed):
    1. I see a noticeable delay rendering of indirect light on the character (when an animation).
    $ocTR4Pp.jpg
    2. If you right-click will turn on infinite animation and characters can not be controlled.
    3. When you switch to a character is not hiding the mouse cursor (C key does not work), and the camera can be rotated only when the cursor is near the edges of the window. It is not very convenient.
    4. For some reason there is a delay (input lag) when rotating camera/mouse look (he is, even when indirect lighting is switched off and the lowest graphics settings). Clearly visible at high resolutions. Too high/wrong parameters Smooth Mouse Look?
    5. Why is there no FPS counter?

    You can then make a demo with materials similar like done here:
    http://www.youtube.com/watch?v=0ygZCDoCVec&feature=player_detailpage#t=232 (3:52)
     
    Last edited: Sep 7, 2013
  17. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    Hi EvilFox,
    I build this demo in one day and it is not perfect, it should give you a first impression of my gi system, which is not final yet. There will be a sponza and bootcamp demo, but I started with this because I like to show you how the new gi system can scatter light through this caved structures which, I think, looks amazing. Any other parts of the demo like fps or some other performance issues are not so important for the intended purpose. You can use fraps (download the free demo version) and run it with my demo, than you can see the fps count (don't record it, just run it). Thanks for the feedback, I know the delay problem and I will fix it at some point. What hardware do you have? I noticed this delay happens on slower machines more often, because the time between camera update and lighting update takes too long.
     
  18. EvilFox

    EvilFox

    Joined:
    Jul 23, 2013
    Posts:
    83
    Hi. I see. Do not take me too seriously :)
    I know about fraps, just convenient when it is in the demo.
    I did not expect a great performance here, but somehow strange to see when the lighting at odds with the animation. Why did they go asynchronously? This is noticeable even at 40fps.


    GTX 550 Ti
    Driver version: 314.07

    I made ​​a few tests:
    1280х720@Fastest ~40-45
    1600х900@Fastest ~30
    1920х1080@Fastest ~21-24
    2560х1440@Fastest ~14

    1280х720@Good ~38-41
    1600х900@Good ~28-30
    1920х1080@Good ~20-22
    2560х1440@Good ~13

    1280х720@Fantastic ~21-30
    1600х900@Fantastic ~19-20
    1920х1080@Fantastic ~16
    2560х1440@Fantastic ~10

    640x480@Fastest ~69-74
    640x480@Fantastic ~30-36
    2560х1440@Beatiful ~12-13

    All modes in full screen.

    When off indirect lighting adds quite a bit of frames. It's strange, the feeling that something is continues to spend performance.

    About input delay, I have not yet figured out. Probably due to a low FPS. But it seems that the delay in the bootcamp less (I set the effects of ultra-high settings for reduce FPS). I'd rather wait for the new demo ;)
     
    Last edited: Sep 9, 2013
  19. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    Hi EvilFox, thanks for the detailed reply, I keep on with improving :)
     
  20. EvilFox

    EvilFox

    Joined:
    Jul 23, 2013
    Posts:
    83
    On driver version 320.49 nothing has changed.

    Hi CKahler, Don't mention it.
    How soon do you think to release the first version in assets store?
    I am by no means a hurry you. Just curious.
     
    Last edited: Sep 9, 2013
  21. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    Good news! I fixed all lighting issues, the lightmatrix wasn't focusing on the right spot! Fuzzy occlusion shadows (indirect shadows) are also working now! I also increased the performance a bit. I will update the demo tomorrow and add a new one!
    Hopefully this week, and death sure this month!
     
  22. EvilFox

    EvilFox

    Joined:
    Jul 23, 2013
    Posts:
    83
    Cool! I look forward to the new demos.
     
  23. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Yes! Sounds exciting!!
     
  24. Almaj

    Almaj

    Joined:
    Jul 14, 2013
    Posts:
    38
    Don't rush it ;)
     
  25. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Please rush it :eek:
     
  26. XilenceX

    XilenceX

    Joined:
    Jun 16, 2013
    Posts:
    122
    That sounds awesome! What sort of requirenments will it have for our games? Unity Pro? Special Shaders? That sort of thing.
     
  27. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    I already asked that question twice but never got an answer. Maybe there's a problem with that... :(
     
  28. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    I also think 200 is a bit much. Yes, if its practical and has good performance, it will be worth that, but not many people would be able to pay that. Therefore less people will own it(less word of mouth), and you will probably make less over all. I would recommend the 100 dollar range, you will make more, and more people will own it and hopefully, love it and spread the word.

    :)
     
  29. Seikan1

    Seikan1

    Joined:
    Jul 8, 2013
    Posts:
    49
    Fuzzy occlusion shadows? Sounds good. You have good ideas to surprise me. Is that techniques capable to replace SSAO?
    I guess no reflections yet? My wish is to have access for source code editing to really experiment and tweak everything.
     
  30. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    requirenments:
    - Yeah unity pro because of the render to texture feature, (however i was thinking about writing a render to texture plugin in the future.)
    - I'm trying to support all possible shaders ( unity and custom shaders), next demo I will test some more custom shaders.
    Can't think of any other special requirenments right now.
    The workflow will be quite easy: put the dynamic GI system in your project folder add lights which you want as GI sources and press the run button. voilà!
     
  31. Seikan1

    Seikan1

    Joined:
    Jul 8, 2013
    Posts:
    49
    @Seith, CKahler already answered me. I am hoping for it to be true because, my shaders are already complex now. :)

    There is the answer.
    Nevertheless i do expecting some problems with custom shaders but anything i can not fix by myself to optimising for more standard light models.
     
    Last edited: Sep 10, 2013
  32. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    Yes, it looks a bit like ssao you can compare it in the next demo.
    It's coming just wait a few more days ;-)
    I don't think it's to much for the quality you get, but at the beginning it will cost less.
     
  33. EvilFox

    EvilFox

    Joined:
    Jul 23, 2013
    Posts:
    83
    I agree. I think it's worth it.
    If you were able to buy Unity PRO, then I think $200 is not such a problem for that.
     
  34. EvilFox

    EvilFox

    Joined:
    Jul 23, 2013
    Posts:
    83
    Last edited: Sep 10, 2013
  35. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,446
    I am still trying to find out if it will be a safe bet to use with Skyshop. I built IBLs a lot with this tool and will definitely benefit from the strength of this tool...
     
  36. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    938
    If the asset is good as we expect I agree with you.
     
  37. TacticalDan

    TacticalDan

    Joined:
    Jan 1, 2013
    Posts:
    35
    I'm watching closely
     
  38. Sajid_farooq

    Sajid_farooq

    Joined:
    May 23, 2012
    Posts:
    238
    Good find!

     
  39. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    Here is my new update of the demo:


    Download demo: http://sdrv.ms/18Qkii4


    @EvilFox: looks interesting, however when I get this right you need to build a low res model of your scene that is hidden and transfers the light information to the highres. That could be achieved with the lpv technique as well.
     
    Last edited: Sep 11, 2013
  40. EvilFox

    EvilFox

    Joined:
    Jul 23, 2013
    Posts:
    83
    CKahler, why requesting administrative privileges? I had to run in a sandbox.

    Performance has improved more than twice!
    At 2560x1440@good — ~35-40 FPS if disabled post-effects and tessellation (IL IS AA on).
    2560x1440@fantastic — ~24-28.
    2560x1440@fastest — ~48-55.
    1280x720@good — ~65-75.
    1920x1080@good — ~46-57.
    1920x1080@fantastic — ~27-33.

    1920x1080@good:
    52 — tesselation post-effects off.
    22 — tesselation on.
    18 — post-effects on.
    12 — tesselation post-effects on.

    The shadows are visible only at Fantastic, on the other modes, you can see them only if you really fly up close.
     
    Last edited: Sep 11, 2013
  41. darthviper107

    darthviper107

    Joined:
    May 22, 2013
    Posts:
    15
    Nice, that runs much better than the old demo.
     
  42. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Wow what Evil said...

    ...performance is fantastic now (ON "Fantastic"!)

    Same Alienware as my last post above:

    1920x1080 / Fantastic / Indirect Light ON / Indirect Shadows ON / Adv. Approach ON = 36 FPS (I too disabled Post and Tess.)

    Interestingly enough toggling only Indirect Lighting on/off only changes my framerate by 2 - 3 fps. Toggling Indirect Shadows and Adv. Approach takes another 2 - 3 FPS but thats it!

    In total I go from the default scene without GI at 40 - 42 fps (1080p) to full GI at 36 - 38 fps...thats pretty goddamn phenomenal Chris!!

    My Body is Ready

    -Steve
     
  43. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    Thank you guys, for the feedback!
    The Bootcamp demo and a new demo with sky, spot, point lights and reflections is coming soon, after that I will release this beast ;-)


    I only used Fantastic, never concerned about the other modes, because this demo is still not optimized to run on low end pcs.
     
    Last edited: Sep 11, 2013
  44. Loards

    Loards

    Joined:
    May 2, 2013
    Posts:
    112
    Hi! amazing Demo but i have some problems, the demo always run about 12 to 15 frames,no matter if everything is on or everything is off, this in a GT450 mobile. and that is weird because with everything off, should run very fast.
     
  45. Setmaster

    Setmaster

    Joined:
    Sep 2, 2013
    Posts:
    239
    Dat poll.
     
  46. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    @Loards:yes, the demo is not optimized, it is just a visual preview! I'm still working on the performance!

    here is the bootcamp demo with dynamic GI as promised:
     
    Last edited: Sep 13, 2013
  47. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    615
    In the video why are the really dark areas like a dark purple color? And is that green bounce lighting coming from the vegetation? Its pretty strong, but overall it looks fantastic!
     
  48. DigitalGlass

    DigitalGlass

    Joined:
    May 12, 2009
    Posts:
    88
    This is an insta buy for me. Looking forward to the release, you are awesome
     
  49. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    My shadow color is dark blue-purple. The tonemapping post effect enhances this too. the GI irradiance is a bit too strong! This is only a quick and dirty implementation. the green bounce lighting coming from the vegetation, the colors of the virtual point lights are oversaturated, this can be changed within the system.
     
    Last edited: Sep 12, 2013
  50. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Yea I'm getting color banding ranging from yellow-green to pinkish-orange in light, and serious burn-in from the dark purple. These feel more as if one were to push the contrast (in Photoshop lets say) too high, or artifacting from compression.

    I've tried every possible configuration, with irradiance as low as 2 to 'soften' this. Otherwise I'd lose all other post-effects for now and focus on getting clean and predictable bounce and sky lighting.

    Good news at least is that my performance is still fantastic.

    Getting there! :D