Download

How to remove stains on the lightmap?

Please tell me how to get rid of the stains in the lightmap, but leave the “static lighting level scale” 0.2 for sharper shadows. What are the parameters to be changed in the BaseLightmass.ini production Quality.

Screenshot_8.jpg
Screenshot_2.jpg
Screenshot_3.jpg
Screenshot_8.jpg

There won’t be a perfect solution. You’ve already got your settings very high, so we just need to make sure your UVs are perfect.

In the second image, in the left side of your circled area, that corner has some jagged edges poking out. This looks like your lightmap UVs are not perfectly laid out or the face extends beyond that wall intersection. Basically you’ll want every straight edge of your model to have straight UVs in your lightmap to avoid aliasing, and you want all your faces to stop at the point they intersect anything else. Dark pixels from an occluded part of the ceiling might bleed onto the bright part. And then snap your UVs to a grid that matches the resolution of your final map to ensure that every single lightmap pixel is exactly as it should be, not halfway in between an edge.

Even after you do that, Lightmass is imperfect. You may need to go into the BaseLightmass.ini settings and tweak a bunch of random stuff to fi your scene. But I haven’t gotten that far.

StephaBon thank you very much for the advice!

Not sure about the 0.2 static lighting scale…I’ve read somewhere on the forums that going that low require some tweaks in the lightmass.ini… I might be wrong but try it with 1.0 instead. Smoothness you can go lower without too much trouble I think. Try .65

What is the lightmap resolution of your meshes? if you have enough ram, put overkill values (I rarely use anything below 1024 for walls, floors and ceillings. And use uncompressed lightmaps.

heartlessphil lightmap resolution i have a wall 1024, floors and ceillings 2048 and use uncompressed lightmaps.

In the Internet found BaseLightmass.ini description of the parameters.
But I do not know which of these options can remove stains

[DevOptions.StaticLightingProductionQuality]

/** Number of shadow rays to trace to each area light for each texel. */
NumShadowRaysScale=32

/** Number of shadow rays to trace to each area light for each texel. */
NumPenumbraShadowRaysScale=64

/**

  • The number of high resolution samples to calculate per MaxTransitionDistanceWorldSpace.
  • Higher values increase the distance field reconstruction quality, at the cost of longer build times.
    */
    ApproximateHighResTexelsPerMaxTransitionDistanceScale=9

/**

  • The minimum upsample factor to calculate the high resolution samples at.
  • Larger values increase distance field reconstruction quality on small, high resolution meshes, at the cost of longer build times.
    */
    MinDistanceFieldUpsampleFactor=7

/**

  • Number of hemisphere samples to evaluate from each irradiance cache sample when not using path tracing.
  • When photon mapping is enabled, these are called final gather rays.
    */
    NumHemisphereSamplesScale=64

/** Number of importance photons to find at each irradiance cache sample that will be used to guide the final gather. */
NumImportanceSearchPhotonsScale=6

NumDirectPhotonsScale=32
; Decrease direct photon search distance so that we will have more accurate shadow transitions. This requires a higher density of direct photons.

/** Distance to use when searching for direct photons. */
DirectPhotonSearchDistanceScale=.5

NumIndirectPhotonPathsScale=32
; Need a lot of indirect photons since we have increased the number of first bounce photons to use for final gathering with NumImportanceSearchPhotonsScale

NumIndirectPhotonsScale=64

NumIndirectIrradiancePhotonsScale=32
; Decreasing the record radius results in more records, which increases quality

/** Scale applied to the radius of irradiance cache records. This directly affects sample placement and therefore quality
RecordRadiusScaleScale=.45

/** Maximum angle between a record and the point being shaded allowed for the record to contribute. */
InterpolationMaxAngleScale=.75

IrradianceCacheSmoothFactor=.75

/** Number of recursive levels allowed for adaptive refinement. This has a huge impact on build time but also quality. */
NumAdaptiveRefinementLevels=3

/** Starting threshold for what relative brightness difference causes a refinement. At each depth the effective threshold will be reduced. */
AdaptiveBrightnessThresholdScale=.25

/** Starting threshold for what angle around a first bounce photon causes a refinement on all cells affected. At each depth the effective threshold will be reduced. */
AdaptiveFirstBouncePhotonConeAngleScale=2.5

Do you have enough spacing between you uv map islands? I use flatten mapping with 0.02 spacing to make sure they don’t overlap.

Yes, I use flatten mapping with 0.02 spacing
ca886b8d23d099fc37650dc727cb3d63a3bd6841.jpeg

I separate each wall mesh
7b97cff9e93809206afaddaec0213b5269768c82.jpeg
Screenshot_6.jpg

The tops of the walls should not be there, and no wall surfaces should overlap. Also, your ceiling and floor should not go past the wall boundaries.

So, it is better to delete faces you won’t see ingame? For example top of the walls covered by the ceiling, bottom of the floor, faces between meshes, etc. I usually left those with a smaller uvmap but it would be better to just delete them and earning more lightmap resolution with less faces. I never tried that.

Thank guys!

I increased Static Lighting Level Scale to 0.5, once all was smooth and no artifacts.

Time building Lighting preview quality 1 hour 12 min on machine with i7 950 3.07 GHz RAM 24 Gb

Screenshot_7.jpg

Screenshot_9.jpg

Screenshot_10.jpg

Screenshot_11.jpg

It is not detailed shadows, if you increase the setting Static Lighting Level Scale more than 0.2
Screenshot_13.jpg

like here:

&d=1434684128

I just detach the face in max and use a big lightmap res for the visible faces and use lower lightmap res for the rest of the mesh. I leave them cause they can block light coming from under or behind…

Rafareis123 said he tweaked the ini to make the scale at 0.2 work well…If you don’t tweak the ini, I think you won’t get good results with 0.2
What do you think?

Do you use a skylight or only a directional light? Cause Rafareis123 use a skylight and I do too!

Try reducing Indirect Lighting Smoothness to 0.6? That could give more shadow detail for Static Lighting Level Scale at 0.5.

Yes, I use only skylight and directional light.

Here is my scene:

41c979444d13fadc576e69cb19b13307989cba0e.jpeg

Returned option Static Lighting Level Scale 0.2.

And change settings BaseLightmass.ini from koola:

DevOptions.StaticLightingProductionQuality]
NumShadowRaysScale=32
NumPenumbraShadowRaysScale=64
ApproximateHighResTexelsPerMaxTransitionDistanceScale=9
MinDistanceFieldUpsampleFactor=7
NumHemisphereSamplesScale=64
NumImportanceSearchPhotonsScale=6
NumDirectPhotonsScale=32
; 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=32
; Need a lot of indirect photons since we have increased the number of first bounce photons to use for final gathering with NumImportanceSearchPhotonsScale
NumIndirectPhotonsScale=64
NumIndirectIrradiancePhotonsScale=32
; Decreasing the record radius results in more records, which increases quality
RecordRadiusScaleScale=.45
InterpolationMaxAngleScale=.75
IrradianceCacheSmoothFactor=.75
NumAdaptiveRefinementLevels=3
AdaptiveBrightnessThresholdScale=.25
AdaptiveFirstBouncePhotonConeAngleScale=2.5

On machine with i7 950 3.07 GHz RAM 24 Gb It’s been 27 hours time it holds only 18%

7088ff23b4ee624dd00b23cf0f6d20b3f00f8b99.jpeg