Objects render black after switching to feature level es2

I have an empty scene where I spawn all my actors dynamically through code and while I was previewing in the normal shader model 5, it looked fine but after I switched the feature level to es2 because I want to develop my game for mobile, everything is just rendered black.

You can see in the image what the game looks like when I play it with feature level: shader model 5. But when I switch it to the Default mobile feature level, all objects are just rendered black which I know it’s just objects because I did a test where the game wouldn’t spawn the blue background object.

I’ve already looked around for answers to this but the only thing I found is to make sure there’s only one light which I already have one of. I’ve also tried copying the directional light from the mobile starter content which did not work. I also get the following messages in the output log every time I switch the feature level to the default mobile one.

LogMaterial:Warning: Failed to compile Material /Engine/BufferVisualization/CustomStencil.CustomStencil for platform PCD3D_ES2, Default Material will be used in game.
LogMaterial:Warning:     (Node SceneTexture) Node not supported in feature level ES2
LogMaterial: Missing cached shader map for material MAT_LevelColorationLitLightmapUV, compiling. Is special engine material.
LogMaterial:Warning: Failed to compile Material /Engine/EngineDebugMaterials/MAT_LevelColorationLitLightmapUV.MAT_LevelColorationLitLightmapUV for platform PCD3D_ES2, Default Material will be used in game.
LogMaterial:Warning:     (Node LightmapUVs) Node not supported in feature level ES2
LogMaterial: Missing cached shader map for material PreviewShadowIndicatorMaterial, compiling. 
LogMaterial:Warning: Failed to compile Material /Engine/EditorMaterials/PreviewShadowIndicatorMaterial.PreviewShadowIndicatorMaterial for platform PCD3D_ES2, Default Material will be used in game.
LogMaterial:Warning:     (Node TextureSample) Node not supported in feature level ES2
LogMaterial: Missing cached shader map for material LevelGridMaterial, compiling. 
LogMaterial:Warning: Failed to compile Material /Engine/EditorMaterials/LevelGridMaterial.LevelGridMaterial for platform PCD3D_ES2, Default Material will be used in game.
LogMaterial:Warning:     Function TilingAAGrid: (Node DDX) Node not supported in feature level ES2
LogMaterial:Warning:     Function TilingAAGrid: (Node DDY) Node not supported in feature level ES2
LogMaterial:Warning:     Function TilingAAGrid: (Node If) If input A must be of type float.
LogMaterial:Warning:     Function Blend_Screen: (Node DDX) Node not supported in feature level ES2
LogMaterial:Warning:     Function Blend_Screen: (Node DDY) Node not supported in feature level ES2
LogMaterial:Warning:     Function Blend_Screen: (Node If) If input A must be of type float.
LogMaterial:Warning:     Function CompositeARGBLayer: (Node DDX) Node not supported in feature level ES2
LogMaterial:Warning:     Function CompositeARGBLayer: (Node DDY) Node not supported in feature level ES2
LogMaterial:Warning:     Function CompositeARGBLayer: (Node If) If input A must be of type float.
LogParticles: Destroying 0 GPU particle simulations for FXSystem 0x0000000017798A40

I’ve tried to make sense of these errors but to no avail. I will also add an image of the interface when the game is not running if it might help.

All the actors are spawned by the ballarcadeStateController actor you see in the world outliner.

Just to add something, here’s what the scene looks like when I play with feature level es2 and make sure the game doesn’t spawn the background object. Normally it’s supposed to spawn the background object but this is just for testing so you can see the difference opposed to the screen being completely black

Oh and thank you Tim for the edit.

I did another test to check if it is because I’m spawning the objects by placing one of the objects in the scene and it is still rendered black. I brought in the chair model from the mobile starter pack into the scene and that seems to render fine however, when I apply the chair material to an object that I’ve made, it again renders black.

Alright so after placing a skylight into the scene, it renders everything dynamic or static, however when I play the game in mobile preview (PIE), everything is still rendered completely black. I still also get no shadows from the directional light even when I play it in normal editor view with feature level es2

Another update. It seems that changing the directional light to a movable or dynamic light, it starts lighting everything up properly and also eliminates the need for the skylight. However, after doing some research I found that using dynamic lighting can be very costly for mobile so now I want to know if there’s any way I can use static light to light the scene up.
I’ve already tried using a Lightmass Importance volume and settings the light to static but I get the black renders again.

Hi Alieninsane,

If you’re spawning everything in when the game starts then you won’t be able to take advantage of static lighting. Static lighting is precomputed, which means it cannot be generated at runtime. This is why you’re seeing the difference when you enable the lighting to be dynamic/movable. Stationary lighting is kind of an in-between for this though. If you have geometry in the level that is not spawning dynamically you can build lighting and these objects will be lit with precomputed/static lighting and then any objects that spawn in once your game starts will use dynamic lighting with your directional light so long as you’ve set the “Dynamic Shadow Distance StationaryLight” for your distance. This is set to 0 for stationary lights by default.

Dynamic lighting can be costly, but mostly when it comes to shadow casting. Using dynamic lighting without shadow casting enabled can be more performant than using static lighting, since it doesn’t require any lightmaps to be stored for the precomputed lighting.

Tim

Thank you Tim for the reply,
So I tested my scene using a stationary light with setting the Dynamic Shadow Distance StationaryLight to a fairly high value and placed one of the blueprints I extended out of c++ into the scene. I also placed a Lightmass Importance Volume into the scene and rebuilt lighting. Doing all this, now I the game does render static objects but dynamic objects that are spawned are still not being rendered with stationary light.

My main concern anyway is performance optimization since this will be a mobile game so I will probably stick to dynamic lighting without shadow casting for now. However, I still will need the light to cast shadows in the near future so would a low for Dynamic Shadow Distance be more optimal or as long as it’s above 0, it will just consume as much performance as if it is on the maximum setting?

Perhaps there is another alternative to achieving shadows with optimal performance?

I’m not sure why the dynamic distance for the stationary light wouldn’t render initially unless you have a camera that is further than the distance you entered. If you use the slider and max it out that should be a distance of 200 meters (20000 cm).

Looking back at our Release notes for 4.9 I had forgotten about Modulated Shadows can be enabled for the directional light as well so that there can be a dynamic shadow cast even if the scene is statically lit. You should only need to enable this in the directional light’s details panel options. You can set the shadow color there as well if you need something a different color.

As far as performance concerns and the distance of the shadow. Shadows for dynamic lights are more expensive with the more objects and geometry vertices that is within its shadow casting range. So using a lower distance will not affect as many objects which will lower the performance cost.

Give the Modulate shadows option a try. I think that should have better performance for mobile than dynamic shadowing.

I tried Modulated Shadows with stationary and static settings on my light but it just renders all the objects black again. With movable/dynamic setting as always it renders the objects but it doesn’t show any shadows. I looked around for a proper way to make Modulated shadows work but to no avail. Does modulated shadows only work with static and stationary light?

I guess this answers my question then. Building with static/stationary lights will not change anything since the geometry only gets brought into the scene after beginPlay, which means I will not be able to build the lighting for the geometry. Basically what I understand is if all the geometry has been constructed in the map (and not spawned programatically), even if they are dynamic mesh, I can use Modulated Shadows.

For now, I guess I’ll have to settle with dynamic directional light with as low as possible Dynamic Shadow Distance setting.

I will mark this question as answered now then since I assume I don’t have another alternative in the current state of the game.

Right, modulated shadows only work with Static/Stationary directional lights once they have been built. Sorry, I should have mentioned that before.

Solved my problem aswell. Thanks for sharing. I had to set the Environment Color to a light blue color too and could delete the lightmass importance volume from my level.

Sorry for being like 4 years late, just started learning/using Unreal and i am having the same problem, what fixed it for me is to set the DirectionalLight to Static then increase the Intensity to 500, it is too bright but that’s what i needed, to mimic the desert blinding light.

Hi Catalin. I’m no longer working on that project but I was delighted to see you comment on this. Brought back some memories :slight_smile: