title: Three.js Texture in shaderMaterial
body: <p>I could not load texture to my shader material, only what I see are just black dot. This is my shader.js</p>
  
  <pre><code>THREE.ShaderLib['cloud'] = {
  
      uniforms: {
          texture: { type: "t", value: THREE.ImageUtils.loadTexture("img/cloud.png") }
      },
  
      vertexShader: [
          "varying vec2 vUv;",
          "void main() {",
              "vUv = uv;",
              "gl_PointSize = 8.0;",
              "gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);",
          "}",
      ].join("\n"),
  
      fragmentShader: [
              "varying vec2 vUv;",
              "uniform sampler2D texture;",
              "void main() {",
                  "gl_FragColor = texture2D(texture, vUv);",
              "}",
      ].join("\n")
  };
  </code></pre>
  
  <p>and this is how I'm trying to load and use it:</p>
  
  <pre><code>var cloudShader = THREE.ShaderLib["cloud"];
  var uniforms = THREE.UniformsUtils.clone(cloudShader.uniforms);
  
  var texture = THREE.ImageUtils.loadTexture("img/cloud.png", undefined, function () {
  
     uniforms.texture.value = texture;
     texture.needsUpdate = true;
  
     var _material = new THREE.ShaderMaterial({
        fragmentShader: cloudShader.fragmentShader,
        vertexShader: cloudShader.vertexShader,
        uniforms: uniforms                   
     });                    
     _material.uniforms.texture.value.needsUpdate = true;
     var _geometry = new THREE.Geometry();
     _geometry.vertices.push(new THREE.Vector3(0, 0, 0));
     var _mesh = new THREE.Points(_geometry, _material);
     scene.add(_mesh);
  
   });
  </code></pre>
  
  <p>As You can see I'm trying to set update texture value two times, before and after material is created. It's really simpy example but I have no idea why it is not working in the way that I'm using it. There is no errors in debug console. </p>
  
  <p>I'm using THREE.Points class, because I'm using it to generate clouds as a particle groups.</p>
  
  <p>Thanks in advance for any help.</p>