Open donmccurdy opened 2 years ago
@elalish I see RoughnessMipmapper.js
depended on constants (r0
, r1
, ...) defined in the cube_uv_reflection_fragment
fragment, and that those constants need to match PMREMGenerator. Do you know if this means roughness mipmaps generated by this method should only be used in three.js? Or would they still probably be better than the default mipmaps in other engines?
I believe the required tasks for this feature will be:
ndarray-pixels
R
, B
, and A
channels in roughness texture (if present) with ndarray-lanczos
G
@squoosh/lib
pending https://github.com/GoogleChromeLabs/squoosh/pull/1017No, I just reused those constants for convenience. The roughness lost per normal map mip level is universal and independent of the style of PMREM.
In prior versions of three.js, THREE.RoughnessMipmapper did the following:
This feature had to be removed (see https://github.com/mrdoob/three.js/pull/23143) as a runtime-generation option. However, because glTF-Transform already embeds mipmaps when converting textures to KTX2, it would make sense to (optionally) compute the same custom mipmaps for a roughness map and store them in the KTX2 container. Doing this offline gives the same rendering benefits, with no parsing or performance cost.