-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
WebGPURenderer: Improve RenderObject grouping - WIP
#32243
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
base: dev
Are you sure you want to change the base?
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
|
|
||
| import * as THREE from 'three/webgpu'; | ||
| import { OrbitControls } from 'three/addons/controls/OrbitControls.js'; | ||
| import { texture, uv, userData, fog, rangeFogFactor, color, context } from 'three/tsl'; |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
| } );*/ | ||
| document.body.appendChild( renderer.domElement ); | ||
|
|
||
| const controls = new OrbitControls( camera, renderer.domElement ); |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
| for ( let i = 0, l = group.children.length; i < l; i ++ ) { | ||
|
|
||
| const sprite = group.children[ i ]; | ||
| const scale = Math.sin( time + sprite.position.x * 0.01 ) * 0.3 + 1.0; |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
|
|
||
| import * as THREE from 'three/webgpu'; | ||
| import { OrbitControls } from 'three/addons/controls/OrbitControls.js'; | ||
| import { texture, uv, userData, fog, rangeFogFactor, color, context } from 'three/tsl'; |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
| } );*/ | ||
| document.body.appendChild( renderer.domElement ); | ||
|
|
||
| const controls = new OrbitControls( camera, renderer.domElement ); |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
| for ( let i = 0, l = group.children.length; i < l; i ++ ) { | ||
|
|
||
| const sprite = group.children[ i ]; | ||
| const scale = Math.sin( time + sprite.position.x * 0.01 ) * 0.3 + 1.0; |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
| import { cameraViewMatrix } from './Camera.js'; | ||
| import { Matrix3 } from '../../math/Matrix3.js'; | ||
| import { objectIndex } from '../core/IndexNode.js'; | ||
| import { instancedDynamicBufferAttribute } from '../accessors/BufferAttributeNode.js'; |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note


Related issue: #30560 (comment), #30560 (comment), #26673 (comment)
Description
This is a WIP.
The basic idea is to group the
RenderObjectso that we can handle similar objects.Today we have a lot of redundant calls between similar objects in the rendering call that could be resolved in just one
Backend.draw().Improve
RenderObjectgroupingobject.morphTargetInfluencesandobject.countforfilterObjects,RenderObjects.getandRenderObject.getChainArray().RenderObject.instancesand leave onlyRenderObject.objectsCreate shared buffer
bufferclass designed to couple multiple uniforms.modelWorldMatrix.objectIndexmediumpModelWorldMatrixbuffernode is not being shared properly when shared with other materials, causing the buffer to be updated more than once in the same render call. WebGPURenderer: Improve cache bindings from node uniforms #32244bufferdoes not have an integratedupdateRangesrange, which can be a problem if used in conjunction withinstancessinceInstanceNodedoes not distinguish it with an attribute. WebGPURenderer: Add update ranges for bindings #32248three.js/src/nodes/accessors/InstanceNode.js
Lines 120 to 126 in 8173be8