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

WebGPURenderer: .render() support object3d as parameter #26400

Merged
merged 1 commit into from
Jul 12, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/jsm/renderers/common/Background.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Background extends DataMap {
update( scene, renderList, renderContext ) {

const renderer = this.renderer;
const background = ( scene.isScene === true ) ? this.nodes.getBackgroundNode( scene ) || scene.background : null;
const background = this.nodes.getBackgroundNode( scene ) || scene.background;

let forceClear = false;

Expand Down
13 changes: 8 additions & 5 deletions examples/jsm/renderers/common/Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import RenderContexts from './RenderContexts.js';
import Textures from './Textures.js';
import Background from './Background.js';
import Nodes from './nodes/Nodes.js';
import { Frustum, Matrix4, Vector2, Vector3, Vector4, Color, DoubleSide, BackSide, FrontSide, SRGBColorSpace, NoToneMapping } from 'three';
import { Scene, Frustum, Matrix4, Vector2, Vector3, Vector4, Color, DoubleSide, BackSide, FrontSide, SRGBColorSpace, NoToneMapping } from 'three';

const _scene = new Scene();
const _drawingBufferSize = new Vector2();
const _screen = new Vector4();
const _frustum = new Frustum();
Expand Down Expand Up @@ -181,6 +182,8 @@ class Renderer {

//

const sceneRef = ( scene.isScene === true ) ? scene : _scene;

const renderTarget = this._renderTarget;
const renderContext = this._renderContexts.get( scene, camera, renderTarget );
const activeCubeFace = this._activeCubeFace;
Expand Down Expand Up @@ -285,11 +288,11 @@ class Renderer {

//

this._nodes.updateScene( scene );
this._nodes.updateScene( sceneRef );

//

this._background.update( scene, renderList, renderContext );
this._background.update( sceneRef, renderList, renderContext );

//

Expand All @@ -301,8 +304,8 @@ class Renderer {
const transparentObjects = renderList.transparent;
const lightsNode = renderList.lightsNode;

if ( opaqueObjects.length > 0 ) this._renderObjects( opaqueObjects, camera, scene, lightsNode );
if ( transparentObjects.length > 0 ) this._renderObjects( transparentObjects, camera, scene, lightsNode );
if ( opaqueObjects.length > 0 ) this._renderObjects( opaqueObjects, camera, sceneRef, lightsNode );
if ( transparentObjects.length > 0 ) this._renderObjects( transparentObjects, camera, sceneRef, lightsNode );

// finish render pass

Expand Down