Fixes related to #33087:

* Fix GLSL memory leak in the (vector) math node.
* Fix GLSL math node pow behavior for negative values, same as was done for C.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@51948 954f8c5b-7b00-dc11-b283-0030488c597c
Cycles: disable OpenCL in builds for now, since it's not working and is only
confusing users at this point. For experiments you can define the
CYCLES_OPENCL_TEST environment variable to make it show up in the UI.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@51949 954f8c5b-7b00-dc11-b283-0030488c597c
Cycles: 4 new nodes.

* Tangent: generate a tangent direction for anisotropic shading. Can be either
  radial around X/Y/Z axis, or from a UV map. The default tangent for the
  anisotropic BSDF and geometry node is now always radial Z, for UV tangent use
  this node now.

http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Tangent

* Normal Map: generate a perturbed normal from an RGB normal map image. This
  is usually chained with an Image Texture node in the color input, to specify
  the normal map image. For tangent space normal maps, the UV coordinates for
  the image must match, and the image texture should be set to Non-Color mode
  to give correct results.

http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Normal_Map

* Refraction BSDF: for best results this node should be considered as a building
  block and not be used on its own, but rather mixed with a glossy node using a
  fresnel type factor. Otherwise it will give quite dark results at the edges for
  glossy refraction.

http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#Refraction

* Ambient Occlusion: controls the amount of AO a surface receives, rather than
  having just a global factor in the world. Note that this outputs a shader and
  not a color, that's for another time.

http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#Ambient_Occlusion

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@51950 954f8c5b-7b00-dc11-b283-0030488c597c
Cycles OSL: phong_ramp(N, exponent, colors[8]) closure added, which works like
a specular ramp shader. Note this is OSL only still, for experimenting.

Patch by Thomas.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@51951 954f8c5b-7b00-dc11-b283-0030488c597c
Cycles OSL: support for the trace(point pos, vector dir, ...) function, to trace
rays from the OSL shader. The "shade" parameter is not supported currently, but
attributes can be retrieved from the object that was hit using the
getmessage("trace", ..) function.

As mentioned in the OSL specification, this function can't be used instead of
lighting, the main purpose is to allow shaders to "probe" nearby geometry, for
example to apply a projected texture that can be blocked by geometry, apply
more “wear” to exposed geometry, or make other ambient occlusion-like effects.

http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/OSL#Trace

Example .blend and render:
http://www.pasteall.org/blend/17347
http://www.pasteall.org/pic/show.php?id=40066

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@51952 954f8c5b-7b00-dc11-b283-0030488c597c