Bug (?) in Foliage Lightmap placed in Sublevel and lit with static light scenario

Hi everybody.

We are actually working with foliage and encountered a strange behavior at lightmass creation.
It seems to happen in very specific case, so we tried to reproduce the bug.

For short, Lightmaps on foliage creates artefacts when the foliage is placed in a sublevel, lit by another sublevel (tagged as light scenario) and played in the stand alone mode (or cooked in an app)
Please find below the steps in order to reproduce it :

-STEP_01-
Start with an empty map and create 3 sublevels (create the sublevels with the ‘create new’ button and don’t try to duplicate existing sublevel to save time (it creates bugs with Volume Lights Samples)
Change the streaming method of the first one with ‘Always Loaded’ and tag the second one as a Light Scenario.
You should now have something like that :

- STEP_02-
Add some static lights in you LIght Scenario Sublevel.
Let’s say a directional and a SkyLight.
Set-up your Light Scenario Sub Level as it will be initially Loaded and visible.

- STEP_03-
Now add any static mesh to your foliage library.
First difference as working with foliage without sub levels : A popup window opens and ask you to automaticaly create a Foliage Type Asset based on your static mesh.

- STEP_04-
Build the light (no matter which Lighting Quality)
Everything look fine in the viewport …

- STEP_05-
Play the game (in active viewport or in Standalone game mode) … and … ooooch … lightmaps suddenly looks psychedelic …

As we use the Light Scenario in most of our apps it sounds like an issue.

From your perspective, is it a bug or did we make something wrong in creating our Sub Levels ?

Feel free to ask if you need more information.

Best regards,

:slight_smile:

EDIT :
Seems to happen only in 4.17
I converted my scene to 4.18 (preview 4) and the bug didn’t occurred
Feel free to confirm
Best,

Hi cs2010,

I’m glad to hear the bug isn’t occurring for you in 4.18. I am going to close this ticket now, but feel free to leave a comment to reopen the thread if the issue comes back up.

In case some like us noticed this bug and is still using 4.17 a slight tweak to InstancedStaticMesh.cpp will fix it.

Change:

    void UInstancedStaticMeshComponent::PropagateLightingScenarioChange()
    {
    	FComponentRecreateRenderStateContext Context(this);
    }

To:

void UInstancedStaticMeshComponent::PropagateLightingScenarioChange()
{
	FComponentRecreateRenderStateContext Context(this);

	if (PerInstanceRenderData.IsValid())
	{
		PerInstanceRenderData->UpdateInstanceData(this, 0, PerInstanceSMData.Num());
	}
}

Hi everybody,
Sorry for reopening the post.
It seems the bug happens again in 4.20.2
Does anyone have the same problem?
If so did the tweak given by Steven solves the problem?
Thanks in advance for your reply.
:slight_smile:

I have noticed that after a bake id get weird psychedelic colours but once i saved the level and went back into it the light maps looked correct

Thanks Steven
Yeah that’s right but unfortunately to psychedelic colors are back when you cook your app and launch the .exe file :frowning:

suffer the same problem in 4.20.1 and 4.21.1