浏览代码

Merge pull request #15757 from mrdoob/cubetexture

CubeTexture: Use RGBFormat by default.
Mr.doob 6 年之前
父节点
当前提交
692e82045b
共有 2 个文件被更改,包括 6 次插入1 次删除
  1. 4 0
      examples/webgl_materials_envmaps_hdr.html
  2. 2 1
      src/textures/CubeTexture.js

+ 4 - 0
examples/webgl_materials_envmaps_hdr.html

@@ -152,6 +152,7 @@
 					.load( rgbmUrls, function () {
 
 						rgbmCubeMap.encoding = THREE.RGBM16Encoding;
+						rgbmCubeMap.format = THREE.RGBAFormat;
 
 						var pmremGenerator = new THREE.PMREMGenerator( rgbmCubeMap );
 						pmremGenerator.update( renderer );
@@ -161,6 +162,9 @@
 
 						rgbmCubeRenderTarget = pmremCubeUVPacker.CubeUVRenderTarget;
 
+						rgbmCubeMap.magFilter = THREE.LinearFilter;
+						rgbmCubeMap.needsUpdate = true;
+
 						pmremGenerator.dispose();
 						pmremCubeUVPacker.dispose();
 

+ 2 - 1
src/textures/CubeTexture.js

@@ -3,12 +3,13 @@
  */
 
 import { Texture } from './Texture.js';
-import { CubeReflectionMapping } from '../constants.js';
+import { CubeReflectionMapping, RGBFormat } from '../constants.js';
 
 function CubeTexture( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ) {
 
 	images = images !== undefined ? images : [];
 	mapping = mapping !== undefined ? mapping : CubeReflectionMapping;
+	format = format !== undefined ? format : RGBFormat;
 
 	Texture.call( this, images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );