Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/core/Clock.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Clock {
*/
this.running = false;

warn( 'THREE.Clock: This module has been deprecated. Please use THREE.Timer instead.' ); // @deprecated, r183
warn( 'Clock: This module has been deprecated. Please use THREE.Timer instead.' ); // @deprecated, r183

}

Expand Down
4 changes: 3 additions & 1 deletion src/renderers/common/RenderBundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ class RenderBundle {
*
* @param {BundleGroup} bundleGroup - The bundle group.
* @param {Camera} camera - The camera the bundle group is rendered with.
* @param {RenderContext} renderContext - The render context the bundle is rendered with.
*/
constructor( bundleGroup, camera ) {
constructor( bundleGroup, camera, renderContext ) {

this.bundleGroup = bundleGroup;
this.camera = camera;
this.renderContext = renderContext;

}

Expand Down
7 changes: 5 additions & 2 deletions src/renderers/common/RenderBundles.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,29 @@ class RenderBundles {
*
* @param {BundleGroup} bundleGroup - The bundle group.
* @param {Camera} camera - The camera the bundle group is rendered with.
* @param {RenderContext} renderContext - The render context the bundle is rendered with.
* @return {RenderBundle} The render bundle.
*/
get( bundleGroup, camera ) {
get( bundleGroup, camera, renderContext ) {

const bundles = this.bundles;

_chainKeys[ 0 ] = bundleGroup;
_chainKeys[ 1 ] = camera;
_chainKeys[ 2 ] = renderContext;

let bundle = bundles.get( _chainKeys );

if ( bundle === undefined ) {

bundle = new RenderBundle( bundleGroup, camera );
bundle = new RenderBundle( bundleGroup, camera, renderContext );
bundles.set( _chainKeys, bundle );

}

_chainKeys[ 0 ] = null;
_chainKeys[ 1 ] = null;
_chainKeys[ 2 ] = null;

return bundle;

Expand Down
10 changes: 2 additions & 8 deletions src/renderers/common/Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1213,17 +1213,11 @@ class Renderer {

//

const renderBundle = this._bundles.get( bundleGroup, camera );
const renderBundle = this._bundles.get( bundleGroup, camera, renderContext );
const renderBundleData = this.backend.get( renderBundle );

if ( renderBundleData.renderContexts === undefined ) renderBundleData.renderContexts = new Set();

//

const needsUpdate = bundleGroup.version !== renderBundleData.version;
const renderBundleNeedsUpdate = renderBundleData.renderContexts.has( renderContext ) === false || needsUpdate;

renderBundleData.renderContexts.add( renderContext );
const renderBundleNeedsUpdate = needsUpdate || renderBundleData.bundleGPU === undefined;

if ( renderBundleNeedsUpdate ) {

Expand Down
Loading