satellite-game / Satellite

A multiplayer WebGL space warfare game centered around moon bases and space stations
http://satellite.io
BSD 2-Clause "Simplified" License
72 stars 15 forks source link

Visuals: Normal mapping & dynamic lighting #104

Open lazd opened 10 years ago

lazd commented 10 years ago

Add dynamic lighting to the models.

varglbargl commented 10 years ago

The ships come packaged with bump mapping materials but I can't figure out how to make physijs.createMaterial use phong materials which is required for bump mapping. Invested way too much time in this and moving on.

lazd commented 10 years ago

@ehannum, sounds good. You can usually find @chandlerprall on IRC, I'm sure he could provide some quick insight on issues like this.

chandlerprall commented 10 years ago

@ehannum I just tried using Phong material instead of Lambert in the Jenga example and it worked fine:

table_material = Physijs.createMaterial(
            new THREE.MeshPhongMaterial({ map: THREE.ImageUtils.loadTexture( 'images/wood.jpg' ), ambient: 0xFFFFFF }),
            .9, // high friction
            .2 // low restitution
        );