Browse Source

Trying alternate filter settings

WestLangley 5 years ago
parent
commit
53bb46314a
2 changed files with 11 additions and 10 deletions
  1. 5 7
      examples/webgl_loader_texture_exr.html
  2. 6 3
      examples/webgl_materials_envmaps_exr.html

+ 5 - 7
examples/webgl_loader_texture_exr.html

@@ -51,17 +51,15 @@
 					.setDataType( THREE.FloatType )
 					.load( 'textures/memorial.exr', function ( texture, textureData ) {
 
+						// memorial.exr is NPOT
+
 						//console.log( textureData );
 						//console.log( texture );
 
-						texture.minFilter = THREE.NearestFilter;
-						texture.magFilter = THREE.NearestFilter;
-
-						// these setting are currently set correctly by default
-						//texture.encoding = LinearEncoding;
-						//texture.minFilter = LinearMipmapLinearFilter;
+						// EXRLoader sets these default settings
+						//texture.generateMipmaps = false;
+						//texture.minFilter = LinearFilter;
 						//texture.magFilter = LinearFilter;
-						//texture.flipY = true;
 
 						var material = new THREE.MeshBasicMaterial( { map: texture } );
 

+ 6 - 3
examples/webgl_materials_envmaps_exr.html

@@ -77,10 +77,13 @@
 					.setDataType( THREE.FloatType )
 					.load( 'textures/piz_compressed.exr', function ( texture ) {
 
-						texture.minFilter = THREE.NearestFilter;
-						texture.encoding = THREE.LinearEncoding;
+						var options = {
+							generateMipmaps: false,
+							minFilter: THREE.LinearFilter,
+							magFilter: THREE.LinearFilter
+						};
 
-						exrBackground = new THREE.WebGLRenderTargetCube( 512, 512 ).fromEquirectangularTexture( renderer, texture );
+						exrBackground = new THREE.WebGLRenderTargetCube( 512, 512, options ).fromEquirectangularTexture( renderer, texture );
 
 						var pmremGenerator = new PMREMGenerator( exrBackground.texture );
 						pmremGenerator.update( renderer );