panda3d-simplepbr icon indicating copy to clipboard operation
panda3d-simplepbr copied to clipboard

Document requirement that textures need to use an sRGB texture format

Open Moguri opened this issue 4 years ago • 0 comments

The PBR shader assumes that it can ready texture data as linear data (i.e., that an sRGB texture format is used and the hardware is doing an sRGB to linear conversion). The tonemapping shader also does a linear to sRGB conversion. Models imported via panda3d-gltf already use an sRGB format. However, other models will not use sRGB formats by default and can look weird (washed out or too dark). This can even apply if the PBR shader is skipped (e.g., for a custom skybox shader) since the tonemapping operation will still do the linear to sRGB conversion. Some details on conversion functions can be found here (if a user wants to convert the data in a shader). This is how panda3d-gltf sets Panda textures to be sRGB.

Moguri avatar Mar 12 '20 18:03 Moguri