Skip to content

Remove threeCompatibilityTransforms #549

@mrdoob

Description

@mrdoob

I think these can be removed now?

### .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).

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions