Turning off static shadow receiving for foliage

Hey,

I don’t want lightmass to calculate lightmaps for some foliage - mainly grass and small plants.
I saw this hint in the engine:

So I set the “Light Map Resolution” to 0.
However Unreal Engine does not agree with my plans. After I click “Enter” to set the value, the engine doesn’t respond for a short while and then promptly sets the Light Map Resolution back to 4.

I tried setting the lightmap resolution in the static mesh editor, but it has the same symptoms - can’t set it below 4.

So there’s the question:
How do I disable lightmap baking for some actors or some types of foliage?

Thank you.

Hi Deventico,

The default value is 4 even though the text bubble would indicate otherwise. The light map resolution override shouldn’t matter though since you’ve disabled the “cast static shadow” which will not use the overridden light map resolution.

If you’re building lighting and still seeing an issue let me know and I’ll look into it for you. :slight_smile:

Thank you!

Tim

Hey Tim,
thank you for your fast response!

The lighting build hasn’t finished yet, but there are first results:
When I build the scene without all that small vegetation, building it all takes about 5 minutes.
Now, after 10 minutes, only 4% are done. I’ll report back when it’s finished.

However I have one other question:
What exactly does “Cast static shadow” turn off or on? Can I have an actor which does cast shadows, but not receives them or vice versa?
In my head there is a difference between shadow casting and receiving, but I don’t know if UE differentiates between the two.

Hey Tim, Lightmass just finished.
This is the result:

As you can see, the grass on the right side receives shadows. This is not what I want.

My target is to have the grass completely ignored by lightmass.
It should neither cast nor receive shadows. Usually I’d do this by setting it “Movable”, but I can’t do that with foliage :confused:

And - on a side note - building the light now took 98 minutes instead of the 5 minutes it takes when I delete the grass.

Any help is much appreciated.

I tried building the grass a couple more times, but I can’t get it to work.

Not only can I make lightmass ignore the grass, but I also can’t save the built lightmaps. Once the build is complete, the lightmaps are loaded into the engine, which takes a couple minutes. But when I click the “Save” button, the engine crashes.

I don’t know what to do. I just want lightmass to ignore the grass. To shadow casting, no shadow receiving. Like a “Movable” object is ignored.

Is that possible?

We’re seeing this same problem since upgrading to 4.6

All foliage is Always receiving lightmaps. Turning off “cast static shadow” makes the foliage not cast shadows, but it still receives them… As Deventico said, you cant set the light map resolution override to 0… (we tried this in code and it just crashes)… As a huge terrain game, this makes it impossible to bake lighting anymore. We need a “Dont bake foliage” setting… either globally, or per foliage mesh.

As Helius stated, we need a switch named “Receive Static Shadow” (or the ability to set the shadow map to 0). Some way to not bake shadows on foliage. What you described was turning off the foliage’s ability to cast static shadows on other items.

Yeah, best would be a setting per foliage mesh, so you can still bake trees or other foliage.

There is something I want to clarify:

Building the lighting works, but

  • the results take too long and
  • can not be saved.

I opened another question for the issue of saving the lightmaps, since it’s a different problem.

I am having the inverse problem. I’m trying to make my foliage receive shadows but I cant…

Are there any specifics on materials or in the static mesh itself that I need to toggle to make lightmapss work properly?

Any progress on this ?

Hey w_jones,

What is the exact issue you are having, as there are a few different points made, and I would like some clarification on what you are experiencing.

Thanks,

Andrew

My issue is:

You need a lot of grass to cover a level.
If you let lightmass light the grass i.e. by setting the grass to static, then the memory used goes up and for me at least lightmass crashes.

So I set my grass to dynamic, so lightmess now ignores the grass, but theres a performance hit.

It would be best to leave the grass as static, but tell lightmass to ignore the grass. That way no crash, and no performance hit.

WJones

Uncheck the ‘Cast Static Shadows’ option, and leave it at static. That should solve the issue. Could you provide me with some screenshots of the foliage you have painted. Keep in mind, you should not exceed 4096x4096 shadowmap resolution per 100 painted instances (default cluster size).

Take a read over the documentation to see if you are able to improve your performance by using lower LOD’s and setting up culling distances correctly.