# Foliage lighting differs from static mesh lighting

**URL:** <https://forums.unrealengine.com/t/foliage-lighting-differs-from-static-mesh-lighting/372257>\
**Category:** World Creation\
**Tags:** static-lighting, unreal-engine, Foliage, question\
**Created:** [October 2, 2016, 9:22pm UTC](https://forums.unrealengine.com/t/foliage-lighting-differs-from-static-mesh-lighting/372257 "2016-10-02T21:22:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AquilaAbriel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AquilaAbriel](https://forums.unrealengine.com/u/AquilaAbriel)\
**Post date:** [October 2, 2016, 9:22pm UTC](https://forums.unrealengine.com/t/foliage-lighting-differs-from-static-mesh-lighting/372257/1 "2016-10-02T21:22:14Z")

</div>

Hello everyone. Today I ran into a problem I can’t fix by myself.  
How do I achieve correct static lighting on foliage?  
Static and dynamic shadows are enabled within the foliage tool settings.

 ![109394-pic1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/4/9/149516116ebc1184b1f2cdb1365e948356ff5637.jpeg)

The trees on the left were placed by the foliage tool. The one on the right is a regular static mesh.  
As you can see, there is a significant difference in the way the static lighting affects them.

 ![109395-pic2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/9/a/d9ab37a83ede64f969fef8272f0a6492b4f9d5c1.jpeg)

By enabling distance field ao the outdoor lighting gets much more consistent.  
But there is a drawback, to enable dfao I have to change the skylight to movable.  
This results in the outdoor lighting to improve greatly while the lindoor lighting suffers in contrary.

 ![109396-pic3.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/c/c/5cc00b5ac814b3247a3734ad39f9aff9c055254b.jpeg)

Indoor static lighting with stationary skylight.

 ![109397-pic4.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/4/4/f44dcbb4f5163bc8709c936afde03562c1a3711c.jpeg)

Indoor lighting with movable skylight and dfao.

So I have two questions:

Is there something wrong with my lighting setup, which results in broken baked lighting on foliage?  
Or alternatively. Is there a way to use dfao (movable skylight) and baked lighting together?

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![AquilaAbriel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AquilaAbriel](https://forums.unrealengine.com/u/AquilaAbriel)\
**Post date:** [October 3, 2016, 1:16pm UTC](https://forums.unrealengine.com/t/foliage-lighting-differs-from-static-mesh-lighting/372257/2 "2016-10-03T13:16:02Z")

</div>

OK, I figured it out. Obviously a lightmap size of 16 per instance was not sufficient. A lightmap size of 64 works much better.

But I am still curious if it is possible to use dfao and baked lighting together.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6e7b421a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6e7b421a](https://forums.unrealengine.com/u/anonymous_user_6e7b421a)\
**Post date:** [October 4, 2016, 6:50pm UTC](https://forums.unrealengine.com/t/foliage-lighting-differs-from-static-mesh-lighting/372257/3 "2016-10-04T18:50:35Z")

</div>

Hey AquilaAbriel,

The short answer to your question is yes, but you have to use a movable skylight and a stationary directional light. The stationary directional light will allow you to bake your lighting and transition to dynamic shadows, and the movable skylight will let you implement the DFAO.

**[Distance Field Ambient Occlusion](https://docs.unrealengine.com/latest/INT/Engine/Rendering/LightingAndShadows/DistanceFieldAmbientOcclusion/)**

The above link will give you a more in depth explanation of Distance Field ambient occlusion and the technical details and limitations to the feature.

Thank you,

---

<div class="post-metadata">

**Author:** ![Calypso](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Calypso](https://forums.unrealengine.com/u/Calypso)\
**Post date:** [October 4, 2016, 9:45pm UTC](https://forums.unrealengine.com/t/foliage-lighting-differs-from-static-mesh-lighting/372257/4 "2016-10-04T21:45:02Z")

</div>

The console command r.AOApplyToStaticIndirect will allow you to combine baked lighting from a stationary skylight and distance field AO. You can adjust its max distance in the world settings with the Global distance field max distance value, though minimum brightness and contrast values don’t seem to be exposed like when using a movable skylight.
