svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r26172:26191
Render Branch

Some refactoring of blender rendering code, various code changes to clean
up the code and make it easier to extend and fit in the new shading system.
This also deprecates a number of features, so breaks backwards compatibility
already. No new shading system or new features in this commit.

Also, don't report bugs or problems for this branch yet.

Deprecated features:
* World exposure/range.
* Backbuf image.
* Specular transparency.
* Energy Ramps.
* Jittered sampling for AO and Area lamps.
* Warping and stencils in the texture stack.
* Sticky texture coordinates. 

Code changes:
* Many file and function renames, splitting, keeping the working of the
  code intact but making the existing structure more clear.
* Render global R replaced by local variables.
* Shading and pass combining for solid and z-transp is now unified. 
* Render and ShadeInput structs have been split up into nested structs.
* Threaded render no longer uses sleep().
* Lamp shading loop has been reorganized. This will make some renders
  look different, some due to bugs being fixed, and some due to new bugs.
* Texture nodes are now a texture type rather using the "use nodes"
  button.

More details on second part of this page:
http://wiki.blender.org/index.php/BlenderDev/ShadingSystem/Notes
Render branch: fix halo rendering bug in hairball.blend.
Render branch: use lamp_sample in ray_shadow_qmc.
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r26191:26366
Render Branch: fixes for crashes in bake and occlusion caching.
Render Branch: fix for sampler.c, hemisphere sampling code was wrong,
also added back cosine weighted hemisphere.
Render Branch: make the raycounter code work again, broke it in refactoring.
Render Branch: temporary workaround for extern texture access, previously this
was using the global R, with whatever contents it had from last render. For now
just introduce a static local R for this case.
Render Branch: trying to get units figured out for materials and lamps,
see comments in material.h and lamp.h. Change in UI is that lamp energy
is now called power and is specified in Watts. It's still off by a large
factor due to the lamp falloff code, that will be fixed in a separate
commit.
Render Branch: different method to compute only shadow lamps, rather
than subtracting colors it now subtracts in grayscale, helps avoid
ugly discolorations when used with colored lamps.
Render Branch: fix memory leak when cancelling preview render.
Render Branch: lamp falloff

* Change lamp falloff formula which was dist/(r^2 + dist) with dist
   a user specified value, whereas the correct value is 1/(r^2). Now
   it is 1/(r^2 + dist) with dist = 0 as the default.
* Deprecated the Lin/Quad weighted mode.
* Still more work needed to make sun/area/hemi work better with this,
  results are too bright now.
* Also this gives quite harsh results when the lamp is near geometry,
  perhaps because we are not using tonemapping by default.
Render Branch: stupid path tracer I'm using for consistency testing,
only does environment lighting + diffuse at the moment, don't expect
this to make it into trunk.
Render Branch: some lowres geometry raytracing test code, just a test
that is far from usable but might as well commit it.
Render Branch: move pixel & surface cache code to own file for reuse,
not really generic yet but getting there.
Render Branch:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r26366:26768
Render Branch: copy 2nd order spherical harmonics code from render to math lib.
Render Branch: WIP commit

* Pixel cache now works for raytraced AO/env/indirect.
* Falloff distance value is now only used for custom curve, linear and
  quadratic now have a smooth factor (range 0-1).
* Lamp multisampling code moved from shadow to shading, so that both
  shading and shadow can be multisampled. This should give correct area
  lights at the cost of noise.
* Halo now uses same lamp code as surface instead of duplicating it.
* Fix in volume code, was too bright now with lamp changes.
* Only shadow materials are now computed different, sharing more code
  but not matching old behavior yet.
Render Branch: disable ray trace epsilon for testing, not using it
gives artifacts with overlapping faces, but it also seems to lead
to self intersections.