Skip to content

Commit

Permalink
Fixed pixellated backgrounds when using hdr cubemaps.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Jan 30, 2019
1 parent 8ced1eb commit abb0e11
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 24 deletions.
3 changes: 3 additions & 0 deletions examples/webgl_materials_envmaps_hdr.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@

hdrCubeRenderTarget = pmremCubeUVPacker.CubeUVRenderTarget;

hdrCubeMap.magFilter = THREE.LinearFilter;
hdrCubeMap.needsUpdate = true;

pmremGenerator.dispose();
pmremCubeUVPacker.dispose();

Expand Down
15 changes: 4 additions & 11 deletions examples/webgl_materials_standard.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,6 @@

//

new THREE.CubeTextureLoader()
.setPath( 'textures/cube/pisa/' )
.load( [ 'px.png', 'nx.png', 'py.png', 'ny.png', 'pz.png', 'nz.png' ], function ( textureCube ) {

scene.background = textureCube;

} );

//

var material = new THREE.MeshStandardMaterial();

new THREE.OBJLoader()
Expand Down Expand Up @@ -174,7 +164,10 @@
material.envMap = hdrCubeRenderTarget.texture;
material.needsUpdate = true; // is this needed?

hdrCubeMap.dispose();
hdrCubeMap.magFilter = THREE.LinearFilter;
hdrCubeMap.needsUpdate = true;
scene.background = hdrCubeMap;

pmremGenerator.dispose();
pmremCubeUVPacker.dispose();

Expand Down
11 changes: 4 additions & 7 deletions examples/webgl_materials_variations_physical.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,7 @@

};


var textureCube = new THREE.CubeTextureLoader()
.setPath( 'textures/cube/pisa/' )
.load( [ 'px.png', 'nx.png', 'py.png', 'ny.png', 'pz.png', 'nz.png' ] );

scene = new THREE.Scene();
scene.background = textureCube;

var hdrUrls = genCubeUrls( './textures/cube/pisaHDR/', '.hdr' );
var hdrCubeRenderTarget = null;
Expand Down Expand Up @@ -150,7 +144,10 @@

}

hdrCubeMap.dispose();
hdrCubeMap.magFilter = THREE.LinearFilter;
hdrCubeMap.needsUpdate = true;
scene.background = hdrCubeMap;

pmremGenerator.dispose();
pmremCubeUVPacker.dispose();

Expand Down
10 changes: 4 additions & 6 deletions examples/webgl_materials_variations_standard.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,7 @@

};

var textureCube = new THREE.CubeTextureLoader()
.setPath( 'textures/cube/pisa/' )
.load( [ 'px.png', 'nx.png', 'py.png', 'ny.png', 'pz.png', 'nz.png' ] );

scene = new THREE.Scene();
scene.background = textureCube;

var hdrUrls = genCubeUrls( './textures/cube/pisaHDR/', '.hdr' );
var hdrCubeRenderTarget = null;
Expand Down Expand Up @@ -154,7 +149,10 @@

}

hdrCubeMap.dispose();
hdrCubeMap.magFilter = THREE.LinearFilter;
hdrCubeMap.needsUpdate = true;
scene.background = hdrCubeMap;

pmremGenerator.dispose();
pmremCubeUVPacker.dispose();

Expand Down

0 comments on commit abb0e11

Please sign in to comment.