koerismo / PBR-2-Source

A Python-powered gui for converting pbr materials into Source Engine-compatible materials.
GNU General Public License v3.0
23 stars 2 forks source link

v2.0.5-beta Gamma Bug #14

Open Jofoyo opened 1 week ago

Jofoyo commented 1 week ago

Repro Settings Windows 10 EP2/P/TF2 Model Phong+Envmap

Gamma settings are currently scaled incorrectly. This is also seen in the file preview. Normal map green channel is also flipped after gamma is applied which results in an overbright green channel but isn't a problem if gamma correction isn't applied anyway.

image

koerismo commented 1 week ago

Hello! This gamma "correction" is not at all intentional, and seems to come from the way that Qt reads images. I have no idea why this happens or how to fix it.

Jofoyo commented 1 week ago

Hello! This gamma "correction" is not at all intentional, and seems to come from the way that Qt reads images. I have no idea why this happens or how to fix it.

I've done some additional repro testing. This seems to be related to embedded color management profiles in the texture file. After resaving the file with and without embedded ICC from Photoshop, the version without had proper gamma. This is apparent both on jpeg and png. This is also why I didn't notice it before, and that's my bad for using a different texture set to test, as the former was not color managed.

I believe color management can usually be discarded for texture applications like this, and there should be a way to do this with your IO library.