问题
I'm looking at the example here: http://threejs.org/examples/#webgl_decals
If I shoot a decal on the lips, adjust the orbital controls minimum distance, and go inside the mesh, I can see the decal on the inside of the mesh. Is there a way to prevent this? I'm trying to use the decal for something else where it is not desireable to have the decal show on both sides. Since THREE.DoubleSide is not the default, I'm not sure how this is happening.
回答1:
When you create your material, simply set which side (or both) you want the decal to appear on using THREE.DoubleSide, THREE.FrontSide (default) or THREE.BackSide. Look at the material object for more info...
var decalMaterial = new THREE.MeshPhongMaterial( {
map: decalNormal,
transparent: true,
depthTest: true,
depthWrite: false,
polygonOffset: true,
polygonOffsetFactor: - 4,
side: THREE.DoubleSide
});
来源:https://stackoverflow.com/questions/37823981/prevent-decal-from-showing-on-inside-of-mesh