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.

Showcase HDRP Sponza, learning about HDRP

Discussion in 'High Definition Render Pipeline' started by impheris, Jul 29, 2022.

  1. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    996
    My "final" results here:




    Old info (useful details)
    Hi and good day.
    Due to my latest HDRP project being damaged, i'm trying with this sponza scene that one guy from unity shared some time ago, i'm making little changes and trying to imitate a real photo i get from internet of the sponza palace.

    113359.jpg

    Anyway, there are some things i do not understand:

    1 - You can see in the original foto how light and color bounces (compare the original image with the following)

    113359b.jpg

    I'm trying to do that in unity but even with more bounces it does not work. Here is my attempt

    2.jpg
    Definitely not there. I had to fake it with lights which is not exactly good in all cases. Here is faked

    5 con.jpg
    Is not the same and is sutil because if i make the lights stronger then it looks very bad, but the effect i was looking for "is there". Yes i tried with reflection probes and even when i move the blend points to make it more smooth, it looks very flat. In fact i thing the lightmaper is making a very flat work, because the light is not bouncing (that is why i faked the bounce on the walls). So what can i do to make it work without faking it?

    2 - The other thing that i do not understand is: When i clear or delete the lightmaps all the objects becames blue, like reflecting the sky, i look everywhere i changed the post proccesing effects for visual enviroment, sky, sky colors, probes, everything where a blue color is XD and is always the same. Is not a big deal but i want to know why is that.

    noob.jpg

    Do you know something about it? what is your feedback?
    Thank you...
     
    Last edited: Nov 2, 2022
  2. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    996
    UPDATE:
    The SSGI is making a very decent work even in medium quality with a GTX1050, the effect is there with SSGI

    ssgi2.jpg


    I think the lightmaper is decent but without those bounce effects looks flat. Here is a front view without SSGI.

    decent.jpg
     
    Qleenie and Deleted User like this.
  3. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    507
    Not sure what you are trying to replicate but the materials and the colors are different and as such you will receive different results. Not to mention that it is not possible to make it the same with real lighting no matter what you try.

    In 3d rendering and lighting, we manage to give the ILLUSION that it is the same. A convincing resemblance. But it obviously is not possible to exactly replicate the results of an unknown number of light rays interacting an unknown number of times though countless bounces with just some hundreds or thousands of samples. Not to mention the exact behavior of the materials. There is not enough computational power on our machines for that.

    Another important aspect is, in HDRP, if your materials are not provided with all the correct basic data channels the lighting comes wrong. i.e. Mask needs to provide the correct metallness, smoothness, AO, etc. afaik, all Sponza models come with very basic textures. Usually just base/color, and rarely a few bump/normal maps.
     
    Last edited: Jul 29, 2022
  4. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    428
    Yes, it's most likely the sky reflection. By default, if you don't use SSR or local Reflection Probes, it will fall back to the sky, which in the case of darker environment, will look very blue/metallic. This is normal, and that's why it's important to place reflection probes to get correct reflections.

    https://docs.unity3d.com/Packages/c.../Reflection-in-HDRP.html#reflection-hierarchy
     
    Last edited: Jul 31, 2022
    chap-unity and soleron like this.
  5. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    996
    Hi... I don't want to make a 100% identical image, i want to replicate the feeling, the lighting, light bounces, reflections and add my own thing, like the volumetric and bloom effect etc...

    I'm not talking about infinite number of rays, i'm talking about rays bounces i do not know what 3d software you use for renders but in the one i use (lightwave) this is pretty basic stuffs, in fact i can replicate that effect with less rays, i don't even think about it when i make my renders, of course, those are 3d renders sorftware. I think is something i'm missing.

    HI, I get it, thanks for the link :)
     
  6. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    507
    You got me fooling around with this scene.

    In general you are right. The lightmapper creates a very flat GI result.
    That has been my problem with Unity for a long time, and in my opinion, that is the main reason Unity lighting is inferior compared to Unreal. The GI solution is flat. Soft.

    To improve it you need a lot of extra work with post-processing.

    This is with a full stack of effects and plenty of tweaks.
    upload_2022-8-1_15-51-48.png
    upload_2022-8-1_15-57-15.png
    upload_2022-8-1_15-56-0.png

    This is without my exposure tweaks (default exposure)
    upload_2022-8-1_15-52-26.png


    Flat scene.
    Just baked lighting and default effects. My starting point.
    upload_2022-8-1_15-53-13.png
     
    Last edited: Aug 1, 2022
    ftejada likes this.
  7. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    996
    You see? i'm a 3d artist i make realistic renders and all that stuffs and that is something i can NOT just ignore for a lightmapper xD.
    Your scene is not the same, you are using the new verion from intel (which is also good) i'm using an old version but i made some changes. But anyway it is the same problem, to achieve those effects i need to put other area and point lights and if you try with SSGI it makes a little better job which for me has no sense. It looks like the rays are not bouncing, something like unity is taking the light value to make an average illumination for the scene, for example, if you are using just 1 light (the sun light) it has no sense the amount of light in the area where the camera is, even with exposure settings, if you compare that area where the door is you can see that is not accurate. But maybe @pierred_unity can help us with this, he is a pro.
     
    Last edited: Aug 1, 2022
  8. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    507
    With 64 bounces we should definitely see more bounce lighting in that scene.
    Especially in the gallery where the light comes through.

    We do not know what they have done to optimize the performance of the lightmapper.
    But it definitely does not work as expected. Perhaps there is a travel distance limit?

    SSGI makes sense because it is a tool that was created for real time.
    It is not perfect but works.

    I am an old school 3D artist myself, and I have learned to work differently in offline 3D. These methods you mention we used them before GI was a thing, dome lights to produce soft lighting, second direct for bounces, fillers, negative point lights for dark spots etc. but real time with Unity requires a different approach. You should use the relevant tools provided for this kind of work not the methods you know from offline rendering. (Some can be used, and they work great, but others not so great.)

    Unity is not an offline renderer, and these methods should be avoided as they are costly in terms of performance.
     
    Last edited: Aug 1, 2022
  9. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    996
    hahaha i was going to write that in my previous answer but i didn't because it would seen arrogant XD, but yeah exactly those are old school techniques, something that should be unnecessary by a modern game engine which is also baking lights xD and i said that about SSGI because is screen space and also in medium quality, so lightmaps should looks better it suposed to take geometries and color into consideration for bounces and bake better results than SSGI in medium quality lol it makes me laugh
     
  10. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    507
    In many cases, it works as expected.
    But in this particular case for whatever reason it doesn't.
    And that is for me a bigger issue. Stability of the features.
    Working as expected, every time.

    The way I typically work is, to light my scene in a way that the basic lighting is correct, then improve with the filters and effects, but this time the scene looks really bad and basic lighting is not helpful.

    I suspect that even if I add all practical lights in my scene to help boost the amount of samples, and try to work in a typical ArchViz approach, it is not going to work.
     
  11. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    428
    @impheris Are you aware the reference photo you use was shot with a flash? ;)

    Screenshot_20220801-234157_Edge.jpg

    What I mean by that, it's not a great photo to base your experimentation on. Using some random Jpeg from the Internet with a ton of white clipping, an unknown built-in camera tonemapping, and whatever adjustments the user might have done in post, is rarely a good starting point to try to "match" a real world location. Or one must really spend time reverse engineering the photo, especially the tonemapping and the overall color science.

    On top of that, even the new Intel Sponza is not a fully "exact" scan of the Sponza atrium, it uses "photogrammetry-derived" materials, which means it is a remastered asset with better geometries and PBR textures, not an exact digital twin of the real world location. If you look at the comparison below from Frank Meinl (the artist who made both the Crytek and Intel assets), you'll see materials are slightly different, with the Intel one being more desaturated and having more weathering (darkening) overall than the real world sandstone materials. So this will certainly impact the results, as the lighting response will be slightly different to begin with (it's still a terrific asset as you can expect from Frank, don't get me wrong).

    frank-meinl-arnold-photo-comp-02.jpg

    Then, every GI solution out there will produce different results, especially with the Sponza atrium, where the light is very unidirectional and coming from a fairly small opening. This is very tricky to handle, because the renderer needs to be told (or it must figure out on its own) that it should give more importance to the sky and/or shoot more rays towards the sky via Multiple Importance Sampling for instance, or good old manually placed portals (Unity doesn't support the latter).

    On top of it all, there are plenty of differences among offline/semi-interactive renderers. So you can imagine that trying to match Unity's GPU Lightmapper (which is taking many shortcuts compared to full-fledged path tracers, isn't per pixel, and only considers diffuse lighting) with a photo is going to be very tricky.

    Screenshot_20220801-235845_YouTube.jpg

    Regardless, it is fantastic you're learning to use HDRP and try to get closer to photo realism. You might need to lower your expectations a bit for the GI part though, because the photo ref you use is not optimal, and the assets you have and the shortcuts that are taken in game engines for GI will make your task a lot more difficult.

    A few options:

    1) The hard option: you should use numerous RAW photos of the atrium with a soft neutral tonemapping as a reference (or at least proper jpegs), have scanned materials (from this location), use many samples and bounces in the Lightmapper with a high texel resolution, and many very carefully placed reflection probes. Then you will be in a better positon to start an objective comparison. Even by then, you might realise that maybe the GPU Lightmapper doesn't manage to "grab" enough light from the sky.

    2) You can start adding raytracing effects, like RT reflections or even (per pixel) RT GI. Or experiment with the path tracer (which now has denoising!). This is much easier, as these are all well supported in HDRP, if you have a sufficiently recent and powerful GPU. But again, you'll still need better assets to begin with (see point 1), before you can make a proper comparison vs a photo.

    3) Or you can just fake it. Play with the indirect multiplier and the albedo boost, tint the materials with warmer and lighter tones, etc. And in the worst case, manually place lights. Ultimately, that's often very much what artists begrudgingly end up doing when someone forces them to match a photo. ;)
     
    Last edited: Aug 8, 2022
    soleron, m0nsky, Wattosan and 6 others like this.
  12. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    996
    now i have a question for you, how did you get the uv for the lightmapper? i tried with that sponza scene before and unity says that it does not have uv for lightmaps
     
  13. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    996
    Yes of course i'm aware of that but i do not thing that flash will affect so much the lighting back on that area where the sun is reflecting light and you are right is not a proper photo xD but to be fair, as i said before to @soleron who mentioned the same thing, i do not want a 100% replica of that photo, i want to achieve the ambience the lighting style, the bounces and reflections and my point is about the bounces of the light and the reflections on the wall and floor i can see that in any other photo but no in unity's lightmap. Maybe you don't understand my point, see the comparison on the images below, the white to black bar represents how the light is bouncing and reflecting on the wall.

    sss.jpg
    asadvgfmgu.jpg

    So i do not think the asset is a problem here, i can do it with a 4 walls and a floor and still get the same lack of "bounces"(?), As a said before i'm not looking a 100% replica of a random photo, is not even about the color of the materials, is about the light.

    Do not take me worng, i'm very proud of what i managed to do with my scene in 1 hour learning HDRP XD (the original scene looked very different and not good in my opinion) and yes i read all your answer and you are right, but something like that, i though it was basic stuffs for a lightmapper in a 2021 very popular game engine...
    I can fake it that is not a problem at all for me i'm not gonna cry for that jajaja (in fact i already did it, see the 4 photo of my first post) but before, i want to know all the limitations, pros and cons of HDRP, also, you know @pierred_unity unity has many so many options and settings and i need to ask before try to reinvent the wheel, i mean i though maybe it was something i missed.
     
    Last edited: Aug 2, 2022
    soleron likes this.
  14. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    428
    Hey, I've spent no more than 30min on our Crytek-based internal test scene.

    If one just want to get the overall lighting style, and the nice lighting falloff along the walls between the brighter and darker area of the atrium that you want to simulate, I believe it's perfectly doable to get a good-looking result. This bakes below only takes 30 seconds. See the settings on the right side of the screenshot.

    I've matched the sun position of the photo (third pillar on the left slightly in the shade, and 1st floor central pole hald in the sun light), something you don't have in your own test. I do get the nice lighting falloff on the right side of the atrium, going from warm bounce light to darker indirect closer to the camera.

    upload_2022-8-2_12-53-36.png

    Things to look into if you have poor results:
    • lightmap UVs don't have a good texture usage, this is the most likely reason for poor lightmapping (and flat looking results)
    • reflection setup is not dense enough to capture the lighting variations, this is very important to get proper material response, as specularity is often neglected, and with PBR you can get radically different results, especially with a shot light this, where walls you're trying to "match" are parallel to the camera view direction
    • some odd postprocessing settings? this will also radically change the way the subtle bounce light looks like: too much over exposure and you will kill the soft lighting gradient; too much under exposure and you'll make the lighting look muddy.

    And you can get a nice gradient on a plane that you would place in the scene:
    upload_2022-8-2_13-19-54.png

    For reference, this is how the lightmap UVs for the side walls of the first floor look like. As you can see, there's a ton of lighting variation in there:
    upload_2022-8-2_13-22-16.png


    I'm told cannot share this scene yet. But hopefully, with the settings and the suggestions right above, you can get something a lot closer in terms of lightmapping quality.
     
    Last edited: Aug 2, 2022
    Ruchir, Kreshi, Deleted User and 3 others like this.
  15. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Valuable information in this thread, thank you!
     
    Wattosan and Qleenie like this.
  16. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    428
    And trying to match the camera angle and the look of the photo for about 20 min, but quickly giving up, because the materials don't really match, and I suspect the dimension of the 3d asset are not quite the same as the real world location (which will also influence the way light bounces around). For instance, the arcades' ceilings are not as tall I believe.

    I also simulated the camera flash (see shadows of the pillar on the top right corner). It makes a substantial difference in the top right corner, on the nearby pillar and the ceiling, propagating to the next pillar as well (cooler temperature too).


    upload_2022-8-2_15-29-8.png

    Using these settings (very dirty), please only use these for educational purpose, not a commercial product.
    upload_2022-8-2_14-29-20.png


    With a few more hours of material tuning (especially the pillars with more "rusty" patches), and adjusting the geometry too, it should not be difficult to get extremely close to the photo. That won't be me, though. :D
     
    Last edited: Aug 2, 2022
    Kreshi, hippocoder, soleron and 2 others like this.
  17. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    996
    I knew i was missing something! Thank you @pierred_unity you are really great...
    Looks like it was the lightmap resolution (mine was at 28) now i have what i was looking for:
    Untitled.jpg i take off the texture to make it more obvious

    Now the bad news is that i use your Post processing values and it looks very different here i did not like it and then i forgot my values and now is a mess XD i need to reconfigure everything again to my liking but i'll do that later (and i'll also post the result here) BTW i think i'm using the same scene as you: https://github.com/radishface/Sponza i just changed some materials and hid some objects

    yeah i saw that.. lol

    i won't either :p
     
    Last edited: Aug 2, 2022
  18. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    507

    Ah ok, looks like you had barely done any preparation in the scene.

    There are two ways to do that:

    The Hard One: Properly unwrap each model that you plan to have lightmapped in your 3D application.
    Make sure you are using UV Channel 2. (if you are using 3dsmax.)
    This way you can have complete control over your Lightmap unwrapping.
    Some claim it is the best, for most models I see ZERO difference just a lot of wasted time.

    The Easy One: Use Automatic unwrapping in Unity.
    (my favorite but in some complex models you need to tweak it a lot or even do it using the "Hard" method.)

    After importing your model.
    You can select all the models you imported, or even the entire building if you exported everything together.

    In the inspector make sure you are in the Model Tab.
    Scroll down and

    1. Enable "Generate Lightmap UVs"
    2. Depending on the complexity of your object, reduce the hard angle. (Default is 88.)
      Think of it as like 3dsmax Smoothing Groups. The more complicated the shapes, the lower angle. That results in your lightmap space breaking down into more pieces. For a box, 88 is great. For a complex sculpture, I choose around 30. It is the angle between two surfaces (i.e. polygons) that the program may consider as "continuous".
    3. Match this value to the lowest amount you plan to use in your lightmap resolution.
      By default, it is 40, but in many cases, you do not need to have such high lightmap resolution. In low frequency spaces even 20-25 should be more than enough. For preview 5-10 is usually great. for final production it really depends on the scene.


    upload_2022-8-2_21-14-46.png

    This result is with Lightmap Resolution set at 10.
    upload_2022-8-2_21-30-54.png


    There is a way to interactively see the resolution of your lightmap changing as you tweak the Lightmap Resolution value. Do not make it too dense, after a certain point there is no ROI and just takes too long to produce lightmaps.

    This way you can see the checker overlay that will help you understand how much you should increase your Lightmap Resolution. As you see in my case, LR value of 10 is not low.

    If you have a GPU with at least 8GB RAM it is worth trying the GPU lightmapper.
    It baked the lightmaps of my scene in 3 minutes. The CPU would take significantly longer.

    upload_2022-8-2_21-34-35.png

    As with offline 3D rendering, be careful if there are trees, do not make them static.

    For that you will need to use other methods to apply Lighting data to the objects.
    (i.e. Light Probes)

    With a Lightmap Resolution of 40, you barely see any difference with all the effects on.

    upload_2022-8-2_22-5-0.png

    Although if you do not enable SSGI then you will need to increase this value.
    Baking is important because there may be low spec machines that underperform with SSGI.

    upload_2022-8-2_22-6-53.png
     
    Last edited: Aug 2, 2022
    Deleted User likes this.
  19. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    507

    Another way Unity is better than using an offline renderer.
    You can always create different configuration files of Post Effects and Sky setups and load them at will depending on your scene.

    You didn't have to overwrite the old values.
    You could have set up a brand-new configuration file for your Effects volume.
    Switch between them and see which one you like best.
     
  20. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    996
    I was talking about the sponza from intel, which i guess is the fbx you are using, i tried that, it did not work so i keep working with the old one. Right now i'm using another fbx that one guy from unity shares some time ago and i change some textures.
    I know how to use the "Generate lightmap UV" tool from unity, i also know how to create UV maps with my 3d software, that was not the problem about that point, my problem with that sponza fbx file is that it has its UVs but unity does not recognize it (at least not my version of unity) i'm using the Y-UP version.

    You are maybe using: https://www.intel.com/content/www/us/en/developer/topic-technology/graphics-research/samples.html

    I'm using: https://github.com/radishface/Sponza

    IF you are talking about creating your own UV for lightmaps, trust me it is better if you make them, i had a lots o problems some months ago for that with my actual project and it is a low poly game -.-"
    https://forum.unity.com/threads/lig...cific-area-of-my-object.1237444/#post-7887049

    Anyway, the information can be useful for you in the same way, so i recommend you to read the previous answers :cool:

    Now about the Post effects file, i also know that but i was very dumb and change my own file -.-"
     
    Last edited: Aug 2, 2022
  21. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    507
    Not sure I understand what you mean.
    I am also using the Y Up file from intel and Unity does not give me any such errors.
    Which version are you using?

    I'm using 2021 LTS and 2022.2 Beta

    As for the manual method, I have already created many hundreds, if not thousands of assets for all kinds of platforms. PC, Mobile, VR; it really does not make any difference in the vast majority of cases which are simple geometries.

    Especially in low poly platforms like mobile. Another reason why it doesn't make too much difference even on larger more complex geometries, is because Unity repackages the UVs anyway to prepare them for baking.

    It used to be bad in some older Unity versions, but it has improved quite a bit over the years.
     
  22. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    This stuff is the stuff that sells Unity. Really great to look at!
     
    impheris likes this.
  23. Deleted User

    Deleted User

    Guest

    @pierred_unity can u please tell how to achieve the same result with only APV baking :)??! I am struggling with leaking, long baking times and noise..
     
  24. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    996
    i was using 2021 LTS but i delete that project and i'm working with the other version of the sponza... i tell you what, i'm going to download again that intel sponza file and create again the project and i will show you how it looks here, later.


    some years ago i was struggling with light leaks too, i fixed that with more lightmap resolution. maybe that can help
     
  25. Deleted User

    Deleted User

    Guest

    I am asking about APV (Adaptive probe volume), the new baking tool which was used in enemies demo and bakes complete indirect lighting data inside probes, its much more suitable for bigger worlds
     
  26. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    996
    oh sorry i did not read it well, but maybe you should ask on a thread about adaptive probe volume, this is normal basic lightmap thread
     
  27. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    428
    I'm not seeing any leaking at all on the Sponza, when purely using Probe Volumes for the entire lighting (no lightmaps).
    upload_2022-8-4_15-39-59.png

    All the leaking prevention and virtual offset we've added recently work wonders (for HDRP 14/15). For instance, all the probes that may end up between walls and floors are invalidated automatically.
    upload_2022-8-4_15-40-4.png

    I'm not saying ALL the leaking in EVERY situation will be prevented, but it does work very well, most of the time (we're not selling the system as a full lightmap replacement for static objects for this reason, as there can still be corner cases when it may leak, though quite rare).

    Also, you can use "Probe Touchup Volumes" to manually invalidate probes in some area of the scene.
     
  28. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    428
    Some further comparison between Lightmaps (at 20 texel/m == 1 pixel per 0.05m), 17 seconds to bake
    upload_2022-8-4_17-27-22.png

    And Probe Volumes (probe every 0.5m, up to 13.5m), 8 seconds to bake
    upload_2022-8-4_17-27-24.png

    We do support as well the normalization of the reflection probes by the nearby probes from the Probe Volumes. This is useful to dim areas that should normally be occluded, it's very useful (not particularly visible in an environment like this with very rough materials though).

    The two above are totally different techniques and ultimately the Lightmaps usually over slightly more pleasing results, but you can see that Probe Volumes can start replacing lightmaps in certain scenarios. In normal conditions, you'd most likely use a much higher distance between probes (0.5m for a large world is overkill, it is only used here for educational purpose). I could see some ArchViz demo using Probe Volumes with a smaller distance between probes (0.2 - 0.1m), but baking time will be much higher. The advantage of Probe Lighting is that there is no need to unwrap lightmap UVs, always a plus if you're in a rush. Plus you get the exact same lighting data for both dynamic and static objects.


    And that's what we now call the "Legacy" Light Probe groups below, we came a long way. ;)
    upload_2022-8-4_17-46-16.png
    (still has its place for lower end devices or tiny objects, but certainly not meant to handle large static geos like in this scenario)
     
    Last edited: Aug 5, 2022
    soleron, florianBrn, impheris and 4 others like this.
  29. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    996
    @pierred_unity well, you get me interested in that technique now, i need to learn how to use them too :oops:
     
  30. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    925
    I guess we should use APV alongside SSGI (Medium or even low works well) to get the best results.

    Although could somebody tell me if SSGI is viable on older GPUs like GTX 1050 or 900 series?
     
  31. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    428
    Yes, the beauty of the system is that you can mix low density probe volumes with lightmaps, and apply some SSGI on top to slightly clean up the results.

    For instance, with a 4m probe distance (that's very large for an indoor environment like this, but it still behaves relatively well), the floor is really lacking definition, with no indirect shadowing for the pillars.
    upload_2022-8-5_15-26-21.png


    Adding SSGI help with uniformizing the lighting, however it doesn't radically improve the lighting on the floor:
    upload_2022-8-5_15-26-36.png

    By adding the floor to the lightmaps, it's very easy to restore these details (and the bake remains extremely fast, because very few objects need to be lightmapped).

    upload_2022-8-5_15-18-17.png

    SSGI can be a double-edged sword, it can fix some slight light leaking and improve occlusion and provide some light bounce, but it can also unnecessarily override good lighting information from lightmaps like below if the Probe Volume fallback is not detailed enough:
    upload_2022-8-5_15-34-6.png

    So it's best to use it carefully, in noisier areas, like oudoor/natural environments. Obviously, it's up to your own preference, some might just want to use SSGI everywhere if they don't need very detailed lighting. Mixing lightmap + probe volumes + SSGI + reflection probes is a good way to achieve good compromise between memory consumption, baking time, and visual quality. ;)


    (There is Unite 2022 happening on November 1-2, I believe this could be a good topic for a live session or a video.)

    This is something you need to profile yourself. It depends on the entire complexity of your scene and what's the cost of other effects in the scene, and how you tune the SSGI (number of rays, half res denoiser, etc.).
     

    Attached Files:

    tmonestudio, Deleted User and Ruchir like this.
  32. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,100
    @Ruchir I've used SSGI and experimented with it and APV many times, with a laptop GTX 1070.
    No matter what you do, SSGI will have a noticeable cost. That said, if you use it alongside APV, you can get away with fairly low settings and it'll help a lot with the noise APV doesn't handle.

    For example, set quality level to low (or even beyond that, reduce number of rays yourself below 'low' until you find a good amount for yourself) but keep Full Resolution On. It'll give you acceptable performance, and help a lot with APV noise.

    Disabling full res can lead to some noticeable flickering and other issues, but it does make a big perf difference.
    Although, with APV In particular you can get away with low settings, as long as full res is on. Then again it depends on your project, so try with and without full res.

    I don't remember the GPU cost number, been a while. Maybe 2-7ms depending on your settings.
    SSGI by itself, without APV, is going to be harder to balance though.

    If you intend to use SSGI, you might want to bake everything with APV. Since if you use lightmaps, SSGI will override it, doesn't work with lightmaps. And that lightmap object won't receive any APV lighting information, so it'll be SSGI only.

    SSGI In general does better in exteriors. Terrain, vegetation, etc. Interiors are more difficult.
    APV helps a lot though.

    Honestly I wouldn't mind APV being more expensive for improved quality. Not having to worry about lightmap UVs is really nice, plus, dynamic :D

    It's the way to go for sure. Can handle bigger scenes as well.
    Unity's lightmapper was a pain to use for me.

    Either way, as pier said, APV is a welcome addition. You can bake a lot of small things with APV, and only big/hero objects as lightmapped.

    Reminds me of Bakery's own light probe system, which is seriously amazing. Makes light probes look.. bad :)

    Much better lighting (compared to light probes) and basically automated.
     
    Last edited: Aug 5, 2022
  33. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    996
    although in your image, the pillar seems to be floating ... Does that have to do with the resolution as well?

    (low resolution shadow?)
    aasas.jpg
     
    soleron likes this.
  34. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    388
    APV is almost always producing this dark blobs even on planar surfaces for some reason. Any chances this will be fixed in the future?
    upload_2022-8-5_18-33-37.png
     
  35. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    428
    But with a high density of probe in the Probe Volume (like 0.5m distance), SSGI has some good baseline to maintain micro details.

    SSGI Off (notice some very light leaking here and there, where probes must blend between very contrast areas):
    upload_2022-8-5_16-27-6.png

    SSGI On, results are slightly softer and most of the obvious leaking is fixed/reduced noticeably. But the Probe Volume must be detailed enough to begin with.
    upload_2022-8-5_16-26-38.png



    It's not related to (realtime) shadow resolution. It's the texel density of the lightmap that isn't high enough (I used 20 texel/m == 1 pixel per 0.05m in the image your quoted).

    For this example below, I use 100 texel/m (1 pixel == 1 cm). The connection is then much better. But baking time increases. It's all a compromise. ;)

    upload_2022-8-5_16-36-19.png
     
  36. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    428
    There has been many improvement for HDRP 15 (Unity 23.1), I'm not seeing these. Previous experimental versions of the probe volumes indeed had some sampling artifacts. It's a feature that got a lot of work over the past 6 months, most changes we've added should land for 23.1 I believe.

    Also, a frequent user setup mistake is to not use a high enough "Light probe samples multiplier" in the Lightmapper settings: low values can create some unwanted "color blobs" and odd "patches".

    There can still be some visible blending "squareness" at the edge on certain simplification levels, but that's to be expected.
     
    Last edited: Aug 5, 2022
    florianBrn, valarus and PutridEx like this.
  37. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    996
    ah yes that makes sense
     
  38. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    925
    It would indeed be really helpful.
    I currently have purchased bakery but never used it because it had some issue with HDRP in the past, and none of the sample scene worked for me, is it really good now?
     
  39. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,100
    Honestly it still feels a bit lacking in HDRP and unstable compared to URP/built-in, but so far it works for me after some issues (worst thing is they're random, no clear reason on why it happens.. or how I fixed it)
    Make sure you use Optix 7, best denoiser for HDRP with bakery, it can handle the extreme light intensities HDRP uses.
    Other denoisers can cause serious issues.

    Although I like setting fixed exposure to 0, that way it's the same as URP/Built-in, where directional light is 1-2 intensity.
    Depends on your needs/preferences and project since you lose the realistic light intensities/exposure.

    Also, be sure to read the documentation, you probably know it but sky light can't be setup as URP/built-in, you have to bake the sky probe (from bakery's baking options) and then drag the texture into bakery's sky light component.
     
    Ruchir likes this.
  40. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    996
    Today i had the time to improve my test with everything i've learned with @pierred_unity comments (thank you for your patience and dedication on this post :D)

    I'm really happy with the results by now. But what do you think? after all this is for learning and feedback
    (images updated because i forgot to put details in some materials)

    1.jpg

    2.jpg

    3.jpg

    There are other images attached with other post effects. I also tried the probe volumes stuffs and is not bad at all, it has its issues but i know is experimental right now, so.

    If any of you think i can improve the image with other things i would like to know you ideas.
    BTW, i used an online tool (Jimpl) to get the metadata of the reference image and use that for the physical camera in unity, for the ISO, Lens and all that stuffs
     

    Attached Files:

    • PP1.jpg
      PP1.jpg
      File size:
      737.4 KB
      Views:
      123
    • PP2.jpg
      PP2.jpg
      File size:
      611 KB
      Views:
      122
    Last edited: Aug 7, 2022
    soleron, m0nsky, Ruchir and 2 others like this.
  41. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    428
    No problem at all, spending time helping users and advocating for the Unity's products are some of the key goals we have, so it's great to hear you're satisfied with the results. ;)

    For additional feedback: I wonder if you use TAA in your images, it's hard to tell because your JPGs have a high compression and there seem to be some sharpening on top too.

    I can also see some visible graininess in the shadows for instance which might be related to a lack of TAA, or a low sample for the Directional's shadows (Blocker Sample Count too low for instance).
    upload_2022-8-8_12-57-35.png

    Also, you could force Anisotropic Filtering on all your textures, distant ones look fairly blurry.
    upload_2022-8-8_12-59-57.png

    I wrote an article some time ago about pushing the quality with HDRP even further, it's based on a fairly old version of HDRP, but the advice given are still valid (the blog system was changed, so the layout of images and video previews are a bit odd now):
    https://blog.unity.com/aec/how-to-s...n-render-pipeline-for-high-end-visualizations
     
    Ruchir, Deleted User and hippocoder like this.
  42. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    925
    I don't really use high-quality shadow filtering that often, but I do feel that the denoising algorithm could be a bit better as it seems grainy even for medium sample counts at reasonable blur amounts. (or maybe I'm missing some settings)

    I recently was taking a look at Nvidia's denoiser's implementation, they looked really good tbh:
    upload_2022-8-8_20-58-12.png

    (But I know they must be limited to Nvidia hardware :()

    EDIT: They support DX11, DX12 and Vulkan
     
    Last edited: Aug 8, 2022
    impheris likes this.
  43. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    996
    Sorry for the long text...
    I tried the different AA modes and i tried those settings based on one old video you did for 2019.x but do not forget that i'm working with a 1050 laptop haha and i want to take the best fps number i can get :D, so i leave at SMAA which is not that bad and does not jitter (like TAA in my case) because i also want to make a video showing the results.
    The shadow resolution was at 4096 but at 30-35 fps. so i set the resolution to "ultra" which is 2048 at 40-48 fps. (yeah i know i need a better laptop for what i want)
    The other thing i've been seeing is that i wanted to lower the saturation with "color adjusments" but that also lower the effect for the lightmaps i was crying before :rolleyes: so i do not know if doing that is a good idea...

    20 minutes later...
    I think i know the problem with the shadows now, the "scene settings" objects has this "shadows" settings, i think i need to crank those settings, i will work with that later... thanks for showing that @pierred_unity
     
    Last edited: Aug 8, 2022
  44. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    996
    ...Is making something weird with the shadows, i even disable the shadow cascades, i also set the "directional light shadows > resolution tier > max resolution to 4096 and set the shadow resolution in the light settings at 4096 too and is still doing this weird thing, when you are facing the object, the shadow looks better, but when that object is near the edge of the screen the shadow looks like dithering or granulated and also the shadow up there is disappearing
    click the images below
    1.jpg
    2.jpg

    3.jpg
    BTW i edited the previous post because now i'm interested on this problem
     
  45. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    996
    I managed to fix the graininess on the shadows from the distance light and also the contact shadows. The first one was for the shadow cascades (maybe you can try that @Ruchir )
    the second one was the contact shadows samples

    fixed grain.jpg

    fixed CSgrain.jpg

    But i still have the problem of the contact shadows disappearing when they are close to the edge of the camera
     
    Last edited: Aug 9, 2022
  46. SebLazyWizard

    SebLazyWizard

    Joined:
    Jun 15, 2018
    Posts:
    217
    Contact shadows are just screen space shadows and therefore lacking offscreen information, so they blend out at the screen border (just like screen space reflections do).
     
    Last edited: Aug 9, 2022
  47. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    428
    All the effects you mentioned do need TAA to look at their best and not show these dithering/jittering artifacts you're seeing (contact shadows, high quality shadow filtering, probe volume, SSR, SSAO, etc). Just increasing the samples, especially if you have a 1050 could be counterproductive.

    Also, SMAA is prone to shimmering and oversharpening. If you want clean stable results for a video, you might want to use FXAA or TAA on this kind of machine. TAA is relatively cheap and will give you a massive boost in image quality (the main downsides being slight artifacts in fast camera movements).
     
    Kreshi likes this.
  48. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    996
    I'm using TAA right now and i move the settings to make a balance between quality and not jittering, but is very blurry even when i stop for maybe 2 seconds.
     
  49. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    485
    We had done a similar learning situation a while ago, not to photo match or reverse engineer camera profiles but just to test more of our lighting workflows.

    Building something on the scale of Pierre's Lotus post monthly would be lovely.
    (Though having the Amalienborg Palace scene would make for lovely testing grounds :D)

    But we did have the same initial photo in our pure ref file.
    I have grabbed a few screens.

    Feel free to dig in.
     

    Attached Files:

    impheris, Qleenie and Deleted User like this.
  50. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    485
    Screenshot_Sponza_HDRP009.jpg
    I believe this is also the flashy ref scene-style
     
    impheris likes this.