# Having the game look like the "Unlit" option in the viewport

**URL:** <https://forums.unrealengine.com/t/having-the-game-look-like-the-unlit-option-in-the-viewport/327982>\
**Category:** Rendering\
**Tags:** unlit, unreal-engine, ambient-occlusion, Rendering, Lighting, question\
**Created:** [August 7, 2015, 8:14pm UTC](https://forums.unrealengine.com/t/having-the-game-look-like-the-unlit-option-in-the-viewport/327982 "2015-08-07T20:14:47Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![lufkin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lufkin](https://forums.unrealengine.com/u/lufkin)\
**Post date:** [August 7, 2015, 8:14pm UTC](https://forums.unrealengine.com/t/having-the-game-look-like-the-unlit-option-in-the-viewport/327982/1 "2015-08-07T20:14:47Z")

</div>

It’s probably a silly question, but I’m currently toying around with different styles for my game and I was wondering if there was a way to achieve something like the “Unlit” view mode option you have in the viewport of UE4 in game? I know you can change the Shading Model of a material to Unlit, but it loses the ambient occlusion.

(Will post images later if needed, Imgur is derping out at the moment…)

Thanks!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_dede2580](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_dede2580](https://forums.unrealengine.com/u/anonymous_user_dede2580)\
**Post date:** [August 7, 2015, 8:32pm UTC](https://forums.unrealengine.com/t/having-the-game-look-like-the-unlit-option-in-the-viewport/327982/2 "2015-08-07T20:32:37Z")

</div>

Try an ambient cubemap -[Post Process Effects in Unreal Engine | Unreal Engine 5.2 Documentation](https://docs.unrealengine.com/latest/INT/Engine/Rendering/LightingAndShadows/AmbientCubemap/index.html) - and plug a plain white texture into it. If there are no other lights in the scene, you should be able to get what you want, with AO as well.

Edit: oooor you can use a skylight the same way, using a pure white cubemap. Might look nice, particularly if you enable “casts shadows”

---

<div class="post-metadata">

**Author:** ![Vickicup](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Vickicup](https://forums.unrealengine.com/u/Vickicup)\
**Post date:** [October 14, 2015, 11:01pm UTC](https://forums.unrealengine.com/t/having-the-game-look-like-the-unlit-option-in-the-viewport/327982/3 "2015-10-14T23:01:09Z")

</div>

Try typing in the console “viewmode unlit” when in game mode.  
Just learned this just now too, and it works. 😉

---

<div class="post-metadata">

**Author:** ![Ninjin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ninjin](https://forums.unrealengine.com/u/Ninjin)\
**Post date:** [September 27, 2016, 7:18pm UTC](https://forums.unrealengine.com/t/having-the-game-look-like-the-unlit-option-in-the-viewport/327982/4 "2016-09-27T19:18:04Z")

</div>

Will this also work in a shipped build?

---

<div class="post-metadata">

**Author:** ![dennzie](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dennzie](https://forums.unrealengine.com/u/dennzie)\
**Post date:** [December 13, 2016, 8:49pm UTC](https://forums.unrealengine.com/t/having-the-game-look-like-the-unlit-option-in-the-viewport/327982/5 "2016-12-13T20:49:45Z")

</div>

Hey I’m a total beginner and had the same question.  
I found a simple solution that worked for me.  
Just set the Shading Model of my Objects in the Material Editor from Default Lit to Unlit and Tadaaaa the whole world looks flat 🙂

Probably not the best way if you already have built a complex scene but it works. See in this [image][1]

[http://i.imgur.com/NRCm7lW.jpg](http://i.imgur.com/NRCm7lW.jpg)

---

<div class="post-metadata">

**Author:** ![RVillani](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rvillani/32/1194572_2.png) [@RVillani](https://forums.unrealengine.com/u/RVillani)\
**Post date:** [February 3, 2017, 7:30pm UTC](https://forums.unrealengine.com/t/having-the-game-look-like-the-unlit-option-in-the-viewport/327982/6 "2017-02-03T19:30:12Z")

</div>

It works in shipped. At least, worked on Android.

---

<div class="post-metadata">

**Author:** ![LoN](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LoN](https://forums.unrealengine.com/u/LoN)\
**Post date:** [February 7, 2017, 6:20pm UTC](https://forums.unrealengine.com/t/having-the-game-look-like-the-unlit-option-in-the-viewport/327982/7 "2017-02-07T18:20:32Z")

</div>

It did not work for me on Development build fo windows 64

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_882d813f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_882d813f](https://forums.unrealengine.com/u/anonymous_user_882d813f)\
**Post date:** [January 8, 2018, 7:55pm UTC](https://forums.unrealengine.com/t/having-the-game-look-like-the-unlit-option-in-the-viewport/327982/8 "2018-01-08T19:55:53Z")

</div>

Thanks, mate! That’s actually what I’ve looking for.

---

<div class="post-metadata">

**Author:** ![molul](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@molul](https://forums.unrealengine.com/u/molul)\
**Post date:** [June 4, 2018, 9:14am UTC](https://forums.unrealengine.com/t/having-the-game-look-like-the-unlit-option-in-the-viewport/327982/9 "2018-06-04T09:14:41Z")

</div>

Is there any way to make this automatic, without having to type that command?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_882d813f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_882d813f](https://forums.unrealengine.com/u/anonymous_user_882d813f)\
**Post date:** [June 4, 2018, 9:44am UTC](https://forums.unrealengine.com/t/having-the-game-look-like-the-unlit-option-in-the-viewport/327982/10 "2018-06-04T09:44:04Z")

</div>

just change material shading model to “unlit” (as on the screenshot below) this is the correct way

---

<div class="post-metadata">

**Author:** ![molul](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@molul](https://forums.unrealengine.com/u/molul)\
**Post date:** [June 4, 2018, 9:59am UTC](https://forums.unrealengine.com/t/having-the-game-look-like-the-unlit-option-in-the-viewport/327982/11 "2018-06-04T09:59:27Z")

</div>

Thanks, but the material shading model was already “unlit” (it’s DefaultSpriteMaterial), I just double-checked. I don’t know what I’m doing wrong ☹

---

<div class="post-metadata">

**Author:** ![karti047](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@karti047](https://forums.unrealengine.com/u/karti047)\
**Post date:** [June 6, 2018, 6:52am UTC](https://forums.unrealengine.com/t/having-the-game-look-like-the-unlit-option-in-the-viewport/327982/12 "2018-06-06T06:52:45Z")

</div>

just press F2 when playing in the viewport.

---

<div class="post-metadata">

**Author:** ![ppchavan001](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ppchavan001](https://forums.unrealengine.com/u/ppchavan001)\
**Post date:** [July 11, 2018, 8:58am UTC](https://forums.unrealengine.com/t/having-the-game-look-like-the-unlit-option-in-the-viewport/327982/13 "2018-07-11T08:58:10Z")

</div>

in your project’s Config Folder, open up DefaultEngine.ini Under the [RenderSettings] or [/Script/Engine.RendererSettings] add the following: r.ForceDebugViewModes=1

then use the cmd  
“viewmode unlit”

---

<div class="post-metadata">

**Author:** ![Kulagin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kulagin](https://forums.unrealengine.com/u/Kulagin)\
**Post date:** [September 12, 2024, 6:06am UTC](https://forums.unrealengine.com/t/having-the-game-look-like-the-unlit-option-in-the-viewport/327982/14 "2024-09-12T06:06:34Z")

</div>

> [@RVillani](#):
>
> It works in shipped. At least, worked on Android.

The viewmode unlit does not work in shipping build. There’s a macros in C++ that prevents it from working it in shipping build. Are you shipping your game in debug build?

Here’s the handle viewmode function: [https://github.com/EpicGames/UnrealEngine/blob/40eea367040d50aadd9f030ed5909fc890c159c2/Engine/Source/Runtime/Engine/Private/GameViewportClient.cpp#L3585](https://github.com/EpicGames/UnrealEngine/blob/40eea367040d50aadd9f030ed5909fc890c159c2/Engine/Source/Runtime/Engine/Private/GameViewportClient.cpp#L3585)

The part that prevents it from working in shipping build is:

```auto
#if UE_BUILD_TEST || UE_BUILD_SHIPPING
	Ar.Logf(TEXT("Debug viewmodes not allowed in Test or Shipping builds."));
	ViewModeIndex = VMI_Lit;
#else

```

So if you’re really shipping it in the shipping build mode, there is no way it would work.

---

<div class="post-metadata">

**Author:** ![RVillani](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rvillani/32/1194572_2.png) [@RVillani](https://forums.unrealengine.com/u/RVillani)\
**Post date:** [September 25, 2024, 6:25am UTC](https://forums.unrealengine.com/t/having-the-game-look-like-the-unlit-option-in-the-viewport/327982/15 "2024-09-25T06:25:43Z")

</div>

Honestly, I don’t remember. It’s been many years. Maybe that preprocessor code was added since then? Or maybe I wasn’t publishing the game in Shipping mode haha That’s possible.
