Facepunch / RustWorkshop

32 stars 23 forks source link

Normal map seam #13

Open Tatten opened 8 years ago

Tatten commented 8 years ago

Simply opening and saving the normal map creates a shift in normals, seams appear. Have tried with every image editing software I have. Absolutely no edits were made. Files were saved as they were - 32bit png.

Possibly something with the palette or compression? When looking very closely at the new normal map it appears that there are very slight compression artifacts.

http://i.imgur.com/D8ZUdxK.png Hoodie in the image: The vanilla normal map on left. Opened, unedited and saved normal map on right. Below the normal maps are: Old map saved from Unity Rust SDK on the left and new Rust workshop on the right. Compared samples from both show a slight shift into lighter blues with the new.

garrynewman commented 8 years ago

It's more likely a fuckup with gamma/linear. What Os are you on? 32bit, 64bit?

Tatten commented 8 years ago

Windows 7 64bit sir.

garrynewman commented 8 years ago

Just tried this in editor:

image

image

I'm not seeing a massive difference.

When I diff the files in photoshop I am seeing a slight difference, I'm not sure compression would explain it.

image

It may have to do with resizing possibly? The SDK version is 2048x1024, but in game it's always compressed to 1024 wide or less.

Tatten commented 8 years ago

Normal maps on the left are from the Rust SDK, ones on the right are Workshop. Without question there is a loss of all greens and reds. http://i.imgur.com/zSpRw3S.png and http://i.imgur.com/i4lePEq.png

To fully illustrate the shift in normals I increased the gloss of the riot helmet. Vanilla normals on the left - The one on the right has been opened Unedited and saved in photoshop. Red mark was just for visibility of the shift. http://i.imgur.com/F3Ex06w.png

The difference in normals can be quite a lot on certain skins. This is the long sleeve shirt SDK vs Workshop difference. http://i.imgur.com/dTnoRhN.png

The seam I showed on the hoodie was intentionally lit for the strongest effect with a low angle.

SDK and opened/saved Workshop normal maps are almost identical when being rendered in Workshop with both having slight seam issues. Only untouched Workshop ones display different/correct.

What I had thought was possibly compression artifacts appears to be a simple noise being applied by the artist for texture.

Possible that it is only a Workshop display issue and in-game none of this would show up?

I truly don't mean to be a bother sir. I only wish to produce quality skins with custom normals. Honesty I don't think in all but the most extreme lighting situations people could notice even the worst seams from this issue.

Thank you very much for your time.

garrynewman commented 8 years ago

There is an inherent difference with the downloaded and uploaded versions. We drop the blue channel - because it isn't needed, and isn't used by Unity internally. Maybe that has something to do with it.

elfideorubio commented 8 years ago

same issue seams cuts get drawn on the normal map https://gyazo.com/a7afc5d0278966e9129b3a4b25d68457

garrynewman commented 8 years ago

That might be unrelated - can you upload the texture you're using?

elfideorubio commented 8 years ago

here it is orangeburlap

and here is the normal map orangeburlapnormal

Tatten commented 8 years ago

I believe the black you are showing is from the diffuse map itself. Because of filtering overpainting the edges of the texture maps is almost always required. Whatever you used to generate the normal map also appears to have very stark inverted edge on the round edges of the lower piece. Look at the maps that come from the developers, they always have the texture extend beyond the exact edges of the UV map.

elfideorubio commented 8 years ago

I think the issue was not using a background, using a background should smooth the edges by blending them so they wouldn't look as sharp as they do.

TheMarex86 commented 8 years ago

There are still some problems with normals. Downloading and uploading the same normal map mess up the object. output_yubida

When png are compared there is obvious difference and image is resized from 2048x1024 to 1024x512 output_8x7vbr

I did some testing, and manually resizing image before uploading does the trick, but it is loosing a bit on quality... output_lhuqnh

Regards TheMarex86

garrynewman commented 8 years ago

In that example the default texture resolution was 2x higher than the enforced maximum. This was a mistake on our part, so I lowered the default size.

warpunkSYNE commented 7 years ago

Hate to bring this back into the light but just to be clear, you're saying we can't modify the size of the normal maps?

ipiv commented 4 years ago

about 3 years later I seem to be having similar issue with normal maps: https://streamable.com/thg77x

I Have tried:

Sys info: Windows 10, 64bit. GTX1070 latest Nvidia drivers

I can only assume that it is an issue with compression/conversion. Also to note that the texture thumbnail appears to be grayscale after importing.

Before: image After downloading and applying the same texture (especially noticeable is the seam that appears): image

oxhid3 commented 9 months ago

Anyone managed to solve this? I can confirm that today feb2024 the same issue applies when downloading the Normal Map and re assigning it (there is an obvious issue here) x1 x2

I also tried to convert to 8bit/16bit and exported from PS and Substance as L16f/L32g/Srgb/Rgb32f/Rgb16f/L16/l8 and all other formats. I tried manually downsampling it to 512 / 1024 and still did not work.

Anyone tried to "normalize" the maps via phyton? (not really good at it but could that be?) Any ideas?

cheers