# User Scene Texture BUG Happens by Changing Resolution of Game

**URL:** <https://forums.unrealengine.com/t/user-scene-texture-bug-happens-by-changing-resolution-of-game/2332307>\
**Category:** Rendering\
**Tags:** Post-Processing, unreal-engine, bug-report, Rendering\
**Created:** [February 14, 2025, 9:57am UTC](https://forums.unrealengine.com/t/user-scene-texture-bug-happens-by-changing-resolution-of-game/2332307 "2025-02-14T09:57:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Warwlock](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/warwlock/32/755019_2.png) [@Warwlock](https://forums.unrealengine.com/u/Warwlock)\
**Post date:** [February 14, 2025, 9:57am UTC](https://forums.unrealengine.com/t/user-scene-texture-bug-happens-by-changing-resolution-of-game/2332307/1 "2025-02-14T09:57:29Z")

</div>

I created a detailed version of this thread because I am new and I cannot embed images: [GitHub - Warwlock/ImagesForUserSceneTextureBUG](https://github.com/Warwlock/ImagesForUserSceneTextureBUG/tree/main)

The Problem:  
I tried to implement extended difference of gaussians from Acerola’s Github code inside Unreal Engine. It worked in the end but when I tried to scale the viewport in both editor and standalone play mode, spaghetti lines were appeared on edges of screen. I followed down the error to the “UserSceneTexture” nodes. I am thinking this could be a bug, because when I test the “SceneTexture:PostProcessInput0” node, spaghetti lines don’t happen. Probably it happens because of UV of “UserSceneTexture” node doesn’t scale with resolution.

I want to note that someone also encountered same issue as mine, but I wanted to write my point of view, because I think this could be an engine bug. Here is other thread: [Problem sampling User Scene Texture at high resolution](https://forums.unrealengine.com/t/problem-sampling-user-scene-texture-at-high-resolution/2261645/1)

I am only pasting one image showing the problem because I cannot embed more than one image. But you can find more detail at the github page.

 ![Fullscreen Editor Spaghetti Lines](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/d/a/dda2870571f4095913df7611ce8caf8115e86d61.jpeg)

---

<div class="post-metadata">

**Author:** ![Dobz1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dobz1](https://forums.unrealengine.com/u/Dobz1)\
**Post date:** [April 20, 2025, 1:09pm UTC](https://forums.unrealengine.com/t/user-scene-texture-bug-happens-by-changing-resolution-of-game/2332307/2 "2025-04-20T13:09:59Z")

</div>

I had the exact same issue and was able to fix it. As you mentioned, something is wrong with the way the `UserSceneTexture` node is calculating UVs.

If you look at `ViewportUVToSceneTextureUV()` in [MaterialTemplate.ush](https://github.com/EpicGames/UnrealEngine/blob/2d53fcab0066b1f16dd956b227720841cad0f6f7/Engine/Shaders/Private/MaterialTemplate.ush#L1242), you can see that for user scene textures it does some math to adjust the viewport UV using `PostProcessInput_0_UVViewportSize` and `PostProcessInput_0_UVViewportMin` if `POST_PROCESS_MATERIAL` is defined.

If `POST_PROCESS_MATERIAL` is not defined, it uses `ViewportUVToBufferUV()` instead which seems to give the correct UV coordinates. So to fix the issue, I made a custom HLSL node which uses this function to calculate the UVs:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/e/3/2e3ca4d914bc092389d6cd8a49e211416d92dfdc.png)

Just add two inputs to the custom node: `Tex` connected to the `Color` output of your`UserSceneTexture` node, and `ViewportUV` connected to a `ScreenPosition` node. The body is `SceneTextureLookup(ViewportUVToBufferUV(ViewportUV), Tex.ID, false)`.

Hopefully someone at Epic can look into why the default UVs are broken for user scene textures. I suspect the engine isn’t populating `PostProcessInput_0_UVViewportSize` and `PostProcessInput_0_UVViewportMin` correctly.
