|
@@ -25,8 +25,10 @@ import {
|
|
|
import { Color } from '../math/Color.js';
|
|
|
import { Frustum } from '../math/Frustum.js';
|
|
|
import { Matrix4 } from '../math/Matrix4.js';
|
|
|
+import { Vector2 } from '../math/Vector2.js';
|
|
|
import { Vector3 } from '../math/Vector3.js';
|
|
|
import { Vector4 } from '../math/Vector4.js';
|
|
|
+import { floorPowerOfTwo } from '../math/MathUtils.js';
|
|
|
import { WebGLAnimation } from './webgl/WebGLAnimation.js';
|
|
|
import { WebGLAttributes } from './webgl/WebGLAttributes.js';
|
|
|
import { WebGLBackground } from './webgl/WebGLBackground.js';
|
|
@@ -208,6 +210,7 @@ class WebGLRenderer {
|
|
|
|
|
|
const _projScreenMatrix = new Matrix4();
|
|
|
|
|
|
+ const _vector2 = new Vector2();
|
|
|
const _vector3 = new Vector3();
|
|
|
|
|
|
const _emptyScene = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: true };
|
|
@@ -1334,11 +1337,11 @@ class WebGLRenderer {
|
|
|
|
|
|
function renderTransmissionPass( opaqueObjects, transmissiveObjects, scene, camera ) {
|
|
|
|
|
|
- if ( _transmissionRenderTarget === null ) {
|
|
|
+ const isWebGL2 = capabilities.isWebGL2;
|
|
|
|
|
|
- const isWebGL2 = capabilities.isWebGL2;
|
|
|
+ if ( _transmissionRenderTarget === null ) {
|
|
|
|
|
|
- _transmissionRenderTarget = new WebGLRenderTarget( 1024 * _pixelRatio, 1024 * _pixelRatio, {
|
|
|
+ _transmissionRenderTarget = new WebGLRenderTarget( 1, 1, {
|
|
|
generateMipmaps: true,
|
|
|
type: extensions.has( 'EXT_color_buffer_half_float' ) ? HalfFloatType : UnsignedByteType,
|
|
|
minFilter: LinearMipmapLinearFilter,
|
|
@@ -1357,6 +1360,18 @@ class WebGLRenderer {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ _this.getDrawingBufferSize( _vector2 );
|
|
|
+
|
|
|
+ if ( isWebGL2 ) {
|
|
|
+
|
|
|
+ _transmissionRenderTarget.setSize( _vector2.x, _vector2.y );
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ _transmissionRenderTarget.setSize( floorPowerOfTwo( _vector2.x ), floorPowerOfTwo( _vector2.y ) );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
//
|
|
|
|
|
|
const currentRenderTarget = _this.getRenderTarget();
|