Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Mixed Mode Fixes and Lighting window preview 1 - Try it!

Discussion in 'Graphics Experimental Previews' started by willgoldstone, Aug 9, 2016.

  1. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,643
    Have you even checked experimental build? That's what shadowmask mode does, and honestly casting static shadow onto moveable objects always worked in mixed mode lights (reverse order was causing issues till the experimental build - when a shadow from a dynamic object is should be cast on a static object for a baked light source).
     
  2. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    Yep, I've been playing with this all day long. Still, I can't make Shadowmask mode to cast baked shadows on dynamic objects. I just can't. Another bug perhaps?
     
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,988
    For what it's worth, I can't either.
     
    Deleted User likes this.
  4. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,643
    Worked for me. See my previous post with attachment.
     
  5. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    Yep, it's a bug alright. Your sample is not working for me, too.
     
  6. Thomas-Pasieka

    Thomas-Pasieka

    Joined:
    Sep 19, 2005
    Posts:
    2,174
    You haven't answered my previous question as to when the incremental path tracer will be available for testing. In any case, is this incremental path tracer an in-house production or a middle-ware solution much like Enlighten?
     
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,988
    Some info here : https://www.google.gr/url?sa=t&rct=...qMIhjyifDXnBdATXg&sig2=YhlUd_iEQ-o9AIKPFKvpZA

    (no release date or anything though)

    Also afaik, it's their own custom solution that was built upon imgtec's pathtracing tech.

    I am intrigued by the prospects of being able to accelerate baking with imgtec hardware, assuming it's affordable, but there's next to no info on this (apart from that it's possible)
     
  8. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,665
     
  9. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    if you read all my post above, i can't either.
     
  10. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    please file a bug report with sample project + screenshot of it looking wrong on your machine.
    Post the case number here.
     
  11. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    Okay, done. Here are the case number and a spare screenshot.

    823035
     

    Attached Files:

  12. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    @Joachim_Ante just curious is this an expected behaviour for dynamic object (Ethan and Sphere) to not receive any shadow for ShadowMask Mode?
    upload_2016-8-15_14-32-50.png
     
  13. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    233
    In response to the interest in the progressive lightmapper project; it will be released in an experimental form on the forum soon. It is an in-house lightmapper based on a path tracing algorithm.

    Not all features will be supported and the build will be vanilla Unity 5.4 + progressive lightmapper. So the new lighting features described here will *not* be available in that build. Once we/you are happy with how it works we can make an official build with the features combined. Unfortunately we cannot say which version of Unity that will be.

    Keep tuned, cheers,
    Jesper
     
    Detniess and Ostwind like this.
  14. vandreev

    vandreev

    Unity Technologies

    Joined:
    Mar 2, 2016
    Posts:
    6
    Thanks for the report! It does look like this broke recently, we're investigating right now.
     
    AcidArrow likes this.
  15. Thomas-Pasieka

    Thomas-Pasieka

    Joined:
    Sep 19, 2005
    Posts:
    2,174

    Awesome! Thanks for the update on that Jesper. Very much looking forward to getting my hands on the progressive lightmapper!. Glad to hear that it's an in house production!

    Thomas
     
  16. uy3d

    uy3d

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    187
    The shadows missing on dynamics is not a bug. This is how the shadowmask mode works. If you look at the description of the mode it states:
    Shadows from Static objects on Dynamic objects => Light Probes with Shadowmasks

    In other words, if you add light probes to your scene and rebake, then the probes will store the occlusion values, i.e. shadows. Dynamic objects will pick up the occlusion value from the probes around them. If this is not obvious from the wording please tell us so we can improve the description.
    If you want high quality shadows from statics on dynamics you should consider the shadow distance mode which specifically handles this case. You will not get the same sharp looking shadows from light probes, though. Shadowmasks are NOT baked shadowmaps with only statics in them.

    Note:
    - right now the occlusion values for light probes only work in forward, not in deferred, so please test using forward for now
    - right now proxy volumes still only pickup one occlusion value per object


    Cheers
    Uygar
     
  17. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    Despite the fact that dev's already told us that this IS a bug. And "LightProbes with shadowmask" are not the same thing. Shadowmask mode should cast baked shadows on dynamic objects as if it's a realtime shadow and LightProbes must gather the indirect lighting. This is the point of this mode while the substractive mode explicintly removes overshadowing and shadowing of dynamic objects. This is the mode where you must place lightprobes for directional light.
     
  18. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,643
     
  19. Owers

    Owers

    Joined:
    Jul 7, 2012
    Posts:
    39
    The description for Shadowmask mode says that shadows from static objects to dynamic objects is 'approximate' and is received from light probes. I don't think it's a bug and there seems to be a misunderstanding between the developers involved. I've tried this myself and it seems to work as advertised so long as you set up your light probes correctly:
    distanceshadowmask.png shadowmask.png

    The characters that are completely covered by light or shadow look correct, but the one caught in the middle looks wrong. This is because the values are being approximated, and it's the best result you can get for the best performance.

    That being said, it would be nice if there was an option to enable real-time shadows from static objects to dynamic objects in Shadowmask mode, at least from the directional light. It'll be very inefficient and technically you're better off using Distance Shadowsmask mode, but sometimes baked shadows can look better and have less issues than real-time shadows, especially with interiors.
     
  20. Owers

    Owers

    Joined:
    Jul 7, 2012
    Posts:
    39
    By the way, LODs seem to be excluded from light maps which creates inconsistent visuals:

    EDIT: Actually, they seem to be included, they're just not receiving indirect light. Light probes aren't helping.

     
    Last edited: Aug 17, 2016
  21. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,452
    Yep lightmaps only get baked for LOD0 because some genius decided that LOD>0 can be lit with lightprobes, I'm not making this up! Except for the genius part.

    Workaround Hack: setup lightprobes and add to your LOD>0 a component called "light probe proxy array" (or any combination of these words, genius in naming, also)
     
    Thomas-Pasieka and Deleted User like this.
  22. vandreev

    vandreev

    Unity Technologies

    Joined:
    Mar 2, 2016
    Posts:
    6
    Sorry, my fault, hadn't looked at the modes in a while and got confused. @uy3d is right, the mode is behaving as expected, and dynamic objects should be receiving occlusion from light probes only.
     
    Last edited: Aug 17, 2016
  23. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    We will often light the same level in discrete scenarios. Eg attached picture shows 'evening', 'day' and 'night'.

    Would be awesome if discrete scenarios were supported in the new lighting window :)
     

    Attached Files:

    Pawige likes this.
  24. willgoldstone

    willgoldstone

    Unity Technologies

    Joined:
    Oct 2, 2006
    Posts:
    794
    Hey Dan are you asking if we can provide presets of your lighting config that you interpolate or even just switch between at runtime?
     
  25. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    I'd like the switch at runtime, and the ability to bake light maps for each preset in the editor. My use case doesn't require interpolation.

    A slight complication is that we turn lights (and gameobjects) off/on in different presets, not sure how best to accomplish that.

    Thanks
     
    Ostwind likes this.
  26. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I hope all this is going to be thoroughly documented with a "use cases" section. Use cases would be a valuable addition to the manual. So you'd use it like this, or use it like that, don't just throw us all into walls of text.
     
    Gametyme, Martin_H, tango209 and 2 others like this.
  27. uy3d

    uy3d

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    187
    As there's been some confusion about the workings of the lighting modes here's a video explaining the distance shadow mode and its relation to light probes. The shadowmask mode behaves exactly the same as the distance shadow mode beyond the shadow distance.
    In this example the shadow distance is intentionally set to a low value. We will later provide examples of more representative game scenes to illustrate proper usage of the modes.
     
  28. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I think unity (and you) need to stop using the words "receiving shadows from probes" as it's not correct. It's just dumbing down what you are saying for a primitive audience. What you should be saying is that "using lightprobes will compensate visually for missing shadows" cos probes really don't apply shadows in any sense - they're just spherical harmonic based shading.

    The way I read it from unity is "we've added some faux shadow pass to lightprobes" and that's wrong.

    Unless I'm sorely mistaken of course! But these things need to be very de-mystified. We're not afraid of accurate explanation.

    Great vid though, very helpful!
     
  29. Dhialub

    Dhialub

    Joined:
    Nov 11, 2013
    Posts:
    41
    In my understanding, each light probe stores occlusion data for a light (basically one shadow value).
    This value is used to occlude that light, like shadowmaps.
    So it is indeed "real" shadow, just not as high freqency as shadowmaps.
     
    hippocoder likes this.
  30. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,643
    It is not a "real" shadow, just an approximation.

    After reading uy3d's explantion, I initially wanted to write "this is not what I'd like to see", but after thinking about it, I decided it is usable.

    Primary use of mixed model light I see is statically lit corridor with dynamic characters in it, or something similar. Meaning you have overhead light, and often nothing static between the light and character. So, as long as two dynamic characters lit by that light can cast shadows onto environment AND onto each other, it is good enough - in areas where there are additional shadows, it'll be possible to just stick a dynamic light....

    However I'm not quite sure if it'll work well in outdoor environment.

    Either way, even though it would be nice to have better alternative (static shadows onto dynamic objects, with baked light), what is available in experimental build is improvement compared to what is available in non-experimental unity.
     
  31. djarcas

    djarcas

    Joined:
    Nov 15, 2012
    Posts:
    248
    Seconded. I'm absolutely dying to get my hands on the new light mapper - I've got 30 levels made now, and the prospect of spending several days lighting each one is... not pleasant. I'm overall super-duper happy with the lighting changes from this thread, and the sooner this is available in a non-beta build so I can ship it with my current and future games, the better!
     
  32. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    233
    Feel free to drop some images here of your experiments - provided you can share them.

    Cheers,
    Jesper
     
  33. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    Yep, the new lighting system is really cool. I really like that you don't need to use enlighten for the realtime GI anymore in several cases. It boosts the performance a lot (got like 10-30 FPS boost in some places in my project, currently got around 90-100 FPS in my project in most places). And the fact that a new lightmapper is on it's way makes us all really happy.
     

    Attached Files:

    DxStd_IgnatPribylov likes this.
  34. Geoffrey91

    Geoffrey91

    Joined:
    Aug 3, 2013
    Posts:
    7
    @willgoldstone , is there any chance that I could use this experimental build to compile a standalone windows executable?

    Currently, it says that there's no standalone module ("No PC, Mac & Linux Standalone module loaded"), and if I click on the download button, I get redirected to this page, which contains a "Not found" message.
     
    Last edited: Aug 23, 2016
  35. uy3d

    uy3d

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    187
    We're doing some internal testing on the standalone builds. If everything checks out we should be able to provide a standalone build next time we update the experimental build.
     
    Geoffrey91 likes this.
  36. uy3d

    uy3d

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    187
    @hippocoder Our light probes actually do store not only the SH coefficients, but additionally up to 4 occlusion values just like the lightmaps in shadowmask mode. Hence the description: Light Probes using shadowmasks. The concept is the same, the difference is that in the case of lightmaps the masks are in UV space, whereas in the case of probes they're in world space localized at the location of the probe. The difference in quality comes from the difference in density of the precomputed data and sampling frequency when rendering on screen. The data itself is fairly accurate, but the low probe density results in undersampling with the usual artifacts associated with that. So yes, it's an approximation, but so are most of our light sources as well (point singularities in space) and we still like to call them lights.
     
    hippocoder likes this.
  37. RDeluxe

    RDeluxe

    Joined:
    Sep 29, 2013
    Posts:
    117
    Just dropping by to know if this also mean we will finally get some shadows on transparent objects ?
     
  38. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,643
    Probably not. I tried to get something like this working in the past, as far as I can tell, transparent objects with shadows would need additional queue or something like that.
     
  39. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    well i guess i stay with Distance Shadow then, really hope that we have static/baked shadow casting though.
    Just curious what is the limit of lightprobe in the scene that we can use?
     
  40. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,921
    Will there be any projected shadow system implemented ever? After all, it would be nice if Unity could achieve graphics circa 2004 (Half-life 2)... All these mixed settings seem useless to me and not great for performance.
     
  41. djarcas

    djarcas

    Joined:
    Nov 15, 2012
    Posts:
    248
    Projected shadows haven't been used in a decade? Last time I used them was on the PS2. I've no idea why you'd want to, shadow maps are a lot nicer.
     
  42. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    @uy3d just curious, how about for shadowmask mode Dynamic object still receiving realtime shadow?
    I like the baked shadow quality for static object, just. . . one nitpick about the dynamic object shadow receive :p
     
  43. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    146
    @RDeluxe unfortunately shadow on transparent is not part of this feature (ie not directly related technically) --> however we are really looking forward to support shadow on transparent -> its planned and some *amazing* underlying work is being actively worked on -> the Scriptable Rendering Pipeline !
     
    kB11, RDeluxe, moure and 3 others like this.
  44. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Thanks for the explanation guys. In future don't be afraid to tell us what is happening! when you make changes to things and don't tell us, hippos get things wrong and that, basically means the end of the whole world and so forth :)
     
  45. Can-Baycay

    Can-Baycay

    Joined:
    Dec 14, 2010
    Posts:
    27
    Eagerly waiting for this since we internally use our inhouse level editor on top of standalone nightly builds. That way, level designers and visual artists can participate without getting their minds boggled with the overwhelmingly large main project.

    With new lighting modes, things started to look just like what we expected to see. Visuals are improving day by day. Thanks for your hard work.
     
  46. uy3d

    uy3d

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    187
    @rea Right now there's no explicit mode for that. However, there are plans to support controlling update frequencies and contents of shadowmaps in the future. Once that's available you should be able to have shadowmask mode and still render the statics into a shadowmap for dynamics if you want to.
     
    Reanimate_L likes this.
  47. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    That would be great
     
  48. Geoffrey91

    Geoffrey91

    Joined:
    Aug 3, 2013
    Posts:
    7
    @uy3d That sounds great! Can you estimate in any way when this new update will be made available?
     
  49. RDeluxe

    RDeluxe

    Joined:
    Sep 29, 2013
    Posts:
    117
    Ha cool, good to know (any additional information about the Scriptable Rendering Pipeline ? Like an ETA ? :D)
     
  50. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    I think the download links are broken. Would it be possible to get new links for this build on Windows?