Skip to content

Commit 269df5b

Browse files
committed
USDZExporter: Support texture.wrapS and texture.wrapT.
1 parent 833f96d commit 269df5b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

examples/jsm/exporters/USDZExporter.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,12 @@ function buildMaterial( material, textures ) {
465465

466466
const uv = texture.channel > 0 ? 'st' + texture.channel : 'st';
467467

468+
const WRAPPINGS = {
469+
1000: 'repeat', // RepeatWrapping
470+
1001: 'clamp', // ClampToEdgeWrapping
471+
1002: 'repeat' // MirroredRepeatWrapping
472+
};
473+
468474
return `
469475
def Shader "PrimvarReader_${ mapType }"
470476
{
@@ -489,8 +495,8 @@ function buildMaterial( material, textures ) {
489495
asset inputs:file = @textures/Texture_${ id }.${ isRGBA ? 'png' : 'jpg' }@
490496
float2 inputs:st.connect = </Materials/Material_${ material.id }/Transform2d_${ mapType }.outputs:result>
491497
token inputs:sourceColorSpace = "${ texture.colorSpace === THREE.NoColorSpace ? 'raw' : 'sRGB' }"
492-
token inputs:wrapS = "repeat"
493-
token inputs:wrapT = "repeat"
498+
token inputs:wrapS = "${ WRAPPINGS[ texture.wrapS ] }"
499+
token inputs:wrapT = "${ WRAPPINGS[ texture.wrapT ] }"
494500
float outputs:r
495501
float outputs:g
496502
float outputs:b

0 commit comments

Comments
 (0)