# Custom Lighting On Mobile Devices

**URL:** <https://forums.unrealengine.com/t/custom-lighting-on-mobile-devices/299840>\
**Category:** Rendering\
**Tags:** Mobile, mobile-device, unreal-engine, Lighting, Rendering, question\
**Created:** [November 25, 2014, 3:36pm UTC](https://forums.unrealengine.com/t/custom-lighting-on-mobile-devices/299840 "2014-11-25T15:36:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Feanix](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Feanix](https://forums.unrealengine.com/u/Feanix)\
**Post date:** [November 25, 2014, 3:36pm UTC](https://forums.unrealengine.com/t/custom-lighting-on-mobile-devices/299840/1 "2014-11-25T15:36:32Z")

</div>

Is there a way to do this?

I’m trying to do something like the team fortress shading style on a mobile device. I’ve been told that unreal 4 uses deferred lighting and therefore all lighting is basically post processed and therefore the only way to have custom lighting is to do it with post processing.

Does the mobile rendered also use deferred lighting and if so, is there any way to get anything except for the regular lighting style?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6e7b421a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6e7b421a](https://forums.unrealengine.com/u/anonymous_user_6e7b421a)\
**Post date:** [November 25, 2014, 8:52pm UTC](https://forums.unrealengine.com/t/custom-lighting-on-mobile-devices/299840/2 "2014-11-25T20:52:19Z")

</div>

Hello Feanix,

There is definitely a way to get the custom lighting style you wish to acheive through mobile. Keep in mind mobile is a bit limited due to hardware specs, so have a read of the documentation on how to develop for mobile devices. It is broken up into sections so you can find the information you are looking for really quickly.

**Mobile Game Development**

> **[General Mobile Development](https://docs.unrealengine.com/5.1/en-US/general-mobile-development-for-unreal-engine/)**
>
> Tools and Best Practices for building Unreal Engine games for Mobile platforms.

Thanks,

---

<div class="post-metadata">

**Author:** ![Feanix](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Feanix](https://forums.unrealengine.com/u/Feanix)\
**Post date:** [November 25, 2014, 11:12pm UTC](https://forums.unrealengine.com/t/custom-lighting-on-mobile-devices/299840/3 "2014-11-25T23:12:16Z")

</div>

Hi Andrew! I’m excited to hear its possible but after scouring that section I’m none the wiser ☹ Could you give me any more info to help?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6e7b421a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6e7b421a](https://forums.unrealengine.com/u/anonymous_user_6e7b421a)\
**Post date:** [December 1, 2014, 3:11pm UTC](https://forums.unrealengine.com/t/custom-lighting-on-mobile-devices/299840/4 "2014-12-01T15:11:10Z")

</div>

Hey again Feanix,

The information provided is the extent of the knowledge I know currently for developing game for mobile. I would suggest going onto the Forums as well as the Wiki to gain further knowledge and find some good places to start.

**Unreal Engine Forums**  
[https://forums.unrealengine.com/](https://forums.unrealengine.com/)

**Unreal Engine Wiki**

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

I hope this helps as well.

Thanks,

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_416b781b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_416b781b](https://forums.unrealengine.com/u/anonymous_user_416b781b)\
**Post date:** [August 22, 2015, 8:27pm UTC](https://forums.unrealengine.com/t/custom-lighting-on-mobile-devices/299840/5 "2015-08-22T20:27:42Z")

</div>

Hey Feanix,  
another approuch to do custom lighting is to fake forward rendering, since deferred rendering can be quite costly for mobiles.

To do this first disable the G-Buffer with the command ‘r.GBuffer 0’. This disables all postprocessing buffers UE generates for deferred rendering.

Now you could create a material parameter collection where you store your sundirection, suncolor etc. You can easily access your sunlight and get the forward vector (that is the sundirection) per level blueprint.

Using this you can create an unlit material and create a dot product between the sundirection and the PixelNormalWS (or VertexNormalWS, per pixel is more precise).

Finally this should be sufficiant as a start and you could convert this shader code into a shader graph [http://wiki.unity3d.com/index.php/TeamFortress2Shader](http://wiki.unity3d.com/index.php/TeamFortress2Shader).  
The interesting part is the function LightingTF2.

Hope it helps.
