diff --git a/README.md b/README.md index 65728e79..2200881d 100644 --- a/README.md +++ b/README.md @@ -805,16 +805,6 @@ _extends DataTexture_ Helper texture uniform for encoding materials as texture data. -### .threeCompatibilityTransforms - -```js -threeCompatibilityTransforms = false : Boolean -``` - -Three.js materials support only a single set of UV transforms in a certain fallback priority while the pathtracer supports a unique set of transforms per texture. Set this field to true in order to use the same uv transform handling as three.js materials. - -See fallback order documentation [here](https://threejs.org/docs/#api/en/textures/Texture.offset). - ### .setMatte ```js diff --git a/src/uniforms/MaterialsTexture.js b/src/uniforms/MaterialsTexture.js index b9afa78b..177f7c87 100644 --- a/src/uniforms/MaterialsTexture.js +++ b/src/uniforms/MaterialsTexture.js @@ -56,7 +56,6 @@ export class MaterialsTexture extends DataTexture { this.minFilter = NearestFilter; this.magFilter = NearestFilter; this.generateMipmaps = false; - this.threeCompatibilityTransforms = false; this.features = new MaterialFeatures(); } @@ -117,47 +116,9 @@ export class MaterialsTexture extends DataTexture { } - function getUVTransformTexture( material ) { - - // https://github.com/mrdoob/three.js/blob/f3a832e637c98a404c64dae8174625958455e038/src/renderers/webgl/WebGLMaterials.js#L204-L306 - // https://threejs.org/docs/#api/en/textures/Texture.offset - // fallback order of textures to use as a common uv transform - return material.map || - material.specularMap || - material.displacementMap || - material.normalMap || - material.bumpMap || - material.roughnessMap || - material.metalnessMap || - material.alphaMap || - material.emissiveMap || - material.clearcoatMap || - material.clearcoatNormalMap || - material.clearcoatRoughnessMap || - material.iridescenceMap || - material.iridescenceThicknessMap || - material.specularIntensityMap || - material.specularColorMap || - material.transmissionMap || - material.thicknessMap || - material.sheenColorMap || - material.sheenRoughnessMap || - null; - - } - function writeTextureMatrixToArray( material, textureKey, array, offset ) { - let texture; - if ( threeCompatibilityTransforms ) { - - texture = getUVTransformTexture( material ); - - } else { - - texture = material[ textureKey ] && material[ textureKey ].isTexture ? material[ textureKey ] : null; - - } + const texture = material[ textureKey ] && material[ textureKey ].isTexture ? material[ textureKey ] : null; // check if texture exists if ( texture ) { @@ -187,7 +148,7 @@ export class MaterialsTexture extends DataTexture { let index = 0; const pixelCount = materials.length * MATERIAL_PIXELS; const dimension = Math.ceil( Math.sqrt( pixelCount ) ) || 1; - const { threeCompatibilityTransforms, image, features } = this; + const { image, features } = this; // get the list of textures with unique sources const uniqueTextures = reduceTexturesToUniqueSources( textures );