Announcement

Collapse
No announcement yet.

BaseLightmass.ini - A Summary From Various Posts

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

    BaseLightmass.ini - A Summary From Various Posts

    Hi all,

    I created this thread to summarize all good information from DanielW about Lightmass and BaseLightmass.ini in UE4. Achieving realistic lighting and rendering (in real time!) for archviz with UE4 is impossible without touching the BaseLighmass.ini and changing some of its variables according to your needs/scenes. The default lighting values however are already good for games or quick proof of concept archviz, but as we all know by now, it's not enough for realistic rendering archviz. Almost all important variables in BaseLightmass.ini need further explanation, since they seem to have tight relation with each other. Generally you can not just change one variable without changing other variables. So hopefully with this thread we can together dissecting and understand BaseLightmass.ini better. It would be best if DanielW also could post some insights here.

    DISCLAIMER: I'm not an expert at BaseLightmass.ini. This thread mainly contains summary of explanations from DanielW, Epic's rendering and GI solver engineer, and also some test results (and their setting values) from Koola and Rafareis123 that was based on Raghu's sample scene. Thanks to Raghu whom had started this thread and that thread has made me touch BaseLightmass.ini file (something that I was trying to avoid, but it seems impossible to achieve good lighting setup without messing with BaseLightmass.ini).

    DISCLAIMER 2: DanielW has developed 'light portal' to address some issues that was asked by Raghu in above thread. So this thread might become obsolete whenever the light portal comes with UE4.11 (early 2016, hopefully). But for now, we still have to mess around with BaseLightmass.ini to achieve best lighting setup.

    Below is the content of BaseLightmass.ini. In general this file contains mainly three sections: initialization, lighting setup, and light quality presets (I've ordered the section so it follows [roughly] the lighting work flow described by DanielW). In this file I also inserted some comments from DanielW (and mine) about the variable and its effect. The most interesting part that you might be looking for to achieve best quality lighting starts from [DevOptions.PhotonMapping] section.

    Code:
    ; These are tweaked defaults for various lightmass solver and export settings
    ; Artist-oriented lightmass settings are in the editor UI
    ; Documentation for all of these is in UnrealLightmass/Public/SceneExport.h
    ; This ini is reloaded every time a lighting build begins, no need to restart
    
    [DevOptions.StaticLighting]
    bAllowMultiThreadedStaticLighting=True
    ViewSingleBounceNumber=-1
    bUseBilinearFilterLightmaps=True
    bCompressLightmaps=True
    bUseConservativeTexelRasterization=True
    bAccountForTexelSize=True
    bUseMaxWeight=True
    MaxTriangleLightingSamples=8
    MaxTriangleIrradiancePhotonCacheSamples=4
    bAllow64bitProcess=True
    DefaultStaticMeshLightingRes=32
    bAllowCropping=False
    bGarbageCollectAfterExport=True
    bRebuildDirtyGeometryForLighting=True
    
    [DevOptions.StaticLightingSceneConstants]
    StaticLightingLevelScale=1
    VisibilityRayOffsetDistance=.1
    VisibilityNormalOffsetDistance=3
    VisibilityNormalOffsetSampleRadiusScale=.5
    VisibilityTangentOffsetSampleRadiusScale=.8
    SmallestTexelRadius=.1
    ; Tweaked for a good tradeoff between 'Cache Indirect Photon Paths' time and Indirect photon emitting 'Sampling Lights' time
    LightGridSize=100
    AutomaticImportanceVolumeExpandBy=500
    MinimumImportanceVolumeExtentWithoutWarning=10000.0
    
    [DevOptions.StaticLightingMaterial]
    bUseDebugMaterial=False
    ShowMaterialAttribute=None
    ; Material export sizes default to very small to keep exports fast
    EmissiveSampleSize=128
    DiffuseSampleSize=128
    SpecularSampleSize=128
    TransmissionSampleSize=256
    NormalSampleSize=256
    ; Terrain materials default to much higher resolution since each material typically covers a large area in world space
    TerrainSampleScalar=4
    DebugDiffuse=(R=0.500000,G=0.500000,B=0.500000)
    EnvironmentColor=(R=0.00000,G=0.00000,B=0.00000)
    
    [DevOptions.MeshAreaLights]
    bVisualizeMeshAreaLightPrimitives=False
    ; Only emissive texels above .01 will be used to create mesh area lights
    EmissiveIntensityThreshold=.01
    MeshAreaLightGridSize=100
    MeshAreaLightSimplifyNormalAngleThreshold=25
    MeshAreaLightSimplifyCornerDistanceThreshold=.5
    MeshAreaLightSimplifyMeshBoundingRadiusFractionThreshold=.1
    MeshAreaLightGeneratedDynamicLightSurfaceOffset=30
    
    [DevOptions.PrecomputedDynamicObjectLighting]
    bVisualizeVolumeLightSamples=False
    bVisualizeVolumeLightInterpolation=False
    NumHemisphereSamplesScale=2
    SurfaceLightSampleSpacing=300
    FirstSurfaceSampleLayerHeight=50
    SurfaceSampleLayerHeightSpacing=250
    NumSurfaceSampleLayers=2
    DetailVolumeSampleSpacing=300
    VolumeLightSampleSpacing=3000
    ; Clamp the number of volume samples generated to ~15mb
    MaxVolumeSamples=250000
    bUseMaxSurfaceSampleNum=True
    ; Approximately clamp the number of surface samples generated to ~30mb (only for Landscape currently)
    MaxSurfaceLightSamples=500000
    
    [DevOptions.PrecomputedVisibility]
    bVisualizePrecomputedVisibility=False
    bCompressVisibilityData=True
    bPlaceCellsOnOpaqueOnly=True
    NumCellDistributionBuckets=800
    CellRenderingBucketSize=5
    NumCellRenderingBuckets=5
    PlayAreaHeight=220
    MeshBoundsScale=1.2
    VisibilitySpreadingIterations=1
    MinMeshSamples=14
    MaxMeshSamples=40
    NumCellSamples=24
    NumImportanceSamples=40
    
    [DevOptions.PrecomputedVisibilityModeratelyAggressive]
    MeshBoundsScale=1
    VisibilitySpreadingIterations=1
    
    [DevOptions.PrecomputedVisibilityMostAggressive]
    MeshBoundsScale=1
    VisibilitySpreadingIterations=0
    
    [DevOptions.VolumeDistanceField]
    VoxelSize=75
    VolumeMaxDistance=900
    NumVoxelDistanceSamples=800
    ; Clamp the size of the volume distance field generated to ~15mb
    MaxVoxels=3992160
    
    ; my note: This is the lighting setup
    ; my note: This section is for the first/basic lighting bounce (maybe?)
    [DevOptions.PhotonMapping]
    bUsePhotonMapping=True
    bUseFinalGathering=True
    bUsePhotonDirectLightingInFinalGather=False
    bVisualizeCachedApproximateDirectLighting=False
    bUseIrradiancePhotons=True
    bCacheIrradiancePhotonsOnSurfaces=True
    bVisualizePhotonPaths=False
    bVisualizePhotonGathers=True
    bVisualizePhotonImportanceSamples=False
    bVisualizeIrradiancePhotonCalculation=False
    bEmitPhotonsOutsideImportanceVolume=False
    ConeFilterConstant=1
    
    ; 400 gives a smooth enough result without requiring a very large search
    
    ; my note: should be used in combination with IndirectPhotonSearchDistance to eliminate leaking
    ;              if you increase this value, then IndirectPhotonSearchDistance should be increased too
    ;              value of 1000-2000 seems to be a good starting point
    
    NumIrradianceCalculationPhotons=400
    
    ; Allocating most final gather samples towards importance samples gives a good result as long as there are enough first bounce photons
    FinalGatherImportanceSampleFraction=.6
    ; 10 degrees is a good tradeoff between capturing high frequency incident lighting at final gather points and covering the whole incident lighting domain with a limited number of importance directions
    FinalGatherImportanceSampleConeAngle=10
    IndirectPhotonEmitDiskRadius=200
    
    ; DanielW: IndirectPhotonEmitConeAngle used in combination with IndirectPhotonPathDensity to channel
    ;          indirect photons into small windows and doors where they are needed the most
    ; my note: use this to extend the indirect photons emitter radius, widen its trace area
    IndirectPhotonEmitConeAngle=30
    MaxImportancePhotonSearchDistance=2000
    MinImportancePhotonSearchDistance=20
    
    ; Preview (quality) uses a very small number of importance directions
    NumImportanceSearchPhotons=10
    OutsideImportanceVolumeDensityScale=.0005
    
    ; DanielW: DirectPhotonDensity controls how many photons are emitted in this stage
    ;          Try jacking up DirectPhotonDensity, IndirectPhotonDensity, IndirectPhotonPathDensity,
    ;          IndirectIrradiancePhotonDensity by a factor of 10 or so to eliminate leaking artifacts
    ; my note: if you change the values above then you may need to change the value of
    ;          IndirectPhotonEmitConeAngle as well since it also need to work with IndirectPhotonPathDensity (see above)
    DirectPhotonDensity=350
    
    ; Same as DirectPhotonDensity, since currently direct photons are only used to create irradiance photons
    DirectIrradiancePhotonDensity=350
    DirectPhotonSearchDistance=200
    
    ; DanielW: IndirectPhotonPathDensity controls how many paths are recorded
    ;          (how accurately we find small windows)
    IndirectPhotonPathDensity=5
    
    ; Need a very high indirect photon density since first bounce photons are used to guide the final gather
    ; DanielW: IndirectPhotonDensity + IndirectIrradiancePhotonDensity controls
    ;          how many photons are emitted to represent multi-bounce lighting
    IndirectPhotonDensity=600
    IndirectIrradiancePhotonDensity=300
    
    
    ; my note: should be used in combination with NumIrradianceCalculationPhotons to eliminate leaking
    ;              if you increase this value, then NumIrradianceCalculationPhotons also need to be increased as well
    ;              value between 1000-2000 seems to be a good start
    
    IndirectPhotonSearchDistance=200
    
    PhotonSearchAngleThreshold=.5
    IrradiancePhotonSearchConeAngle=10
    CachedIrradiancePhotonDownsampleFactor=2
    
    ; my note: this section is moved below photon settings above,
    ;          to give a clear view of lighting work flow in UE4 as described by DanielW
    [DevOptions.StaticShadows]
    ; Using area shadows by default instead of filtering in texture space
    bUseZeroAreaLightmapSpaceFilteredLights=False
    
    ; DanielW: 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
    NumShadowRays=8
    NumPenumbraShadowRays=8
    
    NumBounceShadowRays=1
    bFilterShadowFactor=True
    ShadowFactorGradientTolerance=0.5
    bAllowSignedDistanceFieldShadows=True
    MaxTransitionDistanceWorldSpace=50
    ApproximateHighResTexelsPerMaxTransitionDistance=50
    MinDistanceFieldUpsampleFactor=3
    MinUnoccludedFraction=.005
    StaticShadowDepthMapTransitionSampleDistanceX=100
    StaticShadowDepthMapTransitionSampleDistanceY=100
    StaticShadowDepthMapSuperSampleFactor=2
    
    ; Clamp the number of shadow samples generated to ~8mb for huge levels
    StaticShadowDepthMapMaxSamples=4194304
    
    [DevOptions.IrradianceCache]
    bAllowIrradianceCaching=True
    bUseIrradianceGradients=False
    bShowGradientsOnly=False
    bVisualizeIrradianceSamples=True
    
    ; DanielW: Too much interpolation causes indirect shadows to be lost
    ;          The amount of reuse is controlled by three variables below.
    ;          During interpolation we can gather even more nearby irradiance samples
    ;          to further smooth the lighting
    RecordRadiusScale=.8
    InterpolationMaxAngle=20
    PointBehindRecordMaxAngle=10
    
    ; Increase distance and angle constraints in the shading pass, which filters the interpolated result without losing too much detail.
    DistanceSmoothFactor=4
    AngleSmoothFactor=4
    ; Sky occlusion has less noise than normal GI, don't blur away details
    SkyOcclusionSmoothnessReduction=.5
    ; Enforce a minimum sample rate on surfaces with no nearby occluders
    MaxRecordRadius=1024
    CacheTaskSize=64
    InterpolateTaskSize=64
    
    ; my note: this section moved below IrradianceCache,
    ;          to give clear view of lighting work flow in UE4
    [DevOptions.ImportanceTracing]
    bUseCosinePDF=False
    bUseStratifiedSampling=True
    
    ; DanielW: this variable controls how many rays there are at the base level of refinement step
    ;          for the final gather, which means direct shadowing for a skylight
    ; my note: used together with IndirectLightingQuality (in Lightmass World Settings) and NumHemisphereSamplesScale (in Quality Preset sections),
    ;          the end result formula seems to be IndirectLightingQuality * NumHemisphereSamples * NumHemisphereSamplesScale
    ;          I think it works better in 2^n step: 2 (2^1), 4 (2^2), 8 (2^3), 16 (2^4), 32 (2^5), etc.
    
    NumHemisphereSamples=16
    
    
    ; my note: I'm guessing that MaxHemisphereRayAngle starts at 0
    ;          From my small experiment, increasing this to 179 gave me a brighter lit room
    ;          than the default value of 89 [90 degrees]
    MaxHemisphereRayAngle=89
    bUseAdaptiveSolver=true
    
    
    ; DanielW: this var below controls how many refinement levels there are
    ; my note: need more experiments with this variable
    
    NumAdaptiveRefinementLevels=2
    
    ; DanielW: this var below controls how big of a neighbour difference there must be to refine a sector
    AdaptiveBrightnessThreshold=0.1
    AdaptiveFirstBouncePhotonConeAngle=4
    
    ; my note: Settings below are QUALITY PRESETS in UE Editor: Medium, High, and Production.
    ;          The Preview Quality only use 'basic' light settings above
    [DevOptions.StaticLightingMediumQuality]
    NumShadowRaysScale=2
    NumPenumbraShadowRaysScale=4
    ApproximateHighResTexelsPerMaxTransitionDistanceScale=3
    MinDistanceFieldUpsampleFactor=3
    NumHemisphereSamplesScale=2
    NumImportanceSearchPhotonsScale=1
    NumDirectPhotonsScale=2
    DirectPhotonSearchDistanceScale=.5
    NumIndirectPhotonPathsScale=1
    NumIndirectPhotonsScale=2
    NumIndirectIrradiancePhotonsScale=2
    RecordRadiusScaleScale=.75
    InterpolationMaxAngleScale=1
    IrradianceCacheSmoothFactor=.75
    NumAdaptiveRefinementLevels=3
    AdaptiveBrightnessThresholdScale=.5
    AdaptiveFirstBouncePhotonConeAngleScale=1
    
    [DevOptions.StaticLightingHighQuality]
    NumShadowRaysScale=4
    NumPenumbraShadowRaysScale=8
    ApproximateHighResTexelsPerMaxTransitionDistanceScale=6
    MinDistanceFieldUpsampleFactor=5
    NumHemisphereSamplesScale=4
    NumImportanceSearchPhotonsScale=2
    NumDirectPhotonsScale=2
    DirectPhotonSearchDistanceScale=.5
    NumIndirectPhotonPathsScale=2
    NumIndirectPhotonsScale=4
    NumIndirectIrradiancePhotonsScale=2
    RecordRadiusScaleScale=.75
    InterpolationMaxAngleScale=.75
    IrradianceCacheSmoothFactor=.75
    NumAdaptiveRefinementLevels=3
    AdaptiveBrightnessThresholdScale=.25
    AdaptiveFirstBouncePhotonConeAngleScale=2
    
    [DevOptions.StaticLightingProductionQuality]
    NumShadowRaysScale=8
    NumPenumbraShadowRaysScale=32
    ApproximateHighResTexelsPerMaxTransitionDistanceScale=6
    MinDistanceFieldUpsampleFactor=5
    NumHemisphereSamplesScale=8
    NumImportanceSearchPhotonsScale=3
    NumDirectPhotonsScale=4
    ; Decrease direct photon search distance so that we will have more accurate shadow transitions.  This requires a higher density of direct photons.
    DirectPhotonSearchDistanceScale=.5
    NumIndirectPhotonPathsScale=2
    ; Need a lot of indirect photons since we have increased the number of first bounce photons to use for final gathering with NumImportanceSearchPhotonsScale
    NumIndirectPhotonsScale=8
    NumIndirectIrradiancePhotonsScale=2
    ; Decreasing the record radius results in more records, which increases quality
    RecordRadiusScaleScale=.5625
    InterpolationMaxAngleScale=.75
    IrradianceCacheSmoothFactor=.75
    NumAdaptiveRefinementLevels=3
    AdaptiveBrightnessThresholdScale=.25
    AdaptiveFirstBouncePhotonConeAngleScale=2.5
    At the moment, that's all information I can gather. If you guys know something about a variable in this BaseLightmass.ini and it's effect to UE4 world, please do post your finding in this thread. This way we can learn together about BaseLightmass.ini because it's such an important file to get best quality lighting in UE4.
    Last edited by tupikp; 11-06-2015, 09:21 AM.
    Swarm Agent and Lightmass Troubleshooting

    #2
    Q & A Session With DanielW

    Here's the Q & A Session With DanielW

    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).

    Originally posted by DanielW View Post
    Those leaking artifacts look like insufficient photons. Try jacking up DirectPhotonDensity, IndirectPhotonPathDensity, IndirectPhotonDensity, IndirectIrradiancePhotonDensity in BaseLightmass.ini by a factor of 10 or so.

    I am still looking into the Skylight-only case. I found a bug in the adaptive sampling, such that it was not doing much with IndirectLightingQuality > 1. Also I implemented portals and I'm testing those out. These things take time though, it will be some weeks before I have good results - mostly as I have to make sure no quality or build time regressions occur in many maps.

    IndirectPhotonEmitConeAngle is used in combination with IndirectPhotonPathDensity to channel indirect photons into small windows and doors where they are needed the most. In a scene like that (indirect lighting of local lights not doing much) I don't know why it would matter.

    Originally posted by DanielW View Post
    Also, does uncompressed lightmaps makes a noticeable difference?
    It's very noticeable to me esp if you look at a shadow penumbra that should otherwise be smooth.
    Originally posted by DanielW View Post

    @Nicolas3D : What I have observed is, if we are using other lights along with Skylight we don't need the high Photon Density(Direct as well as Indirect).
    Skylights shouldn't interfere with other light's indirect lighting. So if you need to jack up photon density for some reason, introducing a skylight will not change that.

    Increasing the Photon Density, increases the build time by the factor of amount of increase from default value(400).
    Increasing photon density will only increase the photon emission part of the build by that factor. Photon emitting is usually 15% of a build, so you can raise it quite a bit before doubling your build time. Look at the stages in the swarm visualizer or the swarm log stats once a build completes. In contrast, NumHemisphereSamples and StaticLightingLevelScale are probably the quickest way to increase your build time.

    @DanielW: Are portals going to be included in a release soon?
    Well they still only exist on my computer so... Realistically it will be 4 months before any code change I make today will make it into a released build. Of course you can build latest directly from github (once it's checked in), but that tends to be very unstable.

    Originally posted by DanielW View Post
    One major improvement I'd like to see to lightmass is an improvement to the map processing. Currently it's not possible to divide a single texture up across multiple threads, so build times are always capped at the largest lightmap resolution you have in the scene (usually anyway), and only one thread can do that work while the rest are doing nothing.
    That was true in UE3 lightmass, but it's been improved in UE4 lightmass. Specifically, the final gather is split into tasks of 128^2 and distributed to any threads that are idle. The largest lightmap component will still be the bottleneck, but your CPU is better utilized during it. This makes the biggest difference in small scenes where you are going for high quality, so there aren't enough components to keep all threads busy. This is done in FStaticLightingSystem::CalculateIndirectLightingTextureMapping in code.

    Now, there are still other parts of lightmass work for a simple component's lightmap that could be multithreaded better - specifically area shadows.

    ...or ability to choose number of cores, so one can surf/whatever while lightmass is calculating... just a thought... ;-)
    This can be set in Swarm agent settings. You can bring up the swarm agent by starting a lighting build once (in a tiny map, or just cancel it), then find the icon hidden in your taskbar and double click it.

    Originally posted by DanielW View Post

    Fantastic results from the portal lights.
    Portal light is a bit of a misnomer, they're not lights as they do not emit light. 'Light portal' makes sense though.

    Which shouldn't be a problem with 12gb vram of Titan-X, but I couldn't stop this process by changing all .ini files I found on internet. No matter if I set shadow/lightmap mip-maping to 0/false, or rised value for memory pools, both in project and general folders, etc.. it would always mip-map those lightmaps,
    which is just visually horrible. Anyone with similar issue got this solved ?
    Make sure you are on Epic scalability settings.

    Texture streaming poolsize settings come from Engine/Config/DefaultScalability.ini

    [TextureQuality@3]
    r.Streaming.PoolSize=1000

    You can also disable lightmap streaming in your project's DefaultEngine.ini. You have to rebuild lighting and resave after changing this. Here's the default (from Engine/Config/BaseEngine.ini)

    [TextureStreaming]
    AllowStreamingLightmaps=True
    Originally posted by DanielW View Post
    I have now checked in my Lightmass solver quality improvements:
    A) Adds light portals - these solve static skylight quality in highly enclosed areas like the example
    B) Fixed high IndirectLightingQuality settings disabling adaptive sampling - this improves static skylight quality
    C) Fixed light leaks when using spotlights with StaticLightingLevelScale .1 - StaticLightingLevelScale is no longer applied to photon emission

    These changes will be in 4.11 which will probably be in about 4 months.

    So to wrap up Raghu's original post

    1. How to remove the splotches in the area where there is no skylight hitting directly (Areas far from windows). As you can see in the above images there are so many splotches in gallery, despite having Indirect Lighting quality to = 10 and static Lighting Level scale = .1
    2. Shadows become somewhat messy after a certain distance. How to make area shadows more clear and smooth.
    This is addressed by A) + B)

    3. Whenever we put spotlights to remove dark areas, it almost always gives the annoying problem of light leaks. Clearly evident in the above images.
    This is addressed by C)

    Sadly that's all the time I can spend on Lightmass atm, otherwise I would like to investigate some more complex scenes.

    Originally posted by DanielW View Post

    Is there a workaround for point C) at the moment?
    If possible kindly provide us the solution to the - "Light leaks due to spot/point/direct lights in static mode" as I can safely assume that you have already figured it out.
    The light leaks that occur with a stationary spot light come from application of the .1 StaticLightingLevelScale to photon settings. In particular, a ton more photons are emitted at StaticLightingLevelScale .1 and the search distance is decreased. This is supposed to increase the quality of the photon representation, but for some reason (I have not been able to determine) it results in a huge amount of variance / noise / splotchiness. This causes the phantom lights 'light leaks' in your images.

    I simply disabled application of StaticLightingLevelScale to the photon settings in code. You can probably achieve the same workaround by increasing IndirectPhotonSearchDistance by 10x if you use StaticLightingLevelScale .1, effectively canceling out the scale. I have not tested this myself though.

    @ DanielW - As now I am trying to learn Lightmass and Photon mapping deeply, It's kind of a mystery to me, what these settings change (in BaseLightmass.ini or may be in some other config files) when we manipulate them in editor -

    Static Lighting Level scale from 1 to .1

    Indirect Lighting quality from 1 to 10

    Indirect Lighting Smoothness from 1 to .25
    StaticLightingLevelScale - this scales the density of every computation lightmass makes. It has two big noticeable impacts - for final gathering (which computes first bounce GI from lights + sky light direct) it increases the density of light gathers. It won't actually increase the _quality_ of light gathers, just how far apart they are on a surface. This improves contact shadows but explodes your build time. It also increases the density of photons emitted, this is what I disabled in my latest change to work around the phantom lights.

    IndirectLightingQuality - this mostly increases the number of rays traced at each final gather, also known as NumHemisphereSamples in the ini. A value of 10 means 10x more rays and therefore 10x longer build time. You can think of more rays as a higher resolution image being resolved, so it improves the quality of light gathers.

    IndirectLightingSmoothness - we filter between light gathers a bit to hide the last little bit of noise. The default amount of smoothing is quite high, so it can be useful to lower this to get more detailed shadows. Note that smaller values for StaticLightingLevelScale also decrease smoothness, so with a StaticLightingLevelScale of .1 you probably don't need to reduce smoothing anymore. IndirectLightingSmoothness doesn't affect build time.
    Last edited by tupikp; 11-06-2015, 07:07 AM.
    Swarm Agent and Lightmass Troubleshooting

    Comment


      #3
      This is the samples that was provided by Rafareis123 and Koola using Raghu's second test scene. They also provided their settings to achieve the result.

      Originally posted by rafareis123 View Post
      Unfortunately I'm not having time to finish the article in the next few days, but I will.
      So this is my final settings.
      [ATTACH=CONFIG]64509[/ATTACH]
      [ATTACH=CONFIG]64510[/ATTACH]
      [ATTACH=CONFIG]64511[/ATTACH]
      [ATTACH=CONFIG]64512[/ATTACH]
      [ATTACH=CONFIG]64513[/ATTACH]

      Preset Quality = MEDIUM

      EDITOR
      Static Lighting Level=0.15
      Num Indirect Lighting=20
      Indirect Lighting Quality=10
      Indirect Lighting Smoothness=1.2

      BaseLightmass.ini
      NumHemisphereSamples=256
      NumIrradianceCalculationPhotons=4096
      DirectIrradiancePhotonDensity=1024
      IndirectPhotonDensity=20000
      IndirectIrradiancePhotonDensity=16000
      IndirectPhotonSearchDistance=180
      Originally posted by koola View Post
      A new test with Raghu scene :






      10 min on a I7-3770K.
      I took into account the explanations of DanielW.

      Editor :

      Lighting Quality : Production
      Static Lighting Level=0.2
      Num Indirect Lighting=100
      Indirect Lighting Quality=1
      Indirect Lighting Smoothness=1


      BaseLightmass.ini :

      [DevOptions.PhotonMapping]
      NumIrradianceCalculationPhotons=2000
      IndirectPhotonSearchDistance=1000

      [DevOptions.StaticLightingProductionQuality]
      NumHemisphereSamplesScale=100
      NumDirectPhotonsScale=1
      NumIndirectPhotonsScale=1
      NumIndirectIrradiancePhotonsScale=1
      AdaptiveBrightnessThresholdScale=.01


      This is a lot faster than anything I tested so far.
      (Depending of the scene and without the futur "skylight portal", the NumHemisphereSamplesScale may need to be increase even more)

      PS : Please, can someone at Epic do something for the really ugly temporalAA implemeted in 4.9 (I try 4.10 preview and it's the same thing).
      Last edited by tupikp; 11-06-2015, 08:21 PM.
      Swarm Agent and Lightmass Troubleshooting

      Comment


        #4
        NumIrradianceCalculationPhotons and IndirectPhotonSearchDistance

        The latest finding by Raghu about Koola and Rafaeris123 test result was this:

        - NumIrradianceCalculationPhotons=1000
        I'm guessing this variable is to define number of photons used for irradiance calculation. Default value is 400 and according to comment inside BaseLightmass.ini: "400 gives a smooth enough result without requiring a very large search".

        - IndirectPhotonSearchDistance=1000
        I'm guessing this value is in Unreal unit (which is 1uu = 1cm). So in this case 1000uu = 1000cm = 10m. If my guess is true, then values more than 1000 is used for very large areas only. The default value is 200 (2m). What this variable do? Again I'm guessing this var is to define max distance to search for nearby photons.
        Last edited by tupikp; 11-06-2015, 09:58 AM.
        Swarm Agent and Lightmass Troubleshooting

        Comment


          #5
          [MENTION=59633]tupikp[/MENTION] Very good reference. Thanks for compiling this together. Do you have any updates for 4.11.2 since your last post?

          Comment


            #6
            We should have a sticky post where people can download the actual revised .ini file from say Koola, Raghu, etc. for the latest version of UE4. It takes too long to decipher all the random info on the subject.

            Comment


              #7
              Originally posted by RI3DVIZ View Post
              We should have a sticky post where people can download the actual revised .ini file from say Koola, Raghu, etc. for the latest version of UE4. It takes too long to decipher all the random info on the subject.
              I totally disagree with you. People should learn what the values are doing. Even Koola didn't know what the values are doing. But since he only created scenes, it was okay to just maximize the numbers.

              Just copying numbers shouldn't be the right thing to do.

              Game Design - Photogrammetry - Programming
              Tutorials · Twitter · Twitch

              Comment


                #8
                Originally posted by SchnitzelDude View Post
                I totally disagree with you. People should learn what the values are doing. Even Koola didn't know what the values are doing. But since he only created scenes, it was okay to just maximize the numbers.

                Just copying numbers shouldn't be the right thing to do.
                That's okay if people want to learn what the values are doing some of us just want to get our work done as quickly as possible. It won't hurt anyone wanting to learn if the .ini file is available.

                Comment


                  #9
                  Hey guys. With 4.11 version, a lot things has changed. Please don't use my past tests as reference point. I'm going to write a new article about it soon.

                  My latest work using 4.11 with lighting portals


                  Building time : about 40-50 minutes
                  Running at 180 FPS on a Geforce 980 ti
                  http://www.ue4arch.com

                  https://www.youtube.com/channel/UCjp...pois6WVG6hqXNQ
                  Latest projects

                  Comment


                    #10
                    Originally posted by rafareis123 View Post
                    Hey guys. With 4.11 version, a lot things has changed. Please don't use my past tests as reference point. I'm going to write a new article about it soon.



                    Building time : about 40-50 minutes
                    Running at 180 FPS on a Geforce 980 ti
                    That's beautiful man! Great work.

                    Comment


                      #11
                      Originally posted by rafareis123 View Post
                      Hey guys. With 4.11 version, a lot things has changed. Please don't use my past tests as reference point. I'm going to write a new article about it soon.
                      That's great to hear. Looking forward to read your article.

                      Game Design - Photogrammetry - Programming
                      Tutorials · Twitter · Twitch

                      Comment


                        #12
                        [MENTION=182935]Haskellf[/MENTION] Sorry for the late reply. Actually, I stop messing with .ini file since UE 4.11 preview 1. UE4.11 lightmass and the introduction of light portal is good enough for me to avoid the lighting problem commonly found in previous version of UE4s. I admit that I usually don't go after 100% photo-realistic scenes though. When clients are happy with the scene (even when it's not 100% photo-realistic), then I just stop changing the lighting and/or lightmass settings.

                        It really doesn't hurt if people still experimenting with the .ini file, since the default values in the file are targeting good performance instead of excellent visuals.

                        [MENTION=12653]rafareis123[/MENTION] Wow! That's just... wow!
                        Last edited by tupikp; 04-26-2016, 07:44 AM.
                        Swarm Agent and Lightmass Troubleshooting

                        Comment


                          #13
                          [MENTION=12653]rafareis123[/MENTION] Fantastic work! Could you briefly describe your method? Are you using a hybrid of Lightmaps with dynamic shadows or is this all Raytraced Distance Fields, DFAO and DFGI?

                          Comment


                            #14
                            [MENTION=59633]tupikp[/MENTION] I come from a feature film background, so realism and stylized renders are my preference. I am slowly transitioning from a Renderman, Vray and ClarisseIFX pipeline to that of UE4. It is great discovering the innards of the .ini files as it gives me greater control over the quality vs performance. Yes, performance is not a huge factor right now, but it will be when VR is put into the mix. For now, I have been reading through all the forum threads and trying to gain as much knowledge as possible.
                            I would be interested as to what workflow you are using in regards to Arch Viz? Are you using DFGI with DFAO and Raytraced DF or are you mixing Lightmaps with Dynamic lights? Is it even possible to mix Lightmaps with DFAO and raytraced DF? I haven't tried it but that is my next test on my list.
                            There are so many variations and I am just trying to narrow down the most realistic workflow without confusing myself, but UE4 does hold a lot of promise for realtime rendering.

                            Comment


                              #15
                              Originally posted by Haskellf View Post
                              [MENTION=59633]tupikp[/MENTION] I come from a feature film background, so realism and stylized renders are my preference. I am slowly transitioning from a Renderman, Vray and ClarisseIFX pipeline to that of UE4. It is great discovering the innards of the .ini files as it gives me greater control over the quality vs performance. Yes, performance is not a huge factor right now, but it will be when VR is put into the mix. For now, I have been reading through all the forum threads and trying to gain as much knowledge as possible.
                              I would be interested as to what workflow you are using in regards to Arch Viz? Are you using DFGI with DFAO and Raytraced DF or are you mixing Lightmaps with Dynamic lights? Is it even possible to mix Lightmaps with DFAO and raytraced DF? I haven't tried it but that is my next test on my list.
                              There are so many variations and I am just trying to narrow down the most realistic workflow without confusing myself, but UE4 does hold a lot of promise for realtime rendering.
                              I think you should start a new thread with that question, the last thread we had about Lightmass and settings went way off the rails and I personally would like this thread to stay strictly on Lightmass settings and the .ini file.

                              Comment

                              Working...
                              X