Why is my mesh completely black when movable on IOS?

Hi all,

I encounter an issue to obtain correct lightning on a simple StaticMesh (a rotating sphere) with the mobility set to movable on iOS (iPadMini2). All goes right while my StaticMesh mobility is set to static but as soon as it’s set to movable, it becomes totally black. (Play mode on PC works fine only mobile preview/device fails).
Seems there’s only pre-bake lighting that do not apply when movable is set. So is there special presets to light movable StaticMesh on iOS devices?
My map contains only

  • a StaticMesh (imported from .fbx) encapsulated in a blueprint with a rotating function
  • a Material (texture0 to Base Color and texture1 to Normal)
  • a Directional Light set to stationary.

I tried all the possible combinations (sort of light / mesh / mobility) and build the map several times from ground (empty model with no code) letting all the parameters by default just tweaking one by one those of interest. I notice that in the material Usage section in Detail panel, the field Used with static light is forced true when launching on mobile device. I also check the Force No Precomputed Light option in the World Settings, in this case render is black too. In all the mobile samples, either the materials are unlit (FlappyChicken, MemoryCard) either all the meshes are set to static (Mobile Temple). I checked to Unreal documentation on lightning for mobile platform here but no clues. Any ideas?

in advance!

What version are you on 4.0 or 4.1? In 4.0 the Side Scroller template had an unlit character and part of the floor was unlit on device. That was fixed in 4.1 and was a bug with the way lighting was being calculated for moving objects. That may fix your issue. If you are on 4.1, let me know and I will see if I can reproduce the issue.

-Pete

Updated to 4.1.1. I get the lightning works propertly only if I add the floor default mesh (SM_Template_Map_Floor) removing all other actors for the default map. If I delete it nor move it too far away (not visible in the viewport) my movable StaticMesh goes away.

I’ve been struggling with this exact issue as well with no solution so far, only using Android :frowning:

Ok, let me get some of our QA staff looking in to this to see if it is just a bug we missed.

-Pete

Movable objects are lit through Lightmass-computed light probes. You can visualize these with Show->Visualize->Volume Lighting Samples. The probes are automatically placed everywhere inside the lightmass importance volume and above shadow casting surfaces.

I can’t think of a reason that a movable static mesh would render correctly on PC but not mobile. We do have some movable objects in other mobile maps that are working correctly.

Hi
You were totally right. My LightMassImportanceVolume (LMIV) was really too small (just fitting my mesh), consequently, no probe was visible in views (not present/generated?). Just scaling the LMIV (from 300 units to 10,000 units) resolve the issue, probes were there so my lit movable mesh.
Nevertheless the PC (Mac actually) rendering works in any case while the mobile one works only with the fixed LMIV size. Why is a good question isn’t it? :wink:
For newbie like me totally ignoring this aspect of lighting here is the doc link text.
In any case a lot! :slight_smile:

The docs say the following about LIV:

“Lightmass places samples in a uniform 3d grid inside the LightmassImportanceVolume at a low resolution, and also on top of upward facing surfaces that characters are likely to walk on, at a higher resolution. Each lighting sample captures indirect lighting from all directions, but not direct lighting.

Does that imply that it is impossible for a movable object to receive direct lighting? Is it impossible to have a scene consisting of a single spinning object and a single static light to receive lighting at all as in my example above?

EDIT: Just to clarify, say I am trying to make a game consisting only of moving objects without an environment to speak of, for instance spaceships flying in space (like Star Control 2, or Homeworld). Only direct lighting is meaningful in that case, how would I go about making sure my moving objects receive it?

Does that imply that it is impossible for a movable object to receive direct lighting?

No, the part of the doc you quoted is only talking about Stationary lights on PC. Basically there’s a 3d matrix of movable object lighting scenarios:

  • For a static light, both direct and indirect lighting go into the volume lighting samples.
  • For a stationary light, with D3D10 / 11 indirect lighting goes into the volume lighting samples, but direct lighting is applied dynamically. This is why characters can receive high resolution shadows on their backs from static foliage above them. With the mobile path, both direct and indirect lighting go through the volume lighting samples.
  • For a movable light, with D3D10 / 11 all lighting is fully dynamic, no volume lighting samples. Movable lights not currently supported on mobile.

Now it gets sliiiiightly more complicated because there’s a special case on mobile for Stationary directional lights - only the shadowing of the directional light comes from the volume lighting samples, the direct lighting is applied dynamically.

The reason this is all so complex is that we want to get the highest quality we can on D3D, while getting the best perf we can on Mobile. You probably don’t need to know those details. Just know this:

Your scenario should work fine, just make sure the movable objects are inside a lightmass importance volume so the volume lighting samples get placed.

I’m finding the same thing. Moveable objects are lit if they’re close to a static object but if they’re not close to one then they’re unlit.

Thank you for the explanation, it makes it very clear what is going on.

Unfortunately, the observed lighting behavior still does not match what you have
described, specifically that

For a static light, both direct and indirect lighting go into the volume lighting samples.

In this test scene I have two spheres, one of which is marked as movable and the other is marked as static. There is also a point light marked static. Lighting has just been built. Both objects and the light are within the LIV. The lighting is correct on the static sphere, but not on the movable sphere. The visualized lighting samples all show up as dark blue (they are better seen in full-size screenshots), which is the scene’s ambient lighting, and are unaffected by the point light. Consequently, the movable sphere is rendered dark blue. This is not specific to mobile, the same behaviour can be seen on the PC preview as well:

In this scene I have changed the light type to stationary. The PC rendering is now correct:

Mobile does not support stationary point lights, so the movable sphere is dark as expected.

(continued below)

(continued)

In this scene I have replaced the point light with a static directional light. Lighting looks a bit off on the movable sphere, but the volume lighting samples are now affected by the light, as expected:

Finally, I set the directional light to stationary. It is no longer affecting the volume lighting samples, however it is now being rendered correctly on both platforms. I assume this is the only case where dynamic lighting is applied on mobile:


To summarize: direct lighting from static point lights is not being sampled by Lightmass into the lighting volume, and unless there is an additional surface to provide secondary lighting the point light is ignored for movable objects.

I tried this out and saw the same result at first. The volume lighting samples are placed sparsely in 3d space and more densely above surfaces. Because the test case is floating in space it only places them very far apart. So the point light often doesn’t affect a volume lighting sample very noticeably (esp since light attenuation falls off so quickly) and therefore doesn’t affect the movable sphere. If I scale up the light to be much larger, it did affect the movable sphere. Can you confirm that happens in your test scene too?

So static point lights work on movable meshes as long as the light is large enough, and the movable mesh is close to the ground. This is clearly not very robust and I’m going to think of ways it can be improved. Something like per-object lighting would work much better for point lights.

Yes, that is what happens for me as well - if I move the light very close to one of the sample points it gets lit.

Thank you very much for explaining all this!