# Pixel perfect drawing to render target?

**URL:** <https://forums.unrealengine.com/t/pixel-perfect-drawing-to-render-target/272411>\
**Category:** Rendering\
**Tags:** unreal-engine, UE4-27, question\
**Created:** [January 14, 2022, 7:57am UTC](https://forums.unrealengine.com/t/pixel-perfect-drawing-to-render-target/272411 "2022-01-14T07:57:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![wilberolive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@wilberolive](https://forums.unrealengine.com/u/wilberolive)\
**Post date:** [January 14, 2022, 7:57am UTC](https://forums.unrealengine.com/t/pixel-perfect-drawing-to-render-target/272411/1 "2022-01-14T07:57:06Z")

</div>

So I thought I’d quickly create a simple actor to help me combine separate textures into different channels of a single texture (i.e. texture packing). All this actor does is allows me to select four textures and it then creates a render target and draws each texture to a different channel using a material set up for this. The problem is that the new output texture doesn’t look exactly the same as the source textures. There always appears to be a little bit of noise in the output texture in each channel and I can’t figure out where this noise is coming from.

I’ve ensured the render target and output texture are both using the same size dimensions as the source textures. I’ve tried various format settings for the render target and none of them make a difference. I currently have it set to RTF RGBA8 SRGB. I’ve tried using a canvas render target instead, but get the same result.

The material is set up as Unlit with AlphaComposite. It then just grabs the appropriate channel of each texture, appends them together and sends them to the Emissive Color output pin. The Alpha texture channel is sent to the Opacity output pin.

Anyone have any ideas on what might be causing the noise? Perhaps I’m going about this the wrong way? If so, how should I be channel packing, without exporting and doing it manually in photoshop or something?

---

<div class="post-metadata">

**Author:** ![Suthriel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/suthriel/32/1195643_2.png) [@Suthriel](https://forums.unrealengine.com/u/Suthriel)\
**Post date:** [January 14, 2022, 9:59pm UTC](https://forums.unrealengine.com/t/pixel-perfect-drawing-to-render-target/272411/2 "2022-01-14T21:59:06Z")

</div>

Do you have a screenshot of that noise, or a before and after image? The little i know about drawing pixel perfect render targets, is that you should go into your render target and check in the “Level of Details” segment, that your:

- “Mip Gen Settings” are set to “NoMipmaps” and
- “Texture Group” is set to “2D Pixels (unfiltered)”
- also “Clamp” Adress X and Y

Example settings:

 ![grafik](https://d3kjluh73b9h9o.cloudfront.net/original/3X/8/6/86d5e44a68be454de085f949f1c9d5754fd9d180.png)

---

<div class="post-metadata">

**Author:** ![wilberolive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@wilberolive](https://forums.unrealengine.com/u/wilberolive)\
**Post date:** [January 15, 2022, 12:45am UTC](https://forums.unrealengine.com/t/pixel-perfect-drawing-to-render-target/272411/3 "2022-01-15T00:45:19Z")

</div>

I’ve tried fiddling with all of those settings as well, but no good. So far, this is the best I’ve been able to achieve (which is pretty bad).

![example](https://d3kjluh73b9h9o.cloudfront.net/original/3X/f/4/f4899d51113554ba1e379bc93abf307451c1f166.png)

This is an example (snip from larger power of two texture), looking at just the red channel. The render target has introduced a slight bit of noise. However, the output texture introduces a lot of noise.

---

<div class="post-metadata">

**Author:** ![Suthriel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/suthriel/32/1195643_2.png) [@Suthriel](https://forums.unrealengine.com/u/Suthriel)\
**Post date:** [January 16, 2022, 10:38am UTC](https://forums.unrealengine.com/t/pixel-perfect-drawing-to-render-target/272411/4 "2022-01-16T10:38:58Z")

</div>

Yeah, thats something o.O No clue, whats going on there, different compressions, that boost the values during conversion?

I ttook your picture, cut out the source part, to see, how noisy it is in this state. After some boosting the colors, it doesn´t look less noisy than your output result, just seems, that the colors are closer together, so that you cannot see the real noise.

 ![grafik](https://d3kjluh73b9h9o.cloudfront.net/original/3X/5/0/506a9d886548659cd39ef3068c852f7a2e21664d.png)

---

<div class="post-metadata">

**Author:** ![Divone](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Divone](https://forums.unrealengine.com/u/Divone)\
**Post date:** [May 24, 2024, 6:22pm UTC](https://forums.unrealengine.com/t/pixel-perfect-drawing-to-render-target/272411/5 "2024-05-24T18:22:54Z")

</div>

So this works in editor and in a Dev build, but not in a Shipping build. Any idea what could cause the render target to become blurry only in Shipping?

---

<div class="post-metadata">

**Author:** ![Suthriel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/suthriel/32/1195643_2.png) [@Suthriel](https://forums.unrealengine.com/u/Suthriel)\
**Post date:** [May 24, 2024, 9:53pm UTC](https://forums.unrealengine.com/t/pixel-perfect-drawing-to-render-target/272411/6 "2024-05-24T21:53:40Z")

</div>

In recent versions of UE, it seems, that you also need to go into your texture, and set the filter method from default to “Nearest” (aka “Nearest neighbor”). Pixel art games suffer from those blurry textures a lot, and there it seems, the only way to convince a packed game to not make a blurry mess out of pixel art is to manually switch to that filter setting.

 ![Texture_Settings_for_clear_pixel_art](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/1/6/a168614a8fc00f4ad43772da7e28d226086d81b3.png)

---

<div class="post-metadata">

**Author:** ![Divone](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Divone](https://forums.unrealengine.com/u/Divone)\
**Post date:** [May 25, 2024, 8:23am UTC](https://forums.unrealengine.com/t/pixel-perfect-drawing-to-render-target/272411/7 "2024-05-25T08:23:28Z")

</div>

Crap, in my case it’s a Render texture and I don’t have these options. I did set “NoMipmaps” and “2D Pixels (unfiltered)”, but there is no compression settings and Filter option… ☹

---

<div class="post-metadata">

**Author:** ![Divone](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Divone](https://forums.unrealengine.com/u/Divone)\
**Post date:** [May 25, 2024, 12:32pm UTC](https://forums.unrealengine.com/t/pixel-perfect-drawing-to-render-target/272411/8 "2024-05-25T12:32:43Z")

</div>

Found the solution 🙂

> [@Render Target becomes blurry in Shipping](https://forums.unrealengine.com/t/render-target-becomes-blurry-in-shipping/1871306/2):
>
> I have managed to fix it through blueprint. The solution given everywhere was to set the filter to “Nearest”, but there was no such option in the render target texture editor. However, this option does exist in blueprints. So the following implementation solved the issue for me:

---

<div class="post-metadata">

**Author:** ![Suthriel](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/suthriel/32/1195643_2.png) [@Suthriel](https://forums.unrealengine.com/u/Suthriel)\
**Post date:** [May 26, 2024, 5:58am UTC](https://forums.unrealengine.com/t/pixel-perfect-drawing-to-render-target/272411/9 "2024-05-26T05:58:55Z")

</div>

Ddin´t know that, thanks for the info 🙂
