secondlife / viewer

🖥️ Second Life's official client
GNU Lesser General Public License v2.1
188 stars 42 forks source link

[PBR] PBR Material resets to legacy material after teleport. #853

Open KrsityKu opened 2 months ago

KrsityKu commented 2 months ago

Environment

This happens on the Official Viewer, Alchemy and Firestorm.

Firestorm 7.1.3 (72975) Feb 15 2024 18:43:30 (64bit / SSE2) (Firestorm-Betax64) with Havok support

You are at 228.7, 84.5, 3,414.4 in Loveless Determination located at simhost-057358e8a50dc518c.agni SLURL: http://maps.secondlife.com/secondlife/Loveless%20Determination/229/85/3414 (global coordinates 273,381.0, 333,652.0, 3,414.4) Second Life Server 2024-01-19.7590161929

CPU: AMD Ryzen 9 7950X 16-Core Processor (4499.89 MHz) Memory: 64652 MB (Used: 2987 MB) Concurrency: 32 OS Version: Microsoft Windows 11 64-bit (Build 22621.3155) Graphics Card Vendor: NVIDIA Corporation Graphics Card: NVIDIA GeForce RTX 4090/PCIe/SSE2 Graphics Card Memory: 23374 MB

Windows Graphics Driver Version: 31.0.15.5152 OpenGL Version: 4.6.0 NVIDIA 551.52

Description

Certain meshes lose PBR material after teleporting. I've initially spotted this issue around Christmas time when trying to DIY PBR-ify a mod item I had, and after applying PBR material to all the faces, one of the faces would revert to legacy material. I could initially only reproduce it on one specific mesh, but today I discovered another mesh that has the same issue.

Both of the meshes seem to have weird interleaving faces:

Firestorm-Betax64_hKfwQFoV66

The white baked specular highlight is the legacy texture, while the very dark grey is a PBR material I've applied. When the item is detached and rettached or rezzed quite often it has PBR material on all faces, but one of them reverts back about 2s later. As per title, teleporting also reverts the material. Relogging does fit the issue until next teleport.

Upon further investigation, we've found out that llGetNumberOfSides() returns 2 in this specific item, but the viewer reports 3 faces:

Firestorm-Betax64_W1VJSdrFSx

So far I've only ran into two items that do this. The stockings with the issue are Maitreya version of this: https://marketplace.secondlife.com/p/AURORA-Maid-set-FATPACK/20475576 If you need more details of the items, or need an in-world demonstration, do let me know.

Reproduction steps

  1. Acquire mesh with the weird faces as described in the description.
  2. Apply a PBR material on all the faces
  3. Teleport to any other region
  4. One of the faces has now lost PBR material
  5. Logout and login
  6. Item looks correct again, until step 3 is repeated.
AtlasLinden commented 2 months ago

Hi KrsityKu, Do other users also see this issue? This could be related to an old open issue regarding an extra side being given to a mesh upon upload which can cause a bug similar to this when applying a new texture. https://github.com/secondlife/jira-archive/issues/4046 Are you able to reproduce this issue on a mesh where llGetNumberOfSides() returns the the same value as what you've inspected?

KrsityKu commented 2 months ago

Yes other people could see it, on the first teleport in, it would look fine, but if I detached and re-attached a few times, it would break. Also, if I rezz it on the ground others saw the issue too.

As far as I can tell llGetNumberOfSides() always returns 2 for that specific mesh, and using edit tools on the item, I can always see 3 faces.

KrsityKu commented 2 months ago

It might be a similar issue to the one you've listed - I've just tried to apply unique tint to all 3 faces on legacy materials, re-rezzing the item changed tint value of the faces to the same as another to have only 2 unique colours. If you'd like to see it in world, my SL name is Kristy Aurelia.

Edit: I messed around with it some more, if I tint legacy colours all unique, and re-rezz, or make a copy of the item... it resets the error face to be what it should be based on the correct face. Could it be that whatever viewer does to 'fix' the mystery face is incorrectly resetting PBR material rather than copying over from the correct face?

Edit 2: this is interesting, adding a script to the item, while all 3 faces are unique colours, resets the broken face to match. And if PBR is applied to all 3 faces, doing the same thing causes the 3rd face to swap to legacy materials. Trying to change any material properties on that face, also immediately reverts to the default value.

AtlasLinden commented 2 months ago

Hi KrsityKu, Unfortunately, I'd expect this issue to persist for any changes due to the 3rd face error in this specific mesh. Asking the creator to reupload the mesh could be a solution for this but it may still hit the original error. Stay tuned for a fix for https://github.com/secondlife/jira-archive/issues/4046.

Please let us know if you're able to reproduce this issue with a mesh that doesn't contain this error.

KrsityKu commented 2 months ago

Hi, Atlas. Considering this specific mesh is from at least 2020 and the bug you mentioned dates to 2018, I would assume there are plenty of other meshes experiencing the same issue, and probably some that are made by creators who are no longer active, but their meshes are still being used.

The two meshes I've experienced this issue with both have the erroneous faces.