Announcement

Collapse
No announcement yet.

Lets make Lightmass EPIC (and understandable)

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

  • replied
    While working on the competition ( link ), I experienced certain unpredictability of result depending on position of Lightmass Volume. The position seems obvious, it should encompass the scene. But how much ? By atleast 1 or 10perc. ? Seemingly miniscule movements of the volume, seemed to often drastically alter the splotchiness. It was so random I later didn't touch it even if needed. I got the best result with the very smalled encompass I could get.

    I also sort of don't believe universal settings for perfection can be found with photons as secondary GI solver. MentalRay tried for years and it is what it is when it comes to complicated GI (of architectural spaces), requiring very unique treatment depending on scene. Which is also why other renderers brought more advanced secondary solvers (for example Vray's LightCache, while also not perfect esp. when it comes to lightleaks, it's far more evolved than photon mapping, and also has mode to work in world space and is often used for baking down scenes).

    Leave a comment:


  • replied
    Well, Rafareis123 sells lots of scenes on his website, so there is no secret about that...also he made a tutorial on UE4 Architectural scene setup on Evermotion and also gives some advices around...also che Realistic rendering scene which comes with UE4 is a very good starting point...and the scene made by koola available on the marketplace...

    There is no "Universal Lightmass solution" for every scene, otherwise there will be one parameter to set.

    Leave a comment:


  • replied
    Originally posted by DanielW View Post
    No, of course not. The paper Rafareis123 linked is for rendering engineers like myself who implement GI solvers. I will test out the scene monday-ish with the original settings and Rafa's settings and see what I can find.
    I for one am pretty bloody stoked to learn about your findings!
    Loving this thread btw, will post my own findings soon.

    Leave a comment:


  • replied
    do we all have to invest that much of time in understanding something that is fundamentally basic in producing any kind of work from Unreal Engine.
    No, of course not. The paper Rafareis123 linked is for rendering engineers like myself who implement GI solvers. I will test out the scene monday-ish with the original settings and Rafa's settings and see what I can find.

    Leave a comment:


  • replied
    Originally posted by mihanix View Post
    rafareis123 give us the parameters BaseLightmass.ini !!!
    Or sell
    I am a Modo user, that community is very cool everyone shares openly everything. The funny thing is people find out eventually and to think that someone may take work from you if they find out your techniques is nonsense. The chances of someone competing directly for the same client with someone else using UE4 are slim. If that's what the secrecy is about?

    Leave a comment:


  • replied
    Raghu thank you very much, that stirred up this topic!

    Leave a comment:


  • replied
    Originally posted by rafareis123 View Post
    I did some quick tests

    * I used "Static Lighting Level" 0.07 and "Indirect Lighting Smoothness 1.3"
    * It's possible to achieve the same lighting quality from vray
    * Kola's work it's pretty much the same as Alex Roman's vray works. The secret is in the
    shaders and the contrast. In the lighting pass you will definitely spot a lot of lighting errors. Even
    in Alex Roman's work, you can see lighting erros from Irrmap + LC solution. Darkness is our best friend
    in this case.
    * Here is a nice article for understanding better the photomapping process : http://citeseerx.ist.psu.edu/viewdoc...=rep1&type=pdf

    Have a nice study!
    rafareis123 give us the parameters BaseLightmass.ini !!!
    Or sell

    Leave a comment:


  • replied
    Originally posted by rafareis123 View Post
    I did some quick tests

    * I used "Static Lighting Level" 0.07 and "Indirect Lighting Smoothness 1.3"
    * It's possible to achieve the same lighting quality from vray
    * Kola's work it's pretty much the same as Alex Roman's vray works. The secret is in the
    shaders and the contrast. In the lighting pass you will definitely spot a lot of lighting errors. Even
    in Alex Roman's work, you can see lighting erros from Irrmap + LC solution. Darkness is our best friend
    in this case.
    * Here is a nice article for understanding better the photomapping process : http://citeseerx.ist.psu.edu/viewdoc...=rep1&type=pdf

    Have a nice study!
    @DanielW - Rafareis123 is able to remove all the bugs with good quality GI, also it's clearly evident that he is not willing to share any of his workflow (Totally understandable). I am definitely going to read the document he has posted but wondering, do we all have to invest that much of time in understanding something that is fundamentally basic in producing any kind of work from Unreal Engine. I am totally willing to give all my time, but where are the documents, tutorials, scene break downs? I can read a book about photon mapping in Unreal Engine - But Need a Book for that.

    I humbly request you to explain the working of Lightmass as detailed as possible with visual examples. Video Tutorials would be heaven sent.

    Leave a comment:


  • replied
    I did some quick tests

    * I used "Static Lighting Level" 0.07 and "Indirect Lighting Smoothness 1.3"
    * It's possible to achieve the same lighting quality from vray
    * Kola's work it's pretty much the same as Alex Roman's vray works. The secret is in the
    shaders and the contrast. In the lighting pass you will definitely spot a lot of lighting errors. Even
    in Alex Roman's work, you can see lighting erros from Irrmap + LC solution. Darkness is our best friend
    in this case.
    * Here is a nice article for understanding better the photomapping process : http://citeseerx.ist.psu.edu/viewdoc...=rep1&type=pdf

    Have a nice study!
    Attached Files

    Leave a comment:


  • replied
    Originally posted by Nicolas3D View Post
    My two cents

    99% of the time I notice that if you go over a value of 2-3 on the "Indirect light intensity" ( on the main sun light I mean ) you'll have those light leaks all over.
    I usually use, to boost up the intensity of the interiors, a skylight with a limited amount of intensity ( 0.2/0.5 ) and 1-2 of Indirect lighting.

    Then bounce cards all over the place.

    @DanielW: +1 Raghu, to be able to build the lighting only for certain object will be a godsend, since if you're working on different environments and you just want to test part of the scene it'll be great to process only a portion of that or if you move some objects just reuild the lighting for those ( and the affected surfaces of course )
    A workaround for that, which is what I am doing in my current project is organize the scene outline on different parts. I have exterior yard, ground level and level 1. As now I am working only on the level 1 I simply select all actors which are grouped in a folder from exterior yard ( easier if you arrange by type so you can only select static meshes) and simply set to movable and all the lights to not affect world. They will be ignored in lightmass. Might not be as easy as having an option like you mentioned ( which I also hope will be implemented at some point ) but does the job of lowering the building time.

    Leave a comment:


  • replied
    Originally posted by DanielW View Post
    Heh, maybe I got too technical.



    Short answer - not without some significant work on our part. Pure HDRI quality is lacking. But I hear you guys loud and clear, that's how you want to light (as opposed to directional or spot lights).
    Okay, thank you. At least I know not to try and transfer my techniques over to Unreal and just work with what it gives me. Sure would be nice to be able to light scenes this way though.

    Leave a comment:


  • replied
    My two cents

    99% of the time I notice that if you go over a value of 2-3 on the "Indirect light intensity" ( on the main sun light I mean ) you'll have those light leaks all over.
    I usually use, to boost up the intensity of the interiors, a skylight with a limited amount of intensity ( 0.2/0.5 ) and 1-2 of Indirect lighting.

    Then bounce cards all over the place.

    @DanielW: +1 Raghu, to be able to build the lighting only for certain object will be a godsend, since if you're working on different environments and you just want to test part of the scene it'll be great to process only a portion of that or if you move some objects just reuild the lighting for those ( and the affected surfaces of course )

    Leave a comment:


  • replied
    Thanks Raghu, I'll take a look at that scene when I get a chance, hopefully monday.

    is there a way (or is it planned, even possible) to calculate lighting for just selected objects?
    It's possible, although a fair amount of lightmass processing (editor export, lightmass import, photon mapping) have to be done no matter what you want to build. Only the blue part in the Swarm visualizer (double click the swarm icon hiding in the taskbar when building lighting). It's not something we have planned just due to not enough time though.

    Leave a comment:


  • replied
    Originally posted by DanielW View Post
    In the meantime, here's an overview of the methods used along with their pitfalls. I tried to inline the relevant BaseLightmass.ini settings. First, there are two completely separate paths for punctual lights (directional, spot, point) than for sky lights.

    Lightmass is heavily optimized around solving indirect lighting from punctual lights with high quality. In particular, the case where you have bright sunlight coming in a small window and hitting the wall/floor, lighting up the whole room, is what I would consider the primary use case. Lighting with sky lights / HDRI is a much more recent implementation and honestly it's not very high quality.

    Punctual light method:

    The short summary is that Final gathering is used to solve the first lighting bounce, and photons are used for bounces after that along with guiding the final gather.

    1) Many photons are emitted from the light and deposited on the scene as directly visible (direct photons). We bounce these once and record any direct photon paths that resulted in a bounced photon being deposited. This identifies small (but critical) light entrances like windows. DirectPhotonDensity controls how many photons are emitted in this stage, and IndirectPhotonPathDensity controls how many paths are recorded (how accurately we find small windows).
    2) Many more photons are emitted from the light, along the direct photon paths. These are bounced for as many times as you requested NumIndirectLightingBounces. Each bounce has a much smaller number of photons successfully bouncing so more bounces after 2 has only a small impact on build times. IndirectPhotonDensity + IndirectIrradiancePhotonDensity control how many photons are emitted to represent multi-bounce lighting.

    Now that the photons are ready for the entire scene we can start operating on each lightmap texel.

    3) Direct shadowing is computed for static and stationary lights. For static lights which use area shadows, NumShadowRays and NumPenumbraShadowRays control the quality of the penumbra, more samples are needed to support very large, smooth penumbras.
    4) We check to see if this texel is covered by other irradiance computations (steps 5-7). If there is, we reuse these nearby irradiance samples through interpolation. If not, we continue to steps 5-7. This is called Irradiance caching. Too much interpolation causes indirect shadows to be lost. The amount of reuse is controlled by RecordRadiusScale, PointBehindRecordMaxAngle, InterpolationMaxAngle. During the interpolation, we can gather even more nearby irradiance samples to further smooth the lighting.
    5) Nearby indirect photons are gathered around the lightmap texel. These tell us where most of the bright lighting is coming from, eg the small bright spot that lights up the entire room.
    6) We begin the final gather. Rays are traced out in all directions for the hemisphere of the texel. At the end of the ray we either hit some geometry, where we gather the lighting from photons at that point, or we miss geometry and hit the sky, where we evaluate the sky lighting. NumHemisphereSamples controls how many rays there are in this first refinement step.
    7) We do multiple iterations of refining the final gather. Each sector of the hemisphere is subdivided and we trace more rays to discover incoming lighting. We subdivide deeply around incoming indirect photons to make sure we resolve the small bright spot on the ground lighting the whole room. This is a form of importance sampling, also called importance driven final gathering. We also subdivide anytime there are significant differences between neighbors to reduce noise, this is called adaptive sampling. NumAdaptiveRefinementLevels controls how many refinement levels there are, AdaptiveBrightnessThreshold controls how big of a neighbor difference there must be to refine a sector.

    As to the Lightmass WorldSettings options, IndirectLightingSmoothness operates on the settings in step 4), the amount of irradiance cache smoothing.
    IndirectLightingQuality increases the number of samples and depth of refinement in steps 5-7, the final gathering.

    Sky light method (assuming static skylight, stationary is a bit different):

    1) The sky light HDR texture is exported to Lightmass as an 3 band spherical harmonic, which you can think of as an extremely low resolution cubemap (2x2 on each face approx). So if you have a very bright spot in the sky cubemap it will be spread out over a large region. This is basically prefiltering to avoid noise.
    2) We do a mini final gather at each lightmap texel and compute sky lighting with a very low number of rays. This is cached on the surface and will become the first bounce of skylight GI once the final gather accesses it.
    3) During the final gather, any rays that hit the scene look up the cached sky direct lighting from step 2), which now becomes first bounce sky lighting. Any rays that miss the scene and hit the background lookup from the sky SH, this is sky direct lighting. We refine the final gather based on brightness differences between sectors of the hemisphere, but no importance sampling is done because we don't have any photons from the sky.

    So now you can see why static sky lights have limited quality and only support one indirect lighting bounce. This is something we could improve, but it's a lot of work and complexity. Specifically, we should actually export a cubemap to Lightmass, and do importance sampling of the cubemap's contents (trace more rays to the brighter texels).
    These explanations are spot on (Made so many things easy and this is the minimum information required to understand lightmass). Till you guys made HDRI Lighting awesome in unreal engine, kindly let us know how to resolve some common issues which come when we simulate HDRI lighting with added support of Punctual lights.

    Link to download above scene file - https://www.dropbox.com/s/kjp8sow7do...tmass.rar?dl=0
    Last edited by Raghu; 10-24-2015, 04:22 AM.

    Leave a comment:


  • replied
    while we're talking about lightmass...is there a way (or is it planned, even possible) to calculate lighting for just selected objects? for example, if we add single object/move or add a light, the engine tells us how many objects need their lightmaps calculated. if the engine can tell that, why not enable lighmaps calculations only for affected geometry? it would speed up things even further instead of waiting another hour and a half for light calculation to finish for the whole level when only one object was added...

    Leave a comment:

Working...
X