I'm trying to make my 3d models appear a little 'nicer' - by which I mean less jagged looking edges, more realistic looking shadows etc.
at the moment I'm testing with an OBJ file. My code for loading and displaying the file is as follows:
function LoadOBJMTL(file) {
var objObject = new THREE.Object3D;
var loader = new THREE.OBJMTLLoader();
var objfile = file + ".obj";
var mtlfile = file + ".mtl";
loader.load(objfile, mtlfile, function(object) {
objObject = object;
scene.add(objObject);
});
}
Nothing special there...
and my code for illuminating the scene is just 5 directional lights as follows:
addDirectionLight([-1, 0, 0], 1);
addDirectionLight([1, 0, 0], 1);
addDirectionLight([0, 0, -1], 1);
addDirectionLight([0, 0, 1], 1);
addDirectionLight([0, 1, 0], 1);
function addDirectionLight(direction, intensity) {
var directionalLight = new THREE.DirectionalLight(0xffffff, intensity);
directionalLight.position.set(direction[0], direction[1], direction[2]);
scene.add(directionalLight);
}
And this is what my results look like:
As a comparison, I have uploaded the same model to verold and sketchfab
Not sure about sketchfab, but I know that verold is written with three.js
Verold trial:
Sketchfab trial:
I'm happy with the apperance in both the verold and sketchfab examples. What techniques should I use to improve the look of my threejs model? I'm after straighter looking lines, and better lighting conditions.
thanks in advance