Pixel perfect drawing to render target?

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?

1 Like

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:

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

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.

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.

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?

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.

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… :frowning:

Found the solution :slight_smile:

1 Like

Ddin´t know that, thanks for the info :slight_smile: