# Compressed EnvMaps Broken Past r129 (for me at least)

**URL:** <https://discourse.threejs.org/t/compressed-envmaps-broken-past-r129-for-me-at-least/30924>\
**Category:** Questions\
**Tags:** compressed-textures, cube-texture, mipmaps\
**Created:** [October 18, 2021, 12:45am UTC](https://discourse.threejs.org/t/compressed-envmaps-broken-past-r129-for-me-at-least/30924 "2021-10-18T00:45:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![titansoftime](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/titansoftime/32/1044_2.png) [@titansoftime](https://discourse.threejs.org/u/titansoftime)\
**Post date:** [October 18, 2021, 12:45am UTC](https://discourse.threejs.org/t/compressed-envmaps-broken-past-r129-for-me-at-least/30924/1 "2021-10-18T00:45:24Z")

</div>

Upgrading from r129 to r133 has introduced an issue for me where three.js is assuming mipmaps exist for a dds/compressed cubetexture. This texture object has no mipmaps but rather an array of images. Those images do contain mipmaps but the base texture object does not. r129 works fine. Am I missing something here?

Uncomment line# 56 to show the problem.

[https://jsfiddle.net/titansoftime/v4eh7Lt2/](https://jsfiddle.net/titansoftime/v4eh7Lt2/)

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [October 18, 2021, 8:38am UTC](https://discourse.threejs.org/t/compressed-envmaps-broken-past-r129-for-me-at-least/30924/2 "2021-10-18T08:38:12Z")

</div>

I’ve filed a PR to fix this issue:

> <https://github.com/mrdoob/three.js/pull/22699>
>
> Related issue: https://discourse.threejs.org/t/compressed-envmaps-broken-past-r1…29-for-me-at-least/30924
> 
> \*\*Description\*\*
> 
> \`PMREMGenerator\` was not able so far to correctly detect compressed cube maps.

To clarify, you have used `MeshStandardMaterial` not correctly in your fiddle so far. It is required to preprocess the envmap via `PMREMGenerator`. Since `r131` the engine does this automatically which makes an error in `PMREMGenerator` visible. However, it is also present in earlier versions than `r131`.

---

<div class="post-metadata">

**Author:** ![titansoftime](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/titansoftime/32/1044_2.png) [@titansoftime](https://discourse.threejs.org/u/titansoftime)\
**Post date:** [October 18, 2021, 3:30pm UTC](https://discourse.threejs.org/t/compressed-envmaps-broken-past-r129-for-me-at-least/30924/3 "2021-10-18T15:30:20Z")

</div>

Great! Thank you for posting a PR.

To be perfectly honest I have no clue what PMREMGenerator is or how to use one in the context of using an envMap with a material. Is there documentation on this workflow or could some kind user edit the example fiddle to show how this is supposed to be done now?

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [October 18, 2021, 4:17pm UTC](https://discourse.threejs.org/t/compressed-envmaps-broken-past-r129-for-me-at-least/30924/4 "2021-10-18T16:17:10Z")

</div>

When you upgrade, it’s not necessary to work with this class in your fiddle anymore.

> [@titansoftime](#):
>
> To be perfectly honest I have no clue what PMREMGenerator is

Short version: `PMREMGenerator` preprocessed environment maps so they can be correctly used in context of PBR. Without `PMREMGenerator`, environment maps with `MeshStandardMaterial` or `MeshPhysicalMaterial` are considered to be physically incorrect.

---

<div class="post-metadata">

**Author:** ![titansoftime](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/titansoftime/32/1044_2.png) [@titansoftime](https://discourse.threejs.org/u/titansoftime)\
**Post date:** [October 18, 2021, 6:51pm UTC](https://discourse.threejs.org/t/compressed-envmaps-broken-past-r129-for-me-at-least/30924/5 "2021-10-18T18:51:47Z")

</div>

Oh ok, got it. Thank you.

I just use StandardMaterial since it supports roughness/metalness maps. I have no concern over physically correct envmaps.
