# How to use viewmode unlit in a shipping build?

**URL:** <https://forums.unrealengine.com/t/how-to-use-viewmode-unlit-in-a-shipping-build/307143>\
**Category:** Rendering\
**Tags:** unlit, console-command, unreal-engine, Lighting, question\
**Created:** [February 16, 2015, 8:30pm UTC](https://forums.unrealengine.com/t/how-to-use-viewmode-unlit-in-a-shipping-build/307143 "2015-02-16T20:30:34Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![WaveParadigm](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@WaveParadigm](https://forums.unrealengine.com/u/WaveParadigm)\
**Post date:** [February 16, 2015, 8:30pm UTC](https://forums.unrealengine.com/t/how-to-use-viewmode-unlit-in-a-shipping-build/307143/1 "2015-02-16T20:30:34Z")

</div>

I’m using Paper2D, and I’ve found using the console command “viewmode unlit” makes my sprites look much cleaner and fixes annoying things like text renders always appearing black and the like. However, console commands don’t work in shipping builds. Is there either:

a) A way to enable console commands in shipping builds?  
or  
b) A setting to entirely disable all lighting. I’ve turned off everything in rendering under project settings but it still is doing general lighting.

---

<div class="post-metadata">

**Author:** ![gustavorios2](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gustavorios2/32/1194641_2.png) [@gustavorios2](https://forums.unrealengine.com/u/gustavorios2)\
**Post date:** [August 14, 2016, 6:41am UTC](https://forums.unrealengine.com/t/how-to-use-viewmode-unlit-in-a-shipping-build/307143/2 "2016-08-14T06:41:02Z")

</div>

need to know about this one too =(

---

<div class="post-metadata">

**Author:** ![Deathrey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Deathrey](https://forums.unrealengine.com/u/Deathrey)\
**Post date:** [August 17, 2016, 11:35am UTC](https://forums.unrealengine.com/t/how-to-use-viewmode-unlit-in-a-shipping-build/307143/3 "2016-08-17T11:35:54Z")

</div>

Well, why don’t you try to mimic the same effect using post-processing ?

---

<div class="post-metadata">

**Author:** ![Kessern](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kessern](https://forums.unrealengine.com/u/Kessern)\
**Post date:** [July 11, 2020, 8:27pm UTC](https://forums.unrealengine.com/t/how-to-use-viewmode-unlit-in-a-shipping-build/307143/4 "2020-07-11T20:27:02Z")

</div>

so ■■■■ worthless respons

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [July 11, 2020, 8:41pm UTC](https://forums.unrealengine.com/t/how-to-use-viewmode-unlit-in-a-shipping-build/307143/5 "2020-07-11T20:41:40Z")

</div>

a) You can’t without some C++ hacking and even if oyu do that is partly functional and don’t change fact that shipping build has log system disabled. Main reason why console is disabled is to prevent end user to easilly mess with your game in unintentional way.

B) You can do this in C++ in GameVieport object that you can get from ()

> **[UWorld::GetGameViewport](https://docs.unrealengine.com/5.1/en-US/API/Runtime/Engine/Engine/UWorld/GetGameViewport/)**
>
> Returns a reference to the game viewport displaying this world if one exists.

And set ViewMoideIndex varable:

> **[UGameViewportClient](https://docs.unrealengine.com/5.1/en-US/API/Runtime/Engine/Engine/UGameViewportClient/)**
>
> A game viewport (\[FViewport\](API\\Runtime\\Engine\\FViewport)) is a high-level abstract interface for the platform specific rendering, audio, and input subsystems.

Here list of possible options:

> **[EViewModeIndex](https://docs.unrealengine.com/5.1/en-US/API/Runtime/Engine/Engine/EViewModeIndex/)**
>
> Define view modes to get specific show flag settings (some on, some off and some are not altered) Don't change the order, the ID is serialized with the editor

Note that engine let you disable and enable invidual rendering features using show flags which you can contorol by setting values in EngineShowFlags varable

> **[FEngineShowFlags](https://docs.unrealengine.com/5.1/en-US/API/Runtime/Engine/FEngineShowFlags/)**
>
> ShowFlags are a set of bits (some are fixed in SHIPPING) that are stored in the ViewFamily.

You can not do this with blueprints, maybe there way to do this via config but i’m not sure. But you can make bluerpints nodes in C++ that let you do things that you want

---

<div class="post-metadata">

**Author:** ![mightyenigma](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mightyenigma](https://forums.unrealengine.com/u/mightyenigma)\
**Post date:** [July 13, 2020, 3:30pm UTC](https://forums.unrealengine.com/t/how-to-use-viewmode-unlit-in-a-shipping-build/307143/6 "2020-07-13T15:30:04Z")

</div>

@anonymous_user_f5a50610’s way is best if you have a lot of shaders that use the lit shading models.  
If you only have a few, you could sort of fake it by converting all your shaders to be unlit only.

HOWEVER, I understand if you can’t do that due to needing translucent-shader-based orthographic sorting for example. That requires translucent shaders rather than unlit ones. But in that case maybe you can convert them all to output to Emissive? IDK.

---

<div class="post-metadata">

**Author:** ![A.RADIX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@A.RADIX](https://forums.unrealengine.com/u/A.RADIX)\
**Post date:** [March 10, 2022, 12:59pm UTC](https://forums.unrealengine.com/t/how-to-use-viewmode-unlit-in-a-shipping-build/307143/7 "2022-03-10T12:59:30Z")

</div>

This method worked for me in Shipping build, thank you for this share ! 🙂

---

<div class="post-metadata">

**Author:** ![baikgyul](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@baikgyul](https://forums.unrealengine.com/u/baikgyul)\
**Post date:** [August 24, 2022, 10:52am UTC](https://forums.unrealengine.com/t/how-to-use-viewmode-unlit-in-a-shipping-build/307143/8 "2022-08-24T10:52:44Z")

</div>

hey, can you share some C++ code ? I’m searching for solution and came here, but hard to apply it ☹

---

<div class="post-metadata">

**Author:** ![axelkomair01](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/axelkomair01/32/88714_2.png) [@axelkomair01](https://forums.unrealengine.com/u/axelkomair01)\
**Post date:** [February 2, 2023, 2:13pm UTC](https://forums.unrealengine.com/t/how-to-use-viewmode-unlit-in-a-shipping-build/307143/10 "2023-02-02T14:13:44Z")

</div>

This code will apply the ViewMode even in Shipping builds:

ApplyViewMode(EViewModeIndex::VMI\_Unlit, false, \*()-\>GetGameViewport()-\>GetEngineShowFlags());

Make sure to call it once at beginning of your game’s logic.

Like said you could play directly with the FEngineShowFlags (returned from GetEngineShowFlags()) to set and unset uneccessary rendering features.

Unfortunately, it seems this changes a core .ini file and applies properties even after restart. Still fixes the problem, but now setting to lit in the editor window doesn’t work correctly anymore. WARNING

Note: The second parameter is bPerspective, mine is set to false because i’m using an orthographic camera. Make sure the set it to true if you are using a Perspective camera

---

<div class="post-metadata">

**Author:** ![Nizami\_Nz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nizami\_Nz](https://forums.unrealengine.com/u/Nizami_Nz)\
**Post date:** [May 23, 2023, 5:27pm UTC](https://forums.unrealengine.com/t/how-to-use-viewmode-unlit-in-a-shipping-build/307143/11 "2023-05-23T17:27:21Z")

</div>

You can do it, if:

1. Add (r.ForceDebugViewModes=1) → (DefaultEngine.ini)

2. In blueprint need call (Execute Console Command),  
and write there (viewmode unlit)

![01](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/a/9/ba96e7afc6032dba923743439d80f042716c1dcb.png)  
 ![02](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/4/0/2402f997518b20579c1be0ea4f8276b9b08bd708.png)

---

<div class="post-metadata">

**Author:** ![tweakeroo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tweakeroo](https://forums.unrealengine.com/u/tweakeroo)\
**Post date:** [January 11, 2024, 10:43am UTC](https://forums.unrealengine.com/t/how-to-use-viewmode-unlit-in-a-shipping-build/307143/12 "2024-01-11T10:43:04Z")

</div>

Im trying to set unlit mode or modify showflags on a 5.2 shipping game. Even with r.ForceDebugViewModes set to 1, console outputs this “Debug viewmodes not allowed in Test or Shipping builds.”  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/6/c/a6c97bb3b4d318cb52dd06195a551f39395bd0b5.png)

Also i cant turn off showflags with “show ” and as its a shipping build, ShowFlag.xxx=x doesnt work.

Is there any way possible in this case?

---

<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, 11:03am UTC](https://forums.unrealengine.com/t/how-to-use-viewmode-unlit-in-a-shipping-build/307143/13 "2024-09-12T11:03:03Z")

</div>

Nice, there’s also easier solution:

> [@Unlit Mode in packaged game](https://forums.unrealengine.com/t/unlit-mode-in-packaged-game/527900/16):
>
> Here’s the solution that actually works:  
> In your C++ blueprint function library(create one if you don’t already have one):  
> Header:
> 
> ```auto
> UFUNCTION(BlueprintCallable)
> static void SetViewMode(EViewModeIndex ViewMode);
> 
> ```
> 
> Source file:
> 
> ```auto
> void UMyBlueprintFunctionLibrary::SetViewMode(EViewModeIndex ViewMode) {
> ApplyViewMode(ViewMode, true, GEngine->GameViewport->EngineShowFlags);
> }
> 
> ```

---

<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, 11:03am UTC](https://forums.unrealengine.com/t/how-to-use-viewmode-unlit-in-a-shipping-build/307143/14 "2024-09-12T11:03:50Z")

</div>

Yes, that’s how it works, I explained why in this post: [Unlit Mode in packaged game - #16 by Kulagin](https://forums.unrealengine.com/t/unlit-mode-in-packaged-game/527900/16)

---

<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, 11:04am UTC](https://forums.unrealengine.com/t/how-to-use-viewmode-unlit-in-a-shipping-build/307143/15 "2024-09-12T11:04:26Z")

</div>

That doesn’t work in shipping build.
