Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
134 stars 2 forks source link

PBS_ColorSplat Specular and Metallic exhibit incorrect handling of metallic, specular, and smoothness values in specific configurations #260

Open Epimonster opened 11 months ago

Epimonster commented 11 months ago

Describe the bug?

Splatmap materials with only certain Metallic/Smoothness or Specular/Smoothness maps initialized will only display correct values for the texture fields that are initialized, and the rest of the fields are replaced with default values.

On Specular color this value is Specular Color (1,1,1,1) which results in the white reflective look.

For Metallic they default to Metallic 0 and Smoothness 0

To Reproduce

As a forward, all materials used in this can be found in the following public folder, making replication even easier:

resrec:///U-Gareth48/R-F667FABFDEB303703C6BB1CF5DC2776DA4D7DECCD449EC6F96FD4020ADA37838

For Metallic:

For Specular:

Expected behavior

Previously, splatmap materials would read from SpecularMap0-3 or MetallicMap01/23 where present and the rest of the values would be read from the SpecularColor0-3 and Metallic0-3 and Smoothness0-3 fields respectively where texture maps were not present. However this does not happen in the current case and instead it becomes the default values discussed above. This causes an large visual difference between earlier versions of this shader and its current iteration.

Screenshots

2023-10-17 20 25 05

The rest of the screenshots can be found in the replication section since they're more useful there than here when explaining the issue.

Resonite Version Number

2023.10.13.743

What Platforms does this occur on?

Windows

What headset if any do you use?

Desktop

Log Files

Sorry in advance my log files are always weirdly large for unrelated reasons to this bug.

In this case, this issue is caused by shader setup, its less of a runtime bug and more a different structure yields different results.

DESKTOP-IKI1CHO - 2023.10.17.464 - 2023-10-17 17_33_30.log

Additional Context

Maps known to be effected by this:

One more note: The solution to this problem is not to just tick multivalue as that combines the values found in the fields SpecularColor0-3, Metallic0-3, and Smoothness0-3 with the texture maps present in Metallic01/23 and Specular0-3, so that would work in certain specific cases but not all of them.

Currently the temp fix New_Project is employing (suggested by badhaloninja) is to initialize all fields that are empty with a solid color texture equivalent to the previous value found in the SpecularColor0-3 fields or in the Metallic01/23 fields. This mimics the original look without needing to cause parity issues elsewhere.

Reporters

This bug has a storied history, and quite a few people discovered it, replicated it, re-tested it, and contributed potential solutions, the group that did this are the people below:

shiftyscales commented 1 month ago

Seeking input from @Geenz.