Fix baked lighting artifacts such as dark spots, smudges, shadow leaks, blocky textures, or incorrect shading when using baked Global IlluminationA group of techniques that model both direct and indirect lighting to provide realistic lighting results.
See in Glossary (GI).
Fix distorted or warped surfaces and shading or darkening issues.
When importing a 3D model, generating lightmaps, or setting up baked lighting in a scene, improperly configured or missing lightmapA pre-rendered texture that contains the effects of light sources on static objects in the scene. Lightmaps are overlaid on top of scene geometry to create the effect of lighting. More info
See in Glossary UVs can cause visual distortions on lightmapped surfaces.
Artifacts caused by incorrect lightmap UVs typically appear as:
Distorted or warped surfaces on objects.
Shading or darkening issues, particularly around edges.
Example: Severe artifacts on objects with missing lightmap UVs (left) compared to correctly authored lightmap UVs (right).
Lightmap UVs have specific requirements distinct from standard texture UVs:
No overlapping UV shells.
Adequate padding between UV shells to prevent light bleed.
Minimal distortion in area and angles.
Uniform scaling across UV shells.
UV shells confined within the [0,1] UV space.
Failure to meet these criteria can result in artifacts after baking the lightmap.
You can resolve these issues by addressing improperly configured lightmap UVs, invalid texels, compressionA method of storing data that reduces the amount of storage space it requires. See Texture Compression, Animation Compression, Audio Compression, Build Compression.
See in Glossary problems, light probeLight probes store information about how light passes through space in your scene. A collection of light probes arranged within a given space can improve lighting on moving objects and static LOD scenery within that space. More info
See in Glossary ringing, or denoising and filtering artifacts.
Note: Use the UV Overlap and Baked Lightmap debug draw modes to identify lightmap UV issues.
To resolve lightmap UV problems, follow these steps.
To generate lightmap UVs, refer to Generate lightmap UVs.
Tip: In Unity 2020.1 and later versions, the Auto Pack Margin feature optimizes generated lightmap UVs. For more information, refer to this Unity Forum discussion.
For complex models, manually authoring lightmap UVs in a digital content creation (DCC) program may yield better results. Ensure the UVs are placed in the second (UV1) channel.
Use the lowest resolution that resolves the artifacts to minimize memory usage and bake times.
Fix blocky artifacts in baked lightmaps and red-highlighted texels in the Texel Validity scene viewAn interactive view into the world you are creating. You use the Scene View to select and position scenery, characters, cameras, lights, and all other types of Game Object. More info
See in Glossary mode.
When baking a lightmap or optimizing a scene in the Editor’s Lighting or Scene view, invalid texels in lightmaps can cause blocky artifacts.
Scenes with invalid texels may display:
Blocky artifacts in baked lightmaps.
Red-highlighted texels in the Texel Validity scene view mode.
Example: One-sided curtain meshThe main graphics primitive of Unity. Meshes make up a large part of your 3D worlds. Unity supports triangulated or Quadrangulated polygon meshes. Nurbs, Nurms, Subdiv surfaces must be converted to polygons. More info
See in Glossary causing invalid texel artifacts after baking (left). The Texel Validity scene view mode highlights these invalid texels in red (right), particularly around the curtain area.
Invalid texels occur when:
Texels fail to receive light from direct, indirect, or environment sources.
Rays originating from texels intersect back-facing surfaces.
Filtering and denoising can spread invalid texels to neighboring areas. Resolving them early minimizes reliance on post-processingA process that improves product visuals by applying filters and effects before the image appears on screen. You can use post-processing effects to simulate physical camera and film properties, for example Bloom and Depth of Field. More info post processing, postprocessing, postprocess
See in Glossary.
Note: Use the Texel Validity scene view draw mode for effective debugging.
Ensure visible polygons have outward-facing normals to avoid shading errors.
Vertex normal direction determines which side of the polygon appears as the front (visible) side. Flipping the direction of the normal renders the face invisible unless you are using double-sided shadersA program that runs on the GPU. More info
See in Glossary. Always ensure that the polygons, that you want to be visible, have their normals pointing outwards.
Example: Proper shading with outward-facing normals on the center cube. Blue polygons in the cube on the left and orange polygons in the cube on the right are flipped. Cubes on the left and right both exhibit invalid texel artifacts after baking, whereas the one in the center doesn’t.
Most 3D modeling applications generate correct normals automatically.
To manually adjust normals, refer to your 3D modeling package documentation.
To reduce the likelihood of invalid texels with watertight meshes, follow these steps:
Cap open faces.
Weld overlapping vertices.
Avoid using line or point geometry.
Limit floating geometry to necessary cases.
Tools like xView in 3ds Max can help identify mesh issues.
For thin, one-sided meshes like curtains or foliage, enable Double-Sided Global Illumination.
Example: Enabling double-sided GI resolves invalid texels and enhances light bounce for one-sided meshes. The Texel Validity scene view no longer shows any invalid texels in red around the curtains (right). Notice that not only the artifacts are gone, but the light also bounces off curtains.
To enable Double-Sided Global Illumination, follow these steps:
For the Built-in Render PipelineA series of operations that take the contents of a Scene, and displays them on a screen. Unity lets you choose from pre-built render pipelines, or write your own. More info
See in Glossary, enable the Double-Sided Global Illumination checkbox in the Material Inspector.
This step also applies to custom ShaderGraph materials.
For the Universal Render Pipeline (URP), set the Render Face dropdown to Both. You can find this property under the Surface category in the Lit Shader.
For the High Definition Render Pipeline (HDRP), navigate to the Surface category in the Lit Shader and configure the following properties:
You can also control the double-sided GI property via the kDoubleSidedEnable API.
Example: Double-Sided Global Illumination disabled (left) and enabled (right). Notice dark artifacts where the meshes intersect in the image on the right. In such cases, disable Double-Sided Global Illumination to achieve correct output.
Lightmapper marks texels as invalid when they receive no illumination or intersect backfaces. This allows the dilation filter to push lighting data from valid surrounding texels into partially covered texels. Doing so helps to remove dark artifacts at geometry junctions.
Enabling double-sided GI by default for all materials would result in a darkening effect where meshes intersect or overlap.
To configure the Backface Tolerance property, follow these steps:
Create a new Lightmap Parameters asset.
Navigate to the Lightmapping section in the Mesh RendererA mesh component that takes the geometry from the Mesh Filter and renders it at the position defined by the object’s Transform component. More info
See in Glossary component.
Assign the Lightmap Parameters asset to the Mesh Renderer component.
The Backface Tolerance property controls the percentage of rays that must hit front-facing geometry to consider a texel valid:
Increasing the value increases the likelihood that the lightmapperA tool in Unity that bakes lightmaps according to the arrangement of lights and geometry in your scene. More info
See in Glossary marks a texel as invalid when it encounters backfaces.
Lowering this value reduces the number of invalidated texels.
Note: Low Backface Tolerance values may result in a loss of occlusion and/or bounce lighting, potentially altering the appearance of the scene.
Limitations imposed by the 32-bit floating-point precision format can be the cause of invalid texels when placing lightmapped meshes far away from the world origin (0,0,0), or if they have a massive scale. This issue is not limited to lightmapped meshes; objects and animations lose precision the farther away they are from world origin.
To solve precision issues, follow these steps:
Move meshes closer to the (0, 0, 0) origin.
Adjust the Push Off value in the Lightmap Parameters asset.
Fix smears, smudges, or ringing around edges and black lightmaps or excessive noise.
When configuring denoising settings to bake a lightmap in the Editor’s Lighting or Scene view, machine learning denoisers may introduce artifacts.
Denoising artifacts may include:
Smears, smudges, or ringing around edges.
Black lightmaps or excessive noise when denoising fails.
Example: Severe artifacts with low sample counts (left), while higher sample counts produce cleaner results (right). Denoising Artifacts with Open Image Denoiser enabled. Severe artifacts are visible when all sample counts are set to 32 with the Open Image Denoiser enabled (left). The image is cleaner with all sample counts set to 2K and the Open Image Denoiser enabled (right).
Denoising artifacts typically occur in the following scenarios:
Indirect noise often contributes significantly to poor results.
Most denoisers perform effectively with at least 256 samples. You can improve denoising performance by increasing the sample count.
To select a specific denoiser based on the scene’s characteristics, follow these steps:
Set Filtering to Advanced.
Refer to Progressive GPU.
Specify the desired denoiser for direct, indirect, and ambient occlusionA method to approximate how much ambient light (light not coming from a specific direction) can hit a point on a surface.
See in Glossary buffers.
To use Gaussian or A-Trous filters, follow these steps:
Set Filtering to Advanced.
Refer to Progressive GPU.
Choose the desired filter type.
You can combine these filters with machine learning denoisers for enhanced results.
Fix Gaussian light leaks, blurs, and splotches, A-Trous speckles, and HDR denoise failures.
When baking a lightmap in the Editor’s Lighting or Scene view, using a Gaussian or an A-Trous filter to reduce noise can create artifacts.
Filtering artifacts depend on the filter type:
Example: Scene filtered using Gaussian filter at a 1 texel radius. With all samples set to 32, the final lightmap exhibits splotches (left). Baking with all samples set to 2K and with Gaussian filtering enabled yields better results (right).
Example: Scene filtered using A-Trous filter. With all samples set to 32, A-Trous edge preservation algorithm cannot distinguish between noise and edges, and thus completely fails (left). After increasing all samples to 2K, A-Trous filter yields decent results, with less blurring when compared to Gaussian (right).
Filtering artifacts causes depend on the filter type:
Gaussian Filter:
A-Trous Filter:
You can reduce artifacts such as splotches or speckles by increasing sample counts.
Machine learning denoisers effectively remove noise with fewer biases compared to traditional filters. Combining them with filters can enhance results:
To adjust the filtering strength, adjust the filter’s radius and sigma. If your scene has lightmap leaking artifacts or blurring, reduce the Gaussian** filter’s radius value. This reduces the amount of bilateral blurring and prevents texel smearing.
Refer to Progressive GPU.
Fix color banding and blocky artifacts.
When optimizing lightmaps for mobile performance during lightmap baking or asset compression in the Editor’s Lighting or InspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More info
See in Glossary windows, artifacts can occur.
Color banding and blocky artifacts.
Example: Banding artifacts introduced by low-quality compression on Android platform (left). You can fix banding artifacts by using high-quality compression (right).
Color banding and blocky artifacts are often associated with low-quality texture compression3D Graphics hardware requires Textures to be compressed in specialized formats which are optimized for fast Texture sampling. More info
See in Glossary. Unity attempts to select automatically the best compression format for the target platform. Due to compatibility concerns, texture formatsA file format for handling textures during real-time rendering by 3D graphics hardware, such as a graphics card or mobile device. More info
See in Glossary intended for mobile platforms are often more affected by compression artifacts.
To adjust lightmap encoding, follow these steps:
Open Edit > Project Settings > Player > Other Settings.
Modify the Lightmap Encoding setting for each target platform.
To configure HDR cubemapA collection of six square textures that can represent the reflections in an environment or the skybox drawn behind your geometry. The six squares form the faces of an imaginary cube that surrounds an object; each face represents the view along the directions of the world axes (up, down, left, right, forward and back). More info
See in Glossary encoding for reflective objects with compression artifacts, follow these steps:
Open Edit > Project Settings > Player > Other Settings.
Modify the HDR Cubemap Encoding setting.
Note: The HDR Cubemap Encoding setting is available in Unity 2022.1 and later.
To control compression quality, follow these steps:
Go to Window > Rendering > Lighting.
In the Lighting window, locate the Lightmaps tab.
Find the Lightmap Compression dropdown under the Lightmaps settings section.
Select a compression quality.
Higher quality presets result in fewer compression artifacts post-bake.
To manually override texture formats, follow these steps:
Locate the lightmap textures in the Project window.
Select a lightmap texture.
In the Inspector window, enable the Override checkbox for the desired platform.
Select the desired compression format.
Click Apply.
Note: Custom overrides reset after rebaking lighting. Repeat these steps after each bake.
Fix unnatural probe lighting and visible rippling artifacts.
When setting up light probes or baking lightmaps in the Editor’s Lighting or Scene view, ringing artifacts in light probes can cause incorrect shading.
Objects lit by light probes exhibit unnatural lighting.
Visible rippling or artifacts around light probes.
Example: Remove Ringing disabled (left) and enabled (right). Notice how negative light probe values result in wrong shading for the statue on the left. You can fix this issue by enabling the Remove ringing option, but as a result, the final output can appear very smooth.
When intense light hits a light probe, the light signal does not decay across its surface. Instead, it ripples through the light probe, like a wave. As a result, the affected part of the probe stores negative light values. This phenomenon manifests itself as a ringing artifact that results in wrong lighting.
Note: To make debugging easier, enable GizmosA graphic overlay associated with a GameObject in a Scene, and displayed in the Scene View. Built-in scene tools such as the move tool are Gizmos, and you can create custom Gizmos using textures or scripting. Some Gizmos are only drawn when the GameObject is selected, while other Gizmos are drawn by the Editor regardless of which GameObjects are selected. More info
See in Glossary in the sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary viewportThe user’s visible area of an app on their screen.
See in Glossary and adjust the Light Probe Visualization property in the workflow settings.
To remove light probe ringing, follow these steps:
Select the Light Probe GroupA component that enables you to add Light Probes to GameObjects in your scene. More info
See in Glossary component.
Enable the Remove Ringing property.
Note: This option reduces contrast in probe-lit objects. Disable it if your scene does not exhibit ringing artifacts.
To mitigate ringing artifacts caused by high-intensity direct lighting, follow these steps:
Lower the Intensity value in the Light component.
Use mixed lightsLight components whose Mode property is set to Mixed. Some calculations for Mixed Lights are performed in advance, and some calculations for Mixed Lights are performed at runtime. The behavior of all Mixed Lights in a Scene is determined by the Scene’s Lighting Mode. More info
See in Glossary to balance real-time direct lighting and baked indirect lighting.
Smooth hard edges and lighting discontinuities at seams and chart boundaries.
When using baked lightmaps with the Progressive Lightmapper, you may notice:
Hard edges appearing along seams between separate mesh faces.
Visible discontinuities in lighting at chart boundaries in the lightmap.
When Unity bakes lightmaps, it treats mesh faces that are close together but separate as distinct in lightmap space, creating edges known as seams.
Ideally, seams are invisible, but they can sometimes appear with hard edges. This happens because the GPU cannot blend texel values between separated charts in the lightmap, treating them as distinct entities and causing visible discontinuities.
Seam stitching smooths hard edges on GameObjectsThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary rendered with baked lightmaps from the Progressive Lightmapper. When enabled, Unity performs additional calculations to improve the appearance of seams in the lightmap. While stitching isn’t perfect, it often significantly enhances the final result. However, this feature increases baking time, so it is disabled by default.
When active, the lightmapper identifies pairs of edges to stitch and smooths the illumination across seams. This applies only to straight edges that run horizontally or vertically along chart boundaries in the atlas and works with axis-aligned rectangles in UV space.
Note:
To smooth hard edges:
Select a GameObject with a Mesh Renderer component in the scene.
In the Mesh Renderer Inspector, in the Lightmapping section, enable Stitch Seams.
Alternatively, use the MeshRenderer.stitchLightmapSeams API to programmatically enable seam stitching.
Example: A Scene with seam stitching.
Fix lightmap aliasing, UV overlaps, and red highlight warnings.
Light bleeding typically manifests as:
Example: Red pixelsThe smallest unit in a computer image. Pixel size depends on your screen resolution. Pixel lighting is calculated at every screen pixel. More info
See in Glossary indicate overlapping chart neighbourhoods.
Light bleeding occurs when data from one lightmap chart spills onto another due to insufficient spacing between charts, leading to graphical artifacts such as aliasing or pixelation.
Each lightmap comprises multiple charts, which Unity maps to mesh faces at runtime. These charts store lighting data used to calculate the final appearance. During rendering, the GPU samples lighting data by interpolating the values of the four nearest texels, known as the bilinear neighborhood. When charts are placed too closely, their neighborhoods overlap, causing light bleeding. Factors influencing this issue include lightmap resolution, mesh UVs, and Importer settings. Unity provides tools to detect and address these problems.
Example: Graphical artifacts due to chart bleeding.
Light bleeding is caused by overlapping chart neighborhoods in the lightmap. This occurs when there is insufficient spacing between charts, often due to:
To resolve light bleeding, follow these steps.
If providing UVs manually, increase the margins using your 3D modeling software.
For Unity-generated UVs, go to the Model Import Settings and:
Refer to the Generating lightmapping UVs documentation for more details.
To increase resolution globally, adjust the Lightmapper Settings in the Lighting tab.
To increase resolution for a specific GameObject, modify its Lightmap Settings in the Mesh Renderer component.
Enable the UV Overlap draw mode in the Scene View to highlight problematic texels.
Example: Scene View using UV Overlap draw mode (see dropdown in top left).
Use the Baked Lightmaps Preview to view and diagnose UV overlaps in the Lighting window.
Example: The Baked Lightmaps Preview in the Lighting window’s Baked Lightmaps tab.
By implementing these solutions, you can minimize or eliminate light bleeding artifacts.
Example: Same mesh as before, but without bleeding artifacts.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.