Kaynağa Gözat

Merge pull request #15757 from mrdoob/cubetexture

CubeTexture: Use RGBFormat by default.
Mr.doob 6 yıl önce
ebeveyn
işleme
692e82045b

+ 4 - 0
examples/webgl_materials_envmaps_hdr.html

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

+ 2 - 1
src/textures/CubeTexture.js

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