Is there a built-in way to layer textures within the standard PBR shader?

后端 未结 1 1815
孤城傲影
孤城傲影 2020-12-06 15:00

I want to have an effect similar to this question, in Aframe, to have layered swappable textures on a single model:

I am wondering if there is a standard process I h

相关标签:
1条回答
  • 2020-12-06 15:16

    You want to layer materials or textures using three.js.

    Here is a pattern that is supported:

    var geometry = new THREE.BoxBufferGeometry( 10, 10, 10 );
    geometry.clearGroups();
    geometry.addGroup( 0, Infinity, 0 );
    geometry.addGroup( 0, Infinity, 1 );
    geometry.addGroup( 0, Infinity, 2 );
    geometry.addGroup( 0, Infinity, 3 );
    
    var materials = [ material0, material1, material2, material3 ];
    
    // mesh
    mesh = new THREE.Mesh( geometry, materials );
    scene.add( mesh );
    

    fiddle: http://jsfiddle.net/o6atcaeg/

    three.js r.91

    0 讨论(0)
提交回复
热议问题