Postprocessing: Missing support for renamed LinearMipmapLinearFilter

Created on 20 Apr 2020  Â·  6Comments  Â·  Source: vanruesc/postprocessing

LinearMipMapLinearFilter was renamed in [email protected]

I'm using [email protected] (obviously <0.107.0) which – according to your Relases-Log – should be compatible with the latest version of postprocessing, as it's in range 0.102.0 ≤ x < 0.116.0.

But the console states:

WARNING in ../node_modules/postprocessing/build/postprocessing.esm.js 10510:15-39
"export 'LinearMipmapLinearFilter' was not found in 'three'

Should be fixable by a simple LinearMipMapLinearFilter || LinearMipmapLinearFilter I think! Maybe I'll find the line and submit a PR.

question

All 6 comments

Ah, I see, you already did what i supposed.

  1. Is there any solution without spamming the console?
  2. Can this prevent the whole canvas from rendering? Sometime this seems to be the case (but there are more warnings like THREE.ConvolutionMaterial: 'toneMapped' is not a property of this material.)

Unfortunately, three exports all kinds of constants as-is and doesn't group them. If there was a TextureFilter enum object, we could import that and probe it for the right constant at runtime. But instead, both constants need to be imported to support older versions of three at the cost of a bundler warning and to prevent warnings in newer versions which are the main focus.

Is there any solution without spamming the console?

How often and where do you see console spam?

Can this prevent the whole canvas from rendering?

It shouldn't. If it did, there would be an error message.

THREE.ConvolutionMaterial: 'toneMapped' is not a property of this material.

That warning can be ignored. Fullscreen materials disable the toneMapped flag to prevent newer versions of three from injecting some unnecessary shader code. It has no effect in older versions. The only way to get rid of this warning is to upgrade three to 0.108.x or downgrade postprocessing to 6.10.x.

How often and where do you see console spam?

It's just the LinearMipmapLinearFilter thing once and toneMapped warnung multiple times (2 at startup + many at animating an effect/pass by re-adding it to the EffectComposer)

It shouldn't. If it did, there would be an error message.

Yeah, I now think this is some other internal bug. Thanks for clarifying!

only way to get rid of this warning is to upgrade three to 0.108.x or downgrade postprocessing to 6.10.x.

Unfortunately I can't upgrade three for internal project reasons. Downgrading postprocessing to 6.10.0 didn't do the trick: the warnings disappeared but the canvas stays black. But nevermind! I can use 6.13.3 and if I know it's safe, I can ignore those warnings. (Maybe you could document which warnings to expect when using the current version of postprocessing?). Thanks a lot for your quick response!

Maybe you could document which warnings to expect when using the current version of postprocessing?

The warnings from three are usually self-explanatory and already some form of documentation. I could add a blanket statement along the lines of "Expect warnings with older versions of three", but I'm not sure if that's really necessary.

The peer dependency range is an indicator of compatibility, so using any version in that range should work without errors. If someone finds a version where that's not the case, then there's a bug in postprocessing.

many at animating an effect/pass by re-adding it to the EffectComposer

This sounds like an unusual use case; the toneMapped warning should only occur when creating a new pass or effect. Anyway, I'll consider changing the way the toneMapped flag is set to avoid the warning in the future.

Anyway, I'll consider changing the way the toneMapped flag is set to avoid the warning in the future.

Cool! Many thanks!

"Expect warnings with older versions of three", but I'm not sure if that's really necessary.

Was just a suggestion. No real need! But if you add it: is there really only warnings with older three versions? If I get it right, both versions of LinearMipMapLinearFilter are imported and got renamed from three v0.106.0 to v0.107.0... So the warning should appear with newer three versions, too. Am I missing something?

Am I missing something?

The constant was renamed in a backwards-compatible way; the old constant still exists in the current version of three. So when a new version is used together with postprocessing, both constants are available and can be imported.

Was this page helpful?
0 / 5 - 0 ratings