Skip to content

Instantly share code, notes, and snippets.

@LukeDavitt
Last active Jun 17, 2016
Embed
What would you like to do?
this.textureLoader = new Three.TextureLoader();
this.textureLoader.load(image, function (texture) {
texture.minFilter = THREE.LinearFilter
self.mesh = new Three.Mesh(self.geometry, self.material);
var vertShader = document.getElementById('vertexShader').innerHTML;
var fragShader = document.getElementById('fragmentShader').innerHTML;
uniforms = {
texture1: { type: "t", value: texture },
sunVectorDelta: { type: "f", value: 0},
sunFragmentDelta: {type: "f", value: -0.7}
};
self.shaderMaterial = new THREE.ShaderMaterial({
uniforms: uniforms,
vertexShader: vertShader,
fragmentShader: fragShader,
shading: THREE.SmoothShading,
side: THREE.DoubleSide,
transparent:true
});
self.mesh.material = self.shaderMaterial;
self.mesh.material.needsUpdate = true;
self.orbit = new Three.Object3D();
self.orbit.add(self.mesh);
objects.push(self.orbit);
scene.add(self.orbit);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment