Announcement

Collapse
No announcement yet.

Extending Unreal Engine for Academic purposes

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Extending Unreal Engine for Academic purposes

    Hello everybody! I am a CS student in my final year, and i'm doing my bachelor thesis in Computer Graphics along with a fellow student.
    The task that our professor gave us so far is to find out, if we can port our University's Global Illumination algorithms in Unreal Engine, or if we can implement/improve
    lighting algorithms in Unreal Engine in general.

    I should note that we are pretty proficient at programming (our starting plan was to start digging the UE source code in GitHub but its huuuge),
    and we have basic knowledge in Graphics Programming with OpenGL stuff (although i believe that we will be productive in that area too in the end of the semester).

    Also it should be mentioned that we have 0zero absolutely experience using UE.
    For now all that we are searching is some simple answers to get a top level image of what can and cannot be done.

    Our questions are:
    - Has Unreal Engine some kind of Global Illumination algorithm already in? If so can we tinker with it and how?
    - If Unreal Engine does not have GI, can we implement one? If so with what means can it be done? Does UE has some plugin system that we can use
    or its source code shall be tampered to achieve this goal?
    - How difficult do you believe any of these tasks are (integrating a new lighting algorithm, or tinkering/improving a preexisting one) from a scale of 1 to 10?

    Any help is really appreciated.

    P.S.
    On the case that this thread proves any of the above to be plausible, don't hesitate to provide any hints/links/resources/guides on UE's architecture
    or things we should read that will help us for our task.

    #2
    - It has several.

    Originally posted by Blakblt View Post
    Ultimate Guide to Global Illumination

    Note: this thread is here to overview all realtime GI solutions that are currently accessible to everyone. Lightmass will not be discussed in depth, and, as of this writing, enlighten will also not be talked about, because it isn't freely available, though it may be referenced. Same goes for SVOGI; it may be referenced because we still have footage of it, but it has been cancelled, and will not be discussed.

    Since the announcement of UE4, many were excited to see the power of a fully realtime lighting engine. Unfortunately, the existing tech that was to be used didn't scale properly and was deemed unusable in realistic gaming scenarios, causing the engine to go back to it's powerful, though static system, known as lightmass. Lightmass does what It's meant to do very well, but it isn't a perfect solution. It's poor for massive worlds, slows development time greatly, and is a general pain for those who are new to lightmapping especially. However, there are a few Realtime GI solutions that are currently available for UE4 users to use. This thread focuses on these solutions, documents what we know about them, and is meant for us to discuss Realtime GI as a whole instead of just discussing one solution out of context from others. I've taken to testing all of these solutions a solid amount, and would like to share what I, and several other community members, have found. I have also created remakes of the ArchVis demo from Epic showcasing each one visually. For reference, here is the scene in realtime with no GI and one directional light. (All of the scenes only use one directional light except DFGI, which I will discuss later. Also note that static lighting is completely disabled.)

    No Global Illumination

    [ATTACH=CONFIG]36532[/ATTACH]

    There's not much to say about this. It's simply what direct light looks like in engine. Nothing special about it.

    Light Propagation Volumes

    [ATTACH=CONFIG]36531[/ATTACH]

    Light propagation volumes is the first GI solution available for UE subscribers to use. It's quick and dirty, but all the same it works. It was added into the engine for reasons involving Fable Legends, and then was heavily polished by Lionhead for their game. The version of LPV's we have is essentially version 0.1. It's unfinished, slow compared to other LPV solutions, and it can be difficult to set up. LPV's have been used in games before with much success, most notably in Cryengine, and are a novel way of attacking GI. However, even a polished LPV system, such as Crytek's, is notorious for suffering from light leaking, low accuracy, and an inability to scale well. They only support GI from a single directional light, one bounce of lighting, and in some cases allow for emission from materials and area lights. It is unknown if progress will continue on LPV's in UE4, but most people are doubtful of this happening. Epic is already working on another solution, which has shown far better results.

    Distance Field GI

    [ATTACH=CONFIG]36526[/ATTACH]

    DFGI is Epic's new solution to solve GI. It piggybacks off of Distance Field Ambient Occlusion and requires a skylight to work (which is why the back of the room is lit), and for the most part has very good results. In the image above there is noticeable graininess where light is being bounced, but that is being polished, and only happens in interiors currently. Also note that this screenshot was taken using a post-effect version of DFGI that can be found in version 4.7.x of the engine with the command "r.DistanceFieldGI 1" if you have distance fields enabled. This version is already less-than accurate to how DFGI performs. In the 4.7.x version, it supports emissive materials, point lights, spotlights, and directional lights. In 4.8, it is actually 2 GI systems, Heightfield GI, which is used for terrain, and Surfel GI, which is what is currently implemented. Future versions of DFGI plan to have better interior results, multiple bounces of light, and 4x better performance than what it currently has. DFGI is slower than LPVs, and is considered a "high end" feature, but isn't nearly as resource intensive as SVOGI or Nvidia's new solution, VXGI.

    VXGI

    [ATTACH=CONFIG]36527[/ATTACH]

    I've seen a lot of negative comments about Nvidia Gameworks, so to keep everyone from inferring random **** about this I'm going to start with the cons and go straight for the facts. First off VXGI shaders currently take about 5 minutes each to compile. So for every material you see in that room, add 5, and that's how long it took me to set it up. It is most certainly resource intensive, but is still usable in an actual game. It only works on windows due to a DX11 dependency. It's also still in beta 0.9, and suffers some crashes. But beyond that, it's a fantastic CARD AGNOSTIC system that runs on ANY DX11/12 CARD. Unlike the previous 2 examples, it also has full specular tracing, allowing for incredible glossy reflections. It can even be used purely to generate ambient occlusion, which produces significantly better results than either HBAO+ or SSAO, and the AO is even plausible for use on PS4 and Xbox One. If you havent used it yet, it's worth a shot.
    You can find more information here: https://forums.unrealengine.com/show...ks-Integration
    Checkout the Github page here:https://github.com/NvPhysX/UnrealEngine (note you must be signed into Github to view the page or else you will get a 404 error)

    Approximate Hybrid Ratracing (AHR)

    [ATTACH=CONFIG]36649[/ATTACH]

    This one deserves special attention. It was developed entirely by community member RyanTorant, and supports Diffuse Tracing, Specular Tracing, and Ambient Occlusion. It's surprisingly fast, excels at tracing reflections, and is altogether a promising solution. As for upcoming features, point light support will be added, and RyanTorant's recent posts indicate that he may be getting close to multiple bounces, and could possibly be the first one to have a multi-bounce solution.
    Checkout his forum thread here: https://forums.unrealengine.com/show...ive-plugin-AHR

    Have any comments or questions? Please feel free to post them! I would like to know what people think about these compared to each other, which is something that isn't found on each solution's respective thread.
    https://forums.unrealengine.com/show...l-Illumination


    - You'll have to modify the engine source because for now it's not possible using a plugin

    Comment


      #3
      Wow, that's a lot of useful information!
      Now, my only question that remains unanswered is the 3rd one:
      How hard do you believe implementing a new GI algorithm can it be? And what knowledge of UE is required to achieve it?
      Does anybody have architecture oriented resources of the UE code, or should i just spend a few months digging the code to implement it?

      Comment


        #4
        Originally posted by agorg_louk View Post
        Wow, that's a lot of useful information!
        Now, my only question that remains unanswered is the 3rd one:
        How hard do you believe implementing a new GI algorithm can it be? And what knowledge of UE is required to achieve it?
        Please note that this is an educated guess.

        The C++ portion of the entine is 376 megabytes of code in 30000+ *.h/*.cpp files.

        It'll take experienced programmer week or two to wrap the head around the way engine internals work in lighting-related section of it.

        You should be able to tear apart existing technolgoies linked by previous poster and see at which point they're interacting with the engine, and use one of them as skeleton for your project.

        I'd suppose it could take experienced C++ programmer with zero unreal experience BUT strong 3d-graphic related experience about 6 weeks of time to whip up first prototype if all the mathematical stuff is well established and if he(she?) has access to the domain expert (meaning you or your professor), maybe less, depending on luck. You won't get first prototype faster than in 2 weeks (writing from scratch) even if you have god of programming working for you.

        Experienced means several years of professionally programming in C++.

        In case of students I'd generally expect you to be able to produce something in few month's time. Not sure how realistic that is.

        Originally posted by agorg_louk View Post
        Wow, that's a lot of useful information!
        Does anybody have architecture oriented resources of the UE code, or should i just spend a few months digging the code to implement it?
        There's online documentation, but it is rather limited, so I'd advise to dig through the code. Ignore archtiecture and anything that is not related to your immediate problem. You'll need decent file manager that can quickly naviagate and search through large number of files (something like total commander, midnight commander, far manager, etc. Notepad++ should also work). and preferably can display C++ code with syntax highlighting. Because you definitely won't get far if you try to plug that into ide and compile it to see "how it works" or (even worse) set up breakpoints and walk through code. You need to hunt down data structures of interest, see how they're used, get rough overall idea of subsystem you're going to work with, locate portions of code where other lighting systems are hooked into the engine and then take it from there.
        Last edited by NegInfinity; 10-28-2015, 08:11 PM.

        Comment


          #5
          Like NegInfinity said, it will definitely take someone a while to look through the code to wrap their heads around it. Due to the source code being accessible, the only reason you wouldn't be able to do something is due to possible legal limitations depending on what you want to do.
          Marketplace Assets

          Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
          Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
          Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread

          Comment


            #6
            I suppose also, that we should also at some point become proficient in using it. Do we have any to the point, fast paced, guide manual for this?
            Should i read the online docs first, or do you believe that i'll learn how to operate it efficiently by messing around with it?

            Comment


              #7
              Originally posted by agorg_louk View Post
              I suppose also, that we should also at some point become proficient in using it. Do we have any to the point, fast paced, guide manual for this?
              Should i read the online docs first, or do you believe that i'll learn how to operate it efficiently by messing around with it?
              I find it easiest to just dig through the code, once you have a general idea of how everything is laid out, its pretty easy to find what you are looking for, implementing things like custom lighting algorithms tho is probably about as difficult as it gets. But there is always other work to look at to help figuring it out, such as Ryan Torants AHR and VXGI, both integrated into separate branches, both have full source available to investigate (Well enough source in the case of VXGI to determine where the important parts are).
              NVIDIA GameWorks merged branch (v4.9.2) (v4.12.5) (v4.13 p2)
              Feel free to Donate if you wish to support me

              Comment


                #8
                Yep, that was my initial thought too!

                Comment

                Working...
                X