Casual Game Lighting for Unreal Engine 4

,

Overview

Casual Game Lighting is a material function with a collection of lighting features, made for developers and artists who want to make casual (or hyper casual) mobile games.

Casual Game Lighting will make your game looks on mobile devices exactly the same way it looks in the editor.

General Features:

  • Casual lighting main material function is commented, and it’s easy to modify or to add new features to it (contact via email if you have any requests).
  • It supports iOS and Android devices.
  • Game art will look the same on any mobile device.

Lighting Features:

  • Distance fog.
  • Height fog.
  • Diffuse lighting.
  • Ambient lighting.
  • Specular lighting.

How to Use

Before we start, make sure you change these settings, and disable any rendering features you don’t need to gain more performance:

  • Set the rendering level used by the editor to Android ES 3.1 or iOs:
  • Disable “Mobile HDR” in “ProjectSettings/Rendering/VR/Mobile HDR”.
  • Set Target Hardware settings to [Mobile/Tablet | Scallable 3D or 2D]:
  • Disable “Mobile MSAA” in “ProjectSettings/Rendering/Mobile/Mobile MSAA” (A must if you changed the preview rendering level to Android ES 3.1 !).

Step 1: Create new level:

Step 2: Drag and drop CasualLightActor blueprint, you will find CasualLightingActor blueprint in [Content/CasualLighting/Blueprints]:

The Casual Light Actor determines the light’s direction and includes global parameters for lighting in this level.

Step 3: Set lighting mode to Unlit (no need to do this if you set preview rendering level to Android ES 3.1 or iOS):

Step 4: Import your mesh into the scene:

Step 5: Set Shading Model to “Unlit” mode for all your materials, and Enable “Use Full Precision”:

Step 6: Add casual lighting function to all materials and connect a texture or a color to the input Color (V3) and the output to Emissive.

Add MaterialFunctionCall node, in details panel set the CasualLighting function in MaterialFunction.

Step 7: Select CasualLightActor and adjust parameters as you like:

Step 8: If you want to disable fog or change a parameter for certain materials, you can override them by setting these modifiers (Values go from 0 to 1):

Final result: