 
 default_fragment_source =
 """
+//uniform vec3 light;
+//varying vec3 vNormal;
+
 void main() {
-  gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+//  vec3 light_norm = normalize(light);
+//  float dProd = max(0.0, dot(vNormal, light));
+//  gl_FragColor = vec4(dProd, 0.0, 0.0, 1.0);
+  gl_FragColor = vec4(0.5, 0.5, 0.5, 1.0);
 }
 
 """


  update_shader: (shader_parameters) ->
    if @_validate_shader_parameters(shader_parameters)
      new_material = new THREE.ShaderMaterial(shader_parameters)
      @mesh.material = new_material
      @shader_material = new_material

    return success

  _create_basic_scene: () ->
    # Cameras!
    @camera.position.z = 2

    # Light!
    @_directional_light = new THREE.DirectionalLight( 0xffffff, 0.75 )
    @_directional_light.position.set(1,1,2)
    @scene.add( @_directional_light )
    @_directional_light.visible = @light

    @_uniforms =
      light =
        type: 'v3'
        value: THREE.Vector3(1,1,2)

    # Models!
    shader_parameters =
      uniforms: @_uniforms
      vertexShader: default_vertex_source
      fragmentShader: default_fragment_source
    @shader_material = new THREE.ShaderMaterial(shader_parameters)
    # @shader_material = new THREE.MeshPhongMaterial()

    @geometry = new THREE.CubeGeometry(1,1,1)
    @geometry.computeFaceNormals()
    @geometry.computeVertexNormals()

    @mesh = new THREE.Mesh( @geometry, @shader_material )
    @scene.add( @mesh )
