简体   繁体   中英

Buggy edges in three.js when using gltf

Does anybody know how to get rid of this bug?

边缘有问题

It doesn't occur on stuff created in three.js code (as for example the tree is not a.gltf but handcrafted code). However, the "sheep-like" thing I imported through a gltf (exported by blockbench) and I mean yeah - this looks completely inacceptable. I tried different scales but the edges are bugged no matter what scale I set the sheep to.

const loader = new GLTFLoader();

  loader.load( './sheep.gltf', function ( gltf ) {

    var gltfO = gltf.scene;
    //gltfO.scale.set(0.05, 0.05, 0.05);
    gltfO.position.set(0,-sz/2,0);
    scene.add( gltfO );

  }, undefined, function ( error ) {

    console.error( error );

  } );
  

Turns out this is an issue with UV Mapping. At least I figured out a work around that one can apply in blockbench. Instead of just painting the rectangle in the UV you also need to paint the border OUTSIDE the rectangle. Not really a solution but it's at least a workaround. Probably doesn't work for non unicolor texture? I don't know. But it works in this case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM