When working with textures in three.js, I often find myself wanting to add some specularity or shininess to my objects. While browsing examples, I come across code snippets like this:
new THREE.MeshPhongMaterial( {
color: 0x996633,
specular: 0x050505,
shininess: 100
} );
However, my own code looks quite different:
// Applying a texture
var texture = new THREE.Texture();
var imgLoader = new THREE.ImageLoader( manager );
imgLoader.load( 'assets/uv.png', function ( image ) {
texture.image = image;
texture.needsUpdate = true;
} );
// Loading the model
var loader = new THREE.OBJLoader( manager );
loader.load( 'assets/obj.obj', function ( object ) {
object.traverse( function ( child ) {
if ( child instanceof THREE.Mesh ) {
child.material.side = THREE.DoubleSide;
child.material.map = texture;
}
} );
object.position.y = - 95;
scene.add( object );
}, onProgress, onError );
I am unsure about how to incorporate the shininess and specular settings into my current setup because I am not utilizing a THREE.MeshPhongMaterial
. If I were to switch to THREE.MeshPhongMaterial
, I'm uncertain how to integrate it with THREE.texture
.