Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Weirdest texture compression bug I've seen. Need help!

I'm working on viking weapon sets. Recently got to making shields. The base idea was to make couple bland wooden shields and then apply paint texture on top of it via masks so I could use material instances later to apply variations of shield patterns. I began to work on the first pattern and used simple black and white mask to just apply paint over the wood to see how it will look and start making more complex texture masking later. A-a-and... Strange thing happened. The colorful pattern texture was... weird.

To fully describe it, let me show you something. So the pattern itself is a wyrm with golden outline on blue background. Here's how it looks in photoshop: alt text Now, I will disable golden outline and import it in ue4:

alt text Looks fine. Smooth lines.

This time, I will enable outlines layer in photoshop, and disable brown coloring: alt text That also looks fine.

And now let's enable both outlines and coloring: alt text

WHAT THE HELL HAPPENED?! (right click the image and open it in new tab to see what I mean)

This is how I first imported the texture in ue4 and saw weird pixels of blue and brown coming from under smooth golden outline. When I begin to try to figure out what causes it, I discovered, that if brown coloring is separated from golden outline, it looks fine. But when they are together - it's all messed up. Which doesn't make any sense! Why is this happening?

I tried different image formats - it doesn't matter. I tried different compression settings in ue4 - on some it fixes the issue, but they increase file size and don't work with applying to mesh as texture.

If anyone has any idea about what is this crap, please share with me! I'm stuck.

Product Version: UE 4.16
more ▼

asked Jul 19 '17 at 11:04 AM in Rendering

avatar image

56 12 15 23

avatar image Luos Jul 19 '17 at 11:09 AM

Hey Kligan, how are you creating the masks in ue4? is each mask a seperate texture or are you combining them in the RGB channels?

Care to tell us and perhaps show us the material setup so I/we can hopefully advice you a bit better.

avatar image Kligan Jul 19 '17 at 11:13 AM

Hey! The material is very simple so far: alt text

The problem is in texture itself once it gets imported in ue4, as you can see here (again, open in new tab to see): alt text

For some reason, it somehow smears the brown and blue colors, while keeping golden outline intact.

1.png (510.2 kB)
2.png (1.2 MB)
avatar image Kligan Jul 19 '17 at 01:22 PM

Increasing the resolution of the pattern texture to 2k fixes it... but obviously I want to avoid doing that for optimization reasons. Nothing else works to fix it and I don't know what to do :(

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

ok, set anything thats just grayscale to "alpha" compression setting, its one of the more crisp settings. also for those textures with the "alpha compression" setting, only use the red output, no need for the RGB output. that should help with the crispness without the need to go to 2k.

for additional compression tricks for masks etc look at: https://www.youtube.com/watch?v=mzairog7Elw

In your case you might not want to merge the grayscale channels into an RGB setup but keep em seperate grayscale's set to alpha compression.

If the files are rather small, you can decide to remove mipmaps as well, though shouldn't be needed.

more ▼

answered Jul 19 '17 at 01:29 PM

avatar image

9.3k 286 65 330

avatar image Kligan Jul 19 '17 at 01:32 PM

The problem is not mask texture. The problem is the pattern RGB texture as can be seen on the previous screenshot. It's not that it looks bad on the mesh, it just looks bad after compression, the texture itself. And only when both golden outline and brown coloring are there. If I disable either of them in photoshop, pixelisation of blue-brown disappears.

Edit: and thanks for the video, I will check it out.

avatar image Luos Jul 19 '17 at 02:21 PM

did you make sure that any of the mask textures dont have SRGB enabled? that will cause a lot of crosstalk between rgb layers.

sadly I dont have the time to do a hangout call atm, else i'd help you out that way. you can always join https://discord.gg/unreal-slackers (discord channel) and ask there if you feel like more help is needed.

avatar image Kligan Jul 19 '17 at 02:25 PM

Yes, masks are all fine. They do not interfere with textures at all. As I've mentioned before, I narrowed down the issue to compression messing up the texture for some reason. Thank you for the discord link.

avatar image Kligan Jul 19 '17 at 04:07 PM

(I couldn't figured out how to mark this comment as an answer and ended up deleting it by accident lol :D Here's it again)

Ok, your video was very helpful! Using your method I cropped the colorful pattern texture and thus increased its quality w/o increasing file size.

Here's how material looks like now: alt text

And this is the end result: alt text

That is exactly what I needed! Now I can finally move on to making it look like painted wood, rather than just blue surface with wood normals :D

Thank you a lot!

2.png (658.9 kB)
1.png (2.7 MB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

This is expected behavior from DXT1. http://reedbeta.com/blog/understanding-bcn-texture-compression-formats/#bc1

Color channels are not compressed separately and instead each 4x4 block has two endpoints. So blue pixels just bleed over thin outline.

more ▼

answered Jul 19 '17 at 02:26 PM

avatar image

241 11 24 32

avatar image Kligan Jul 19 '17 at 02:44 PM

Yeah, I figured it had to do with compression. Now I only need to figure how to work-around this...

avatar image Kalle_H Jul 19 '17 at 06:46 PM

Try to use BC7 texture compression.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question