Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transition rendertarget use same size of renderer #150

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
import { platform } from '../platform.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 { WebGLAnimation } from './webgl/WebGLAnimation.js';
Expand Down Expand Up @@ -170,6 +171,7 @@ function WebGLRenderer( parameters = {} ) {
const _projScreenMatrix = new Matrix4();

const _vector3 = new Vector3();
const _vector2 = new Vector2();

const _emptyScene = { background: null, fog: null, environment: null, overrideMaterial: null, layers: { test: () => false }, children: [], isScene: true, onBeforeRender: function () {}, onAfterRender: function () {} };

Expand Down Expand Up @@ -1254,7 +1256,7 @@ function WebGLRenderer( parameters = {} ) {
const needsAntialias = _antialias === true && capabilities.isWebGL2 === true;
const hasColorBufferHalfFloat = extensions.has( 'EXT_color_buffer_half_float' ) || ( capabilities.isWebGL2 && extensions.has( 'EXT_color_buffer_float' ) );

_transmissionRenderTarget = new WebGLRenderTarget( 1024, 1024, {
_transmissionRenderTarget = new WebGLRenderTarget( 1, 1, {
generateMipmaps: true,
type: hasColorBufferHalfFloat ? HalfFloatType : UnsignedByteType,
minFilter: LinearMipmapLinearFilter,
Expand All @@ -1263,6 +1265,9 @@ function WebGLRenderer( parameters = {} ) {

}

_this.getDrawingBufferSize( _vector2 );
_transmissionRenderTarget.setSize( _vector2.x, _vector2.y );

const currentRenderTarget = _this.getRenderTarget();
_this.setRenderTarget( _transmissionRenderTarget );
_this.clear();
Expand Down
Loading