# How make pixelation effect in windowed mode?

**URL:** <https://forums.unrealengine.com/t/how-make-pixelation-effect-in-windowed-mode/2657659>\
**Category:** Programming & Scripting\
**Tags:** window, unreal-engine, please-help-me, pixel, Rendering, need-help, CPP, question\
**Created:** [September 17, 2025, 7:17pm UTC](https://forums.unrealengine.com/t/how-make-pixelation-effect-in-windowed-mode/2657659 "2025-09-17T19:17:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Turbomorsh](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/turbomorsh/32/986507_2.png) [@Turbomorsh](https://forums.unrealengine.com/u/Turbomorsh)\
**Post date:** [September 17, 2025, 7:17pm UTC](https://forums.unrealengine.com/t/how-make-pixelation-effect-in-windowed-mode/2657659/1 "2025-09-17T19:17:05Z")

</div>

HEY EVERY!!! Please help me with pixelization from game resolution on windowed mode!!  
i making FREE plugin for 2d pixel games, who pixelate image on your screen, technically i made it year ago - Pixel Tools([PixelTools | Fab](https://www.fab.com/listings/360d45a6-7db5-460c-8edd-5a91bb2a37f1)). I want update it and add window mode support

So wat the matter? I DONT KNOW WHY BUT THAT DOESNT WORKING!!  
In fact to force work pixelation on window i need just change  
GEngine-\>GetGameUserSettings()-\>GetDesktopResolution() to  
GEngine-\>GameViewport-\>GetGameViewport()-\>GetSizeXY()  
And It seems to be working but not on all window sizes + resolution sizes. I mean we have pixelization but with pixel distortion on the screen

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/7/1/e7183f8182b4faab3262b77c4b37eafeaf29118a.jpeg) ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/6/2/3625b06a20c276c4674c8370b4900aeb1512790f.jpeg)  
(Open image in new folder to see how pixelation really works )

Code: I will show you the published version and my practices for window mode so that you can understand where I started.

Project settings:

Settings-\>DefaultManualScreenPercentage = 100;  
Settings-\>DefaultScreenPercentageDesktopMode = EScreenPercentageMode::BasedOnDisplayResolution;  
Settings-\>DefaultScreenPercentageMobileMode = EScreenPercentageMode::BasedOnDisplayResolution;  
Settings-\>DefaultFeatureAntiAliasing = AAM\_None;  
Settings-\>MobileAntiAliasing = EMobileAntiAliasingMethod::None;  
Settings-\>bDefaultFeatureMotionBlur = false;  
Settings-\>DynamicGlobalIllumination = EDynamicGlobalIlluminationMethod::None; Settings-\>bDefaultFeatureAutoExposure = false;  
Settings-\>DefaultFeatureAutoExposureBias = 0;  
Settings-\>Reflections = EReflectionMethod::None;  
Settings-\>ShadowMapMethod = EShadowMapMethod::ShadowMaps;  
Settings-\>bDefaultFeatureBloom = false;  
Settings-\>SaveConfig();

Camera Component initial  
(Constructor)

SetConstraintAspectRatio(false);  
PostProcessSettings.AutoExposureMinBrightness = 0; PostProcessSettings.AutoExposureMaxBrightness = 0; PostProcessSettings.HistogramLogMin = 0;  
PostProcessSettings.HistogramLogMax = 0;  
PostProcessSettings.VignetteIntensity = 0;  
PostProcessSettings.ExpandGamut = 0;  
PostProcessSettings.ToneCurveAmount = 0;

(Camera component Post init)

SetProjectionMode(ECameraProjectionMode::Orthographic);

Resolution Calculating Desktop only version -  
const int CurScale = GEngine-\>GameUserSettings-\>GetDesktopResolution().X / Resolution.X;  
if(CurScale + Scale \> 0 && CurScale + Scale \< 40)  
{  
const int OutputResX = GEngine-\>GameUserSettings-\>GetDesktopResolution().X / (CurScale + Scale);  
const int OutputResY = GEngine-\>GameUserSettings-\>GetDesktopResolution().Y / (CurScale + Scale);  
return(FIntPoint(OutputResX, OutputResY));  
}  
else { return FIntPoint(0, 0); }

Window mode version -

FIntPoint WindowResolution = GEngine-\>GameViewport-\>GetGameViewport()-\>GetSizeXY();  
int32 Garbage;  
int32 DesktopX;  
int32 DesktopY;  
GEngine-\>GameViewport-\>GetWindow()-\>GetNativeWindow()-\>GetFullScreenInfo(Garbage, Garbage, DesktopX, DesktopY);  
const int CurScale = DesktopX / Resolution.X; const int WinScale = DesktopX / WindowResolution.X;  
if(CurScale + Scale != 0)  
{  
const int OutputResX = (WindowResolution.X \* WinScale) / (CurScale + Scale);  
const int OutputResY = (WindowResolution.Y \* WinScale) / (CurScale + Scale);  
return(FIntPoint(OutputResX, OutputResY)); } else { return FIntPoint(0, 0);  
}

Applying resolution -  
Desktop only version -

float DesctopResX = GEngine-\>GetGameUserSettings()-\>GetDesktopResolution().X;  
float TimlessResX = Resolution.X;  
GEngine-\>GetGameUserSettings()-\>SetResolutionScaleValueEx((TimlessResX / DesctopResX) \* 100);  
GEngine-\>GetGameUserSettings()-\>ApplyResolutionSettings(false);  
GEngine-\>GetGameUserSettings()-\>ApplyNonResolutionSettings(); SetPerfectOrthoWidth();

Window mode version -

if (UGameUserSettings\* Settings = GEngine-\>GetGameUserSettings())  
{  
float DesctopResX = Settings-\>GetDesktopResolution().X;  
float TimlessResX = Resolution.X;  
const int WinScale = DesctopResX / GEngine-\>GameViewport-\>GetGameViewport()-\>GetSizeXY().X;  
float Percentage = (TimlessResX / DesctopResX) \* 100;

Settings-\>SetResolutionScaleValueEx(Percentage \* WinScale);  
Settings-\>ApplySettings(false); GEngine-\>Exec(GetWorld(), _FString::Printf(TEXT(“r.ScreenPercentage %f”), Percentage_ WinScale)); SetPerfectOrthoWidth();  
}

SetPerfectOthoWidth:  
OrthoWidth = Resolution.X / PixelPerUnit;

So.. what’s wrong?? Why in native window size pixels looking good, and on half size window we can see pixel distortion??

 ![Изображение](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/6/3/363646b5242e2c768e79c7df15922c7d6f57084f.webp)
