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. Cryunreal

    Cryunreal

    Joined:
    Sep 1, 2013
    Posts:
    9
    $gi.jpg

    voxel grid size 128x128x128
    but the penetration of light as if 32x32x32
    damn gaps in the walls because of this! (
     
  2. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    Hi Cryunreal,
    I really can't help you because I don't know your settings, plz send me an email to support@next4unity.com with screenshots of your GI settings, or better your test scene, and I can try to help you. ...Or do you just want to spam the forum with your test pics? ;)
     
  3. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    Good news, tessellation is working now! I will write a tutorial how you can add your own custom shaders and I will add the tesselation update to the next version.
     
  4. erana79

    erana79

    Joined:
    Jun 26, 2013
    Posts:
    61
    Any estimate about an OpenGL version release?
    This looks really interesting, but limiting it to Windows...
     
  5. benthecgguy

    benthecgguy

    Joined:
    Oct 22, 2013
    Posts:
    13
    First I Like mention that this is a good effort however your Implementation of VCT (or this version you have done) is wrong simple as that. There is no ' Proper' light flux Propagation. There is no ' Actual GI Bounces ', it is a Major Fudge.

    I am not here to put you down , just pointing out the facts and clarifying the issues so Everyone can see and understand that ' GI ' is NOT just Color Bleeding. There has been Years of research in this area (Including many I have been involved with) and it is Remarkable that everyone likes to jump on the bandwagon (including another new ' GI ' Solution just posted today which is also NOT GI and has many issues on to it's self, with Multiple Raycasts sampling the surrounging area from the camera and placing Unity Point lights where hit at offset locations is this a joke? Also for Raycasting Color gathering Textures have to have Read/write enabled! ) and make Big Statements .

    PLEASE DON'T USE THE SPONZA SCENE, JUST DO A SIMPLE CORNELL BOX!!

    To illustrate my point below are a few screenshots from your system and a Simple render with MentalRay 3DSMAX of the ' SAME ' scene. I hope everyone can see that your current implementation is... well you be the judge.

    Default settings , Directional Light pointing down in to a room with a single opening at the top.
    $unityGI1.jpg

    Same Scene Rendered in MentalRay with Correct GI
    $gimax4.jpg
     

    Attached Files:

  6. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    Currently my system can't get the same look as some other ray tracers do, that's true, but it really traces! :roll:, maybe I have some bug in the tracing process that needs to be fixed, I will check that... but it's not just "color bleeding", in one of my early videos which uses a 32x32x32 grid you can also see reflections of the environment in a sphere, these reflections are calculated within the tracing process. you can't get that with point lights, but I admit that my system is currently not working perfectly correct and there is still a lot to fix and improve. (As I said before many times)

    I also tried this box test, I might got a better result as you because I set the surrounding cube textures to black (later the occlusion will fix this issue) in your screenshots we can see the light bleeding effect, also LPV has this issue with thin walls. And I think you are using the gamma color space, you should use linear for better results.

    $dGI_boxTest.jpg

    Have a look at my L shape scene in the demo, it's a similar scene, I'm not only using sponza :confused:. I think that looks "right" enough to be called GI, even if it's not 100% physically correct, even vray and mental ray are doing approximations. What do you think?
     
    Last edited: Oct 22, 2013
  7. krassi

    krassi

    Joined:
    Nov 6, 2012
    Posts:
    19
    this kind of looks.. good ;) well its not vray of course!! but thats not the point.. im working with vray every day and doing architecture stuff.. and after what i saw in the demos im pretty sure this will get better and better.. issues for me are blotchi and not smooth light distribution on walls, but with some filtering and stuff this should go well.. i hope i can get a vray like look in sooner versions, but without those stupid lightmaps and full fking realtime baby ;) ...

    do u plan to use hdri environments? this would give u the realistic kick
     
  8. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    Yes, I like to add this feature in future updates. Now I'm testing a hdr sky shader for skylighting... but it's still in development.

    krassi, as an everyday vray user, can you tell me, do you only see "a Major Fudge" in my screenshots/demos or is there more?
     
    Last edited: Oct 22, 2013
  9. krassi

    krassi

    Joined:
    Nov 6, 2012
    Posts:
    19
    ohh that sounds great!

    well i havent bought your asset yet (will soon) .. but in some scenes the light/shadow distribution has some blotches and stuff "that shouldnt be there" ;)

    one thing is also that the texture/gi effect is extremly strong in my opinion (i played with texture 0.001 or even lesse to get good results) and whats missing is a desaturation for the colorbleeding
     
  10. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    I did a quick test and converted the important shaders (voxel gen + gi shader) to dx9, so dx9 will definitely work. I think in a week or two I could make a full dx9 and OpenGL conversion, currently I'm working on bug-fixing for the dx11 version.
     
  11. EvilFox

    EvilFox

    Joined:
    Jul 23, 2013
    Posts:
    83
    That's good, because there is a problem with RTP2.
    Now I have no time to understand the specific cause.

    Great news.
     
  12. Seikan1

    Seikan1

    Joined:
    Jul 8, 2013
    Posts:
    49
    I do consider this system to be extremely complex and i know that only one man can not make perfect product just by self. Even if you made high effort to solve bugs, but if you make changes only by customer report and did not feel that something is wrong just by you own feeling ( strong color bleeding for example ) make me feel sad. Of course the simple fact that people with artistic feel and high logic/programming skills are extremely rare made me feel unhappy in this case and perfectionistic point of view.

    In the other hand i am happy to have chance to have GI system in my favorite engine, unfortunately i can produce nice result only in some situations when direct light hit one side of a object becauuse on the other side of a object there is a light leaking. Same thing happend when light come form bottom side even if i place big black cubes around my interier when any direct light hit interier surface there is a leaking from bottom, sidewalls etc.
    vNidia's GI works are also based on voxel http://www.youtube.com/watch?v=6ci-rdMkS_o. It's bad way of thinking, if you refer us that Cryengine LPV have the same issue and not looking of a proper way how to solve this. I do not consider crutch occlusion to be a proper solution. I also do not want to put you down, just think at your product as it is your own child, you don't want him to have some help crutch to be perfect, just be perfect by nature way.
     
  13. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
  14. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    615
    I don't think he was arguing your artistic skill, just that you should be fixing things and trying to increase quality w/out customer input sometimes.
    But anyways, in the mecanim test video, the wooden boards in particular seem to be illuminating themselves as if it was a light source. Also for occlusion and reflection I just thought it was something that VCT does naturally since it has access to scene information. Definitely think this is the best thing going on in unity btw! :D
     
    Last edited: Oct 28, 2013
  15. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    I'm working on it all the time and I never said everything works perfect, correct or is finished. I knew all the problems that the customer complained before, but I still released the software because there where a lot of people at that time who want this system out, even if it's not working perfect. I can't just press a button and everything works fine, it takes time. I think my fault was to release the product so early. And yes I knew the self illumination is not right / correct before I released the video, but that was never the aim of this video, I never said that it's supposed to be physically correct!
     
    Last edited: Oct 28, 2013
  16. BuildABurgerBurg

    BuildABurgerBurg

    Joined:
    Nov 5, 2012
    Posts:
    566
    I don't think you've done anything wrong CKahler, you never said it was complete or finished and you made that clear. If they want a complete GI system then they should choose another game engine.

    And I think it's very patronizing to to say you should fixing the problems instead of waiting for customer input.

    Kahler you have done a great job and I think you need to remind yourself that there are many children in the unity community and they don't get it.
     
    Last edited: Oct 28, 2013
  17. EvilFox

    EvilFox

    Joined:
    Jul 23, 2013
    Posts:
    83
    I do agree with every word you wrote.
     
  18. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    615
    How are you doing your mip-map filtering?
    Is this how your voxelization stage goes?
    1 Geometry shader projects triangle in better cube side
    2 the pixel shader writes to 3D RW Texture albedo + normal
    relight 3D texture with compute shader. Like deffered rendering in 3d
    How many bounces are you doing?
    and for occlusion can't you just use alpha values from the standard cone tracing function.
    also does cascading cause any artifacts on distant pixels? will running a whole scene at full resolution increase quality?
    do you plan on increasing to a 256x256x256 voxel grid?
     
    Last edited: Oct 28, 2013
  19. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149


    Reflection Test: fixed some issues, but still not final. looks like the one axis of the 3d volume missing some data. Not optimized so the performance is currently quiet slow.

    I found out that the tracing distance was too short, after that the reflection was visible.
     
    Last edited: Oct 29, 2013
  20. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    615
    Looking good! :D
     
  21. Seikan1

    Seikan1

    Joined:
    Jul 8, 2013
    Posts:
    49
    It is nice, however i need to change reflections individualy for each material, perhaps generaly speaking load all materials specularity value in the scene into array and multiply theyr spec. by whant you done there?
     
  22. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149


    -128x128x128 grid
    - 5 cones for tracing
    - one bounce per voxel
    - AO and GI generated at the same time (no extra calculation for AO)
    - glossy reflections
    - Specular reflection grid can be scaled down dynamically (improves performance)

    with the new voxel and tracing algorithm, a 32x32x32 grid is enough to get a good looking gi and over 400 fps. Demo is coming soon.

    @Seikan1: reflections for each material, that's the plan...
     
    Last edited: Oct 30, 2013
  23. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Sexy video...

    ...and I hate to sound like a broken record but do you have a time frame for true sky-lighting?

    -Steve
     
  24. Thomas-Pasieka

    Thomas-Pasieka

    Moderator

    Joined:
    Sep 19, 2005
    Posts:
    2,174
    Is there a way that you can allow for "bounce" iterations/interaction?
     
  25. Seikan1

    Seikan1

    Joined:
    Jul 8, 2013
    Posts:
    49
    AO seems to be easy done, what kind of algorithm do you use? I hope you allow us to change occlusion strength and radius and maybe a slider for really small objects^^. Does AO take into acount also normal info from normal map or it is done only by vertex normal? I am dreaming maybe too much..

    ..anyway very nice indeed
     
  26. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Looks astonishing, Chris! Can't wait to play with it! :)
     
  27. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    615
    Wow. Everything your doing seems to be getting better an better! You say scaling down specular reflection grid can be done dynamically can improve performance? What do you mean by that exactly?
    Edit: also check pms
     
    Last edited: Oct 30, 2013
  28. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    AO is now automatically generated by the GI tracing function, I can't really turn it off, the look depends on the cone ratio (the angle of the cone) so it would also influnce the GI. But I could add a separate pass where the look could be edited, without changing the gi. That would be an additional occlusion effect, however would cost extra calculation time.

    Although I'm having a 128 grid, I could use a lower mipmap level for the reflections, so they would start e.g. with an 32 grid
    I'm also thinking about down scaling the whole post effect I think that could also improve performance.

    Yes, I started with skylighting but I want to fix other things first, but it's on my list. Maybe next week.

    Currently I'm using one light bounce... or are you taking about the ray tracing bounces, there are normally 128 bounces for a reflection (per voxel) in a 128 grid, it depends on the cone ratio and the alpha value of a voxel how many are actually used. More light bounces are possible but will cost extra calculation time, I'm very happy with the new quality.
     
    Last edited: Oct 31, 2013
  29. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    615
    Also the reflections only show direct lighting of the scene. Is there any way to fix that?
     
  30. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    Two ways, either you set the shadow color not completely dark, or use more bounces, what I would not prefer due to performance costs (also it's not supported in this version).
     
  31. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    615
    Could you add that first option maybe as a parameter to change? The shadow not being 100% dark I mean. I also noticed that the reflection only show the diffuse as well. Would that require more bounces as well?
    Edit: also in the video why does when you go over a certain glossiness the walls turn gray?
     
    Last edited: Nov 2, 2013
  32. Seikan1

    Seikan1

    Joined:
    Jul 8, 2013
    Posts:
    49
    I definitely want to have control over it, well it depends on how much costly it will be and your final optimization.
     
    Last edited: Nov 1, 2013
  33. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    615
    The ao looks great! I wouldn't want you to have it separate from the gi and create an inconsistent look.
     
  34. Seikan1

    Seikan1

    Joined:
    Jul 8, 2013
    Posts:
    49
    I also do not want to have it separate from the GI, if you take into account also cone angle etc. as Criss did AO will be certainly more accurate. It is perhaps missunderstanding, i just want to have control over AO strength and perhaps a slider for small/big objects that are affected by AO, i do not belive it must be accomplished by separating the AO from the GI.
     
  35. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    615
    I think Chris meant that the slider you want would also affect the gi as well since they are generated together, which is why it would need to be seperate. Which is what we don't want
     
  36. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    615
  37. CKahler

    CKahler

    Joined:
    May 6, 2013
    Posts:
    149
    We are coming closer to the next release of version 0.7 with DX9 and OpenGL suppport.
    (It's the same test scene as before but now running with DX9 first and than I switch to OpenGL)



    - with static voxel gird (128size) and static direct light (both only for test reasons, later all can be dynamic)
    - AO is "naturally" generated by GI tracing algorthim


    Because the glossiness ray jumped to a mipmap level which wasn't used, I clamped that now.

    Yes, that's what I meant. Thanks for answering!

    I was thinking about using the cathedral, I didn't have time to set it up in unity yet.
     
    Last edited: Nov 4, 2013
  38. Seikan1

    Seikan1

    Joined:
    Jul 8, 2013
    Posts:
    49
    I must to say i am impressed by your AO on the chineese dragon at 1:23 but i do not understand the blemishes on the ball at the same time. If you say it is "naturally" generated by GI my deduction is there are still some imperfections with your GI tracing algorithm.
    Edit: Is light leaking fixed in 0.7 version?
     
    Last edited: Nov 4, 2013
  39. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    615
    I know you plan on adding skylighting. Any others features you plan on adding that aren't implemented yet? A to-do list maybe?
    Also the reflections are still 100% dark, do you plan on adding a slider so we can change that?
     
    Last edited: Nov 5, 2013
  40. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Nice work Chris!

    I have a question about the AO in the video: if you look at where the walls meet you can see a lighter line along the corner (contact) edge. One would expect to find a darker area there. Is that something that can be fixed? Or could it be related to the light leaking issue mentioned by Seikan1?
     
  41. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    ...OpenGL appears a good clip quicker than DX huh?

    Nice work Chris!
     
  42. Seikan1

    Seikan1

    Joined:
    Jul 8, 2013
    Posts:
    49
  43. erana79

    erana79

    Joined:
    Jun 26, 2013
    Posts:
    61
  44. mrbdrm

    mrbdrm

    Joined:
    Mar 22, 2009
    Posts:
    510
    I have watched the videos and that guy is using 256x256x256 grid and running very fast.
    there is no way to run 128 with chris asset in a real scene :(
    also i am having trouble with my character hair since its transparent...
    i hope you improve DX11 before jumping to openGL.
     
  45. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    615
    Well that 256 demo only runs at like 45 FPS while Chris' runs at 100+ I think his implementation can still be improved but I don't want him to sacrifice performance to do that. Light leaking is the only BIG problem I see that needs to be fixed so that's good! Also the ao was a little spotty but hopefully something that can be fixed as well.
     
  46. Seikan1

    Seikan1

    Joined:
    Jul 8, 2013
    Posts:
    49
    This guy have his own renderer and is coherently implemented with his VCT. There in unity, on the other hand we have compiled engine that Cris use and his VCT technique is just plugin attached over it. That meant it will never be as good, as fast as native implementation with direct rasterization access.
     
  47. erana79

    erana79

    Joined:
    Jun 26, 2013
    Posts:
    61
    If it "will never be as good and fast" if it's just a plugin for Unity, why don't you write your own renderer/engine with your own GI feature.
    I don't see the point in posting x videos of other VCT implementations and complaining that they are all better instead of offering constructive critique on the particular plugin we all talk about in this thread.

    "it will be never be as good as xxxxx" doesn't help.
     
  48. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    I don't really see why it wouldn't be as fast in unity honestly, at least in DX11 mode, i mean you've got full directcompute shader access no?
     
  49. Seikan1

    Seikan1

    Joined:
    Jul 8, 2013
    Posts:
    49
    Perhaps it will. Depends on interpretation.

    I do offered an constructive critique for each Cris's post. If your read the whole thread you would agree with me. My point for sending an videos was simple because they are the best VCT implementation yet and should be consideret as reference quality.

    And i am saying it again. Occlusion will never fix light leaking completely, as well as better texture filters will never remove flickering.
     
  50. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    615
    Well I can say that ckahlers implementation is based on a simpler version of the one in that video. So no it's likely not to look that clean. Even though I'm very happy with the quality of this asset and think that it still has room for improvement.