|
@@ -45,12 +45,12 @@ var PMREMGenerator = ( function () {
|
|
var SIZE_MAX = Math.pow( 2, LOD_MAX );
|
|
var SIZE_MAX = Math.pow( 2, LOD_MAX );
|
|
// The standard deviations (radians) associated with the extra mips. These are
|
|
// The standard deviations (radians) associated with the extra mips. These are
|
|
// chosen to approximate a Trowbridge-Reitz distribution function times the
|
|
// chosen to approximate a Trowbridge-Reitz distribution function times the
|
|
- // geometric shadowing function.
|
|
|
|
|
|
+ // geometric shadowing function. These sigma values squared must match the
|
|
|
|
+ // variance #defines in cube_uv_reflection_fragment.glsl.js.
|
|
var EXTRA_LOD_SIGMA = [ 0.125, 0.215, 0.35, 0.446, 0.526, 0.582 ];
|
|
var EXTRA_LOD_SIGMA = [ 0.125, 0.215, 0.35, 0.446, 0.526, 0.582 ];
|
|
var TOTAL_LODS = LOD_MAX - LOD_MIN + 1 + EXTRA_LOD_SIGMA.length;
|
|
var TOTAL_LODS = LOD_MAX - LOD_MIN + 1 + EXTRA_LOD_SIGMA.length;
|
|
- // The maximum length of the blur for loop, chosen to equal the number needed
|
|
|
|
- // for GENERATED_SIGMA. Smaller _sigmas will use fewer samples and exit early,
|
|
|
|
- // but not recompile the shader.
|
|
|
|
|
|
+ // The maximum length of the blur for loop. Smaller sigmas will use fewer
|
|
|
|
+ // samples and exit early, but not recompile the shader.
|
|
var MAX_SAMPLES = 20;
|
|
var MAX_SAMPLES = 20;
|
|
var ENCODINGS = {
|
|
var ENCODINGS = {
|
|
[ LinearEncoding ]: 0,
|
|
[ LinearEncoding ]: 0,
|
|
@@ -198,10 +198,10 @@ var PMREMGenerator = ( function () {
|
|
|
|
|
|
}
|
|
}
|
|
var planes = new BufferGeometry();
|
|
var planes = new BufferGeometry();
|
|
- planes.addAttribute(
|
|
|
|
|
|
+ planes.setAttribute(
|
|
'position', new BufferAttribute( position, positionSize ) );
|
|
'position', new BufferAttribute( position, positionSize ) );
|
|
- planes.addAttribute( 'uv', new BufferAttribute( uv, uvSize ) );
|
|
|
|
- planes.addAttribute(
|
|
|
|
|
|
+ planes.setAttribute( 'uv', new BufferAttribute( uv, uvSize ) );
|
|
|
|
+ planes.setAttribute(
|
|
'faceIndex', new BufferAttribute( faceIndex, faceIndexSize ) );
|
|
'faceIndex', new BufferAttribute( faceIndex, faceIndexSize ) );
|
|
_lodPlanes.push( planes );
|
|
_lodPlanes.push( planes );
|
|
|
|
|
|
@@ -239,7 +239,7 @@ var PMREMGenerator = ( function () {
|
|
|
|
|
|
_pingPongRenderTarget.dispose();
|
|
_pingPongRenderTarget.dispose();
|
|
_renderer.setRenderTarget( null );
|
|
_renderer.setRenderTarget( null );
|
|
- var size = _renderer.getSize();
|
|
|
|
|
|
+ var size = _renderer.getSize( new Vector2() );
|
|
_renderer.setViewport( 0, 0, size.x, size.y );
|
|
_renderer.setViewport( 0, 0, size.x, size.y );
|
|
|
|
|
|
}
|
|
}
|