Lighting build on random objects

Hello,

I have a question about random generated environments.
We would like to generate a random environment with random objects etc.

Now we want the objects to have nice lighting. But when you generate the environment random on begin play it will not have lighting build off course. But is there a possibility to duplicate an object a couple of times with lighting build and use it on other positions.

As seen in the screenshot, we would like to have our random objects look like the right object, but now they all look like the left… Both objects are same model and material, but one is without lighting and the other with.

Any help or advice appreciated

EDIT: Some extra info, we are using random creation on begin play and other moments, because we want to regenerate the environment during gameplay. So we cannot use on construction… :frowning: ( I think)

Hi SoulRyder,

If you’re spawning everything in on event begin play you will not be able to use baked lighting. The lighting that is calculated is only done so when the objects have their lighting built. This cannot be copied between other objects like you’ve described.

Since there is not a good solution for dynamic GI at the moment in UE4 you’re more likely to run into issues where you will get the lighting like you have on the left side.

The only alternative that I can think of would be that if you had some form of geometry that was static in your world and you build lighting for that object you can use volume light samples to light dynamic objects. This would only work if there were geometry below it to give indirect (bounce) light. If your objects will be floating in the world there would not be any volume light samples to light dynamic objects in a statically lit world.

It may seem a bit confusing, but I hope this helps.

Tim

Hi Tim,

Thanks for the response! I already thought it wouldn’t be possible but I wanted to make sure. Unfortunately objects are floating so that solution will probably not work either. We will find some other way of fixing this though. We only have a prototype thus far with programmer art. And we are just working on picking an art style for the game, so we can take this in consideration!

Thanks

Alexander

One alternative that I did think about that could work to give you the volume light samples to use.

You can setup the meshes to generate the Volume Light Samples and set the option for each of these meshes as “Actor Hidden in Game”. This will not wipe the VLS. I’ve attached a video for demonstration which is simply moving a sphere through a statically lit world. It’s not going to be as accurate as baked lighting but it will light the object in dark areas or light areas based on the VLS.

[link text][1]

In this image, this is while playing in game. I’ve enabled Volume Light Samples to display, so as you can see where my red/blue and shadowed meshes were the VLS is still there to provide some color lighting where needed.

Maybe this will work for your needs or not, but it’s an alternative that you can try if you think it will work for your game.

Thanks Tim, I will look into that!