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. Dismiss Notice

Unity's new Area Lights etc

Discussion in 'General Discussion' started by hippocoder, May 31, 2016.

  1. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Thanks guys, I appreciate your medical assistance in this matter :D
     
    Brity and AcidArrow like this.
  2. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,301
    Because I've been programming for years, and have no significant problem with codedives into Unreal 4? Nobody says anything about "fast" or "easy", by the way.

    That would be a "beginner", not "average".

    Either way, I'm done here.
     
  3. Brity

    Brity

    Joined:
    Feb 27, 2016
    Posts:
    116
    ok.. thanks for your wisdom. c ya
     
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,026
    You're correct that it's not easy or simple... for a novice like yourself. We're not all novices here though.

    Same. My join date may indicate I've only been here for four years, but I've been a programmer for twenty.

    It would have but some people like to hear themselves speak. :p
     
    UndeadButterKnife likes this.
  5. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    Those BU years don't count! ;)
     
    Ryiah likes this.
  6. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,026
    What's BU? My brain is deciding to flounder on me today.
     
    GarBenjamin likes this.
  7. KnightsHouseGames

    KnightsHouseGames

    Joined:
    Jun 25, 2015
    Posts:
    850
    Before Unity?
     
    GarBenjamin and Ryiah like this.
  8. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    Yep. :)

    A joke of course. I've been programming for a long time too. But ya know... some folks think all of the BU time doesn't count. lol

    I actually remember seeing the source for one of your QuickBasic programs @Ryiah. Not sure from when that was but even then you had a very clean well structured code. That stuff makes a difference for sure especially as the project increases in size & complexity.

    Anyway... was just trying to make a funny... not derail. Please no lightning strikes from mods. lol
     
    Ryiah likes this.
  9. Brity

    Brity

    Joined:
    Feb 27, 2016
    Posts:
    116

    WOW Ryiah!! LOLZ ... well im not a novice but you sound like you're the solution for unity's problems. Unity needs to hire you for sure. Unity are you listening??? this ones special!! hire her please

    oh and judging by the number of posts i think its you that loves to hear your own voice :p
     
  10. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,026
    If I recall correctly it was early high school. Approximately 1998 and roughly three years after I started learning.
     
    Martin_H, hippocoder and GarBenjamin like this.
  11. KnightsHouseGames

    KnightsHouseGames

    Joined:
    Jun 25, 2015
    Posts:
    850
    So in a hail mary play to save this thing...

    How does one get this lighting? Will this just be in the new version of Unity? I don't totally get it
     
  12. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    https://labs.unity.com/downloads
     
  13. KnightsHouseGames

    KnightsHouseGames

    Joined:
    Jun 25, 2015
    Posts:
    850
    So this is just an experimental feature. Will this eventually be part of Unity proper?

    Also, am I the only one who spent a disproportionate amount of time playing with that little mouse pointer thing at the top of the page......I feel like that is a little too amusing for what it is...
     
  14. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,301
    Martin_H and Deleted User like this.
  15. OCASM

    OCASM

    Joined:
    Jan 12, 2011
    Posts:
    326
    This is only a tease. Lagarde's part of the wishlist presentation covered a lot more and considering the work he did at DICE we can be pretty confident that Unity's PBR framework is going to improve massively over the coming year.
     
    Martin_H and elbows like this.
  16. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    What is performance ? Can this replace Enlighten for some games styles ? How does it works with a nature scenes (grass, trees, water) ?
    What about workflow , it is complicated to use and adjust ?
     
  17. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    A very quick test with an ocean system (Ceto).

    AreaLightsCeto.jpg
     
  18. macdude2

    macdude2

    Joined:
    Sep 22, 2010
    Posts:
    686
    Hey, really didn't intend to derail your thread, was asking a perhaps strongly worded question believing you may have some more insight, but unfortunately things didn't quite go as I'd hoped... Just was really hoping there would be feature announcements at Unite.

    Where did you get the unity package? I see the download on the link hippo posted, but it seems to contain only c++ files and no unity project. Am I looking in the wrong place?
     
  19. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    https://labs.unity.com/downloads
     
    Ryiah and macdude2 like this.
  20. tango209

    tango209

    Joined:
    Feb 23, 2011
    Posts:
    379
    Preview (based on 5.4) in a couple weeks if all goes well, from here starting at 28:45.
     
  21. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,782
    well it's still preview tho might perform good, might not, and possibly not the same version of what they actually use in adam demo which high chance in adam demo was integrated as Cpp into native unity rendering

    maybe. . . .
     
  22. TylerPerry

    TylerPerry

    Joined:
    May 29, 2011
    Posts:
    5,577
    Oh gosh... no one knows about multi-projection :( and directly after no cluster rendering, both features I'd love right now :(
     
  23. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I will try to make some scene level similar to Doom 3 that used lights projection system and se how it performs.
    So i must use 5.4 only ?
     
  24. darkhog

    darkhog

    Joined:
    Dec 4, 2012
    Posts:
    2,218
    Someone said waffle? I very much like waffle. Waffle lightened by the area lights.
     
    hippocoder likes this.
  25. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Cough, cough... Blender game engine 2012, custom branch one guy...

     
    macdude2 and AcidArrow like this.
  26. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,301
    Waaait a minute. Perfectly flat squared oriented surface in 3d space, no shadows. You can do something very similar via a simple raycast of a reflected vector vs target plane.
     
  27. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Yup a bit like the youtube demo hippo posted in #7, didn't see any shapes other than perfectly flat, unless I'm missing something.

    Is that what you're doing in your blog @neginfinity?
     
    Last edited: Jun 2, 2016
  28. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,301
    No, but I think I can reapply the principle to get something similar to the video. lemme check...
     
  29. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yeah area lights have never been a problem.... if you want rubbish performance. That's the big difference. Also they've never been a problem if you didn't care about PBS, again big difference.

    Area lights have been around a while but a few things prevent them being widely used in games with PBS.

    The techniques involved in the new area lights are work with PBS, have good performance targets and so on, wasn't the easiest thing to solve, plus aren't just rectangular.
     
    Ryiah likes this.
  30. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Yeah the paper says they can do spherical shapes and such so, we'll assume they can otherwise they wouldn't have published it, plus it probably works on all OS's and has better PBR, like you said.
     
  31. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    Is their techniques similar to this?
     
  32. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,460
    BTW isn't most unity problem is to make it work on all platforms as equally well as possible? while ALSO being as friendly as possible to workflow and pipeline? I'm no programmer but it seems like a huge hurdle to integrate correctly? So maybe problem they have are solvable in isolation but multiplcation of edge cases kills it?

    Asking for friend
     
    Brity likes this.
  33. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,301
    Alright, here's a quick test with bruteforce approach and artifacts.

    1.png 2.png 3.png 4.png

    As hippo said, rubbish performance, but there are couple of ways this could be improved.

    For solid light sources you could probably derive a correct lighting forumla using integrals... and for free form/textured surface, it would be possible to approximate the result using several textures with variable degree of blur (like what unity does with metallic surfaces).

    Man...Now I lost interest.
     
    iamthwee likes this.
  34. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,325
    There's no magic way you can speed up shadowmapping, specially if it's already basic shadows like the ones in Unity. You can either add more shadowmap filters to make it look a bit prettier (thus it will make it slower to render) or try a different shadowing technique such as screen space raymatching shadows or maybe planar shadows (we use a combination of all those). But shadowmapping in it's basic form requires scene to be re-rendered for every light POV with shadows no way around it.
    Speaking of rendering, I think it's a good idea Unity will open up their CPP renderers, so people can make custom renderers easier and a lot faster. I'm waiting for it. :D
     
  35. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,460
    I was wondering could this simplify GI equation? I mean to accumulate light more efficiently from area above a point o_O
     
  36. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    oh what I mean is by using different techniques ie ue4 distance field shadows and not rendering shadows - rendering them, storing them.

    That's what I mean by faster.
     
    tatoforever and Deleted User like this.
  37. Deleted User

    Deleted User

    Guest

    Aye, Ray Traced Distance Field Shadows.. It has it's drawbacks (like having to generate the distance mesh fields), but I use it for larger scenes and it works pretty well especially when in conjunction with directional lights..

    In 4.11 I noticed a 50% increase over CSM.! (Well you use it conjunction with baked and CSM but you get my meaning).

    Distance Field Based Ambient occlusion looks gorgeous too, which is based off the same mesh fields tech :)..!
     
  38. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    TBH I'd just settle for shadows that don't look bizarrely bad between cascades so here's hoping for 5.5.
     
    Martin_H likes this.
  39. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,835
     
  40. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,325
    @hippocoder,
    I think it won't happen, they are pretty busy modularizing and opening up the renderer which they said it's a total mess and sadly shadows are hardcoded in their renderer. But I'm pretty sure once it's done there's gonna be a whole plethora of people's renderers with their own shadowing technique working seamlessly. Right now it's a real problem to create custom renderers, it can be done but it's hard to manage/maintain and very hackysh.
    What I see in my magic crystal ball in the future, is more modularity and openness with more engine C# APIs in Unity so Asset Store Developers can create better core/engine/game systems for Unity easier and faster. Yes few parts of the Unity are already quite accessible and open but others such as the renderer, mecanim, even the terrain are still a blackbox without any API (or proper low level API) support.
     
    Last edited: Jun 3, 2016
    macdude2, hippocoder and Deleted User like this.
  41. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,782
    This one?
    https://bitbucket.org/Unity-Technologies/graphicsdemos
     
  42. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    This is why using some approximation without such details ; or emissive materials will suit better real time games.
     
  43. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,301
    Thanks "Captain Obvious".

    It is possible to speedup that mockup quite a lot while making it look better and smoother. Except that when I have a rough idea of how it can be done, it is no longer interesting to tinker with.
     
    Last edited: Jun 3, 2016
    zenGarden, iamthwee and Martin_H like this.
  44. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
  45. edredar

    edredar

    Joined:
    Jul 26, 2012
    Posts:
    58
    The link at Unity Labs seems to be dead. Anyone would be so generous to share?
     
  46. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    It's really up to Unity to fix the broken link and to be honest the early example version was mostly just a curiosity anyway, lacking features such as shadows that will hopefully be part of a fuller implementation somewhere down the road.
     
  47. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,903
  48. edredar

    edredar

    Joined:
    Jul 26, 2012
    Posts:
    58
  49. Matjio

    Matjio

    Unity Technologies

    Joined:
    Dec 1, 2014
    Posts:
    105
    Hi!

    There are different techniques to do realtime area lights, and this is why it is called this way in this preview and experimental package. The team is actively working on improving algorithms and extending the type of supported surfaces.
    Concerning Mixed mode lighting, the lighting team has released a second version of a public build of our current work in progress to fix the different issues: http://forum.unity3d.com/threads/mixed-mode-fixes-and-lighting-window-preview-2-mix-harder.430308/ Please give feedback there.
    Concerning progressive lightmapper, the GI team is hard at work on it and we hope to deliver a public build as soon as possible.
    Concerning volumetric lighting like the one seen in Adam, the Adam team is preparing some assets to be publicly released, and the graphics team is working on an integration in Unity as part as the Scriptable Render Loop work.

    Unity is now more than one guy, so we can work on different things in parallel! :) which means that it is not because a team of researchers is working on new algorithms that other teams are not actively fixing problems or trying to improve existing features. Sounds obvious, but I just keep seeing this kind of post saying "why are you doing this instead of fixing stuff". We can and have to do both. And for people who are developers, you know that it is not always as easy as it seems to fix things, and not always as fast as expected.

    Hope this helps a bit.

    Cheers!
    Mathieu
     
  50. eheitz

    eheitz

    Unity Technologies

    Joined:
    Dec 7, 2015
    Posts:
    2
    Hi!

    I am one of the guys who worked on this area-lighting project at Unity and I wanted to provide you with some more information about it.

    Area-light shading vs. Enlighten

    This shading technique is not to be used as a replacement for Enlighten or our future progressive lightmapper. They work together and solve different problems. An area-light is meant to be used in the same context as a point or directional light. It is just that it has a shape instead of being a point. For instance, even if you use a lightmap in your game, you still have point/directional lights at runtime for dynamic lighting, right? That's the same here:

    -A lightmapper is used to bake *static* and *indirect* (multiple-bounce) illumination (sometimes direct too, but only for the diffuse part of the BRDF).

    - The area-light shading technique is used to shade the *dynamic* and *direct* (first bounce) illumination. For instance, the specular or glossy direct reflection of an area light cannot be baked with a lightmapper because they change with the point of view. This is why they are dynamically shaded.

    Someday Unity will have native supports for area light sources. The indirect or diffuse illumination from the light source will be baked by the lightmapper and the glossy direct reflection will be shaded with our new technique.

    Similar existing work

    It is easy to find existing techniques that look similar, for instance on the asset store, but they are not really. Usually, they come with a lot of limitations that you won't realize just by looking at the preview images or in the videos:
    - sometimes they work only for pure specular reflections (what if the material is glossy?)
    - sometimes they work only for axis-aligned area-light sources
    - sometimes they are not robust and not really usable in a more general context (try them out and you will see plenty of artefacts)
    - sometimes the just fake the reflection and don't work in a PBR framework (make sure that the energies are correct and consistent with the rest of the PBR pipeline). Apply some tone mapping on the renders and you will have a bad surprise.

    In contrast, our technique is robust, works in far more general settings and is performent enough to be used in real-time (try out the demo!). Before comparing rendering technologies you should always use them. Static preview images can be nice, but they are often chosen to hide the problems. This is why we share our demos.

    The closest alternative technique is the one developed by Technicolor and pointed out before in this thread:
    "Accurate Analytic Approximations for Real-Time Specular Area Lighting".
    (Note that it was also presented at SIGGRAPH last year and it also has a funny title ;-)).

    We compared this technique to ours and found out that it is less accurate and produces annoying artefacts that make it not really usable. Our comparisons are available here: https://drive.google.com/file/d/0BzvWIdpUpRx_Qld6Sl9BaU1IN2M/view
    This document is available as a "supplemental document" attached to the SIGGRAPH publication.

    Plus, Technicolor does not share their code and patented their technique. You will have to pay a license to use it. In contrast, we (Unity) did not patent our area-lighting technique and anyone is free to use it. And we share 3 open source demos showcasing it (in Unity, in webGL, and with BGFX).

    Big words

    Some people complained the use of (unnecessary) complicated words, especially in the title "Real-Time Polygonal-Light Shading with Linearly Transformed Cosines". This is not to sound smart nor for marketing purposes. This is because we published this research as a SIGGRAPH technical paper, which is an academic conference. That's just how academic papers sound! Academic-paper titles are meant to be specific and technical. Check out the SIGGRAPH 2016 technical paper list and you will see that most papers have such titles: http://kesen.realtimerendering.com/sig2016.html

    Being on the right track

    The future will let us know if we are doing things right. Still, there are some indicators that could reassure you regarding the quality and meaningfulness of what we are doing here:

    - Our paper was accepted as a technical paper at SIGGRAPH, which is the computer graphics conference with the highest quality standards. Only papers that find innovative solutions to hard problems can be accepted at SIGGRAPH. Our paper has been peer-reviewed by worldwide expert researchers in rendering: if there were an obvious existing solution to this area-lighting problem, our paper would likely not have been accepted. Of course the academic peer-review system can be flawed sometimes, but it remains a good sign of quality in general.

    - This research project is not just Unity. It is a collaboration with 2 other companies as you can see in the author list. Stephen Hill (Ubisoft) was technical lead on Assassin's Creed and David Neubelt (Ready At Dawn) worked on the lighting in The Order: 1886. The absence of a really satisfying area-lighting technique (robust, general, and fast enough) was considered important enough for three different companies to decide to join forces and allocate research time to overcome this problem. This should be also a good sign that we have been solving a hard and important problem, even for companies that ship AAA games.

    What comes next

    We are working on making the technique work with other light shapes than polygons (cylinder, disks, spheres, etc.). Again, for each of these cases you might have seen something that fakes it in a pretty much convincing way, but there is currently nothing really reliable so far (robust, general, and fast).