Skip to content

Commit

Permalink
Hotfix for PMREM environment map regression
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Joel authored and cdata committed Mar 6, 2019
1 parent 5ad748c commit 7603226
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions src/three-components/TextureUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,14 @@ export default class TextureUtils extends EventDispatcher {
// Apply the PMREM pass to the environment, which produces a distinct
// texture from the source:
const nonPmremEnvironmentMap = environmentMap;
environmentMap = this.pmremPass(
nonPmremEnvironmentMap,
this.config.defaultEnvironmentPmremSamples,
this.config.defaultEnvironmentPmremSize)
const samples = environmentMapWasGenerated ?
this.config.defaultEnvironmentPmremSamples :
this.config.pmremSamples;
const size = environmentMapWasGenerated ?
this.config.defaultEnvironmentPmremSize :
this.config.pmremSize;

environmentMap = this.pmremPass(nonPmremEnvironmentMap, samples, size);

// If the source was generated, then we should dispose of it right away
if (environmentMapWasGenerated) {
Expand Down

0 comments on commit 7603226

Please sign in to comment.