Environment mapping

I've added two new types of environment mapping including equirectangular mapping (commonly used for image-based lighting and HDR environment maps) and sphere mapping.

When a material is built, the texture's mapping type leads affects the defines used in the shader for sampling the environment map. This means that material.needsUpdate must be set to true when an environment map is changed to one with a different mapping (ideally, this would be auto-detected somehow).

I've included a simple example but this may not be necessary as the feature is fairly self-explanatory. Besides that, the sphere mapping example doesn't really fit with the others since sphere-mapping is kind of a view-space cheat (i.e. the reflections are aligned with the view and not with the world). I can remove this example file if you think that's best.
Ah, I was wondering why they were functions. Well, either way could work. I
kind of like making the mapping type an integer so that you can do simple
checks on it. e.g. `if ( mapping == THREE.SphericalReflectionMapping) {}`
Something like refractionAmount could always be set as another parameter on
the material.

On 16 November 2014 20:58, Mr.doob <notifications@github.com> wrote:

> In src/Three.js:
>
> >
> > -THREE.SphericalReflectionMapping = function () {};
> > -THREE.SphericalRefractionMapping = function () {};
>
> The reason these were function was because I was planning to do something
> like this:
>
> new THREE.SpheicalRefractionMapping( refractionAmount );
>
> Thoughts?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mrdoob/three.js/pull/5622/files#r20415862>.
>