Expose 'attributes' and 'geometries' from WebGLRenderer
See original GitHub issueIf I add these two lines to WebGLRenderer.initGLContext
_this.attributes = attributes;
_this.geometries = geometries;
Then I can do this to grab the underlying WebGL vertex and index buffers for my BufferGeometry and populate them from external WebGL code.
var bufferGeometry = new THREE.BufferGeometry();
bufferGeometry.setIndex([]);
bufferGeometry.addAttribute( 'position', new THREE.Float32BufferAttribute([], 3));
bufferGeometry.addAttribute( 'normal', new THREE.Float32BufferAttribute([], 3));
bufferGeometry.addAttribute( 'uv', new THREE.Uint16BufferAttribute([], 2, true));
renderer.geometries.update(bufferGeometry);
var posBuf = renderer.attributes.get(bufferGeometry.attributes['position']).buffer;
var norBuf = renderer.attributes.get(bufferGeometry.attributes['normal']).buffer;
var uvBuf = renderer.attributes.get(bufferGeometry.attributes['uv']).buffer;
var indexBuf = renderer.attributes.get(bufferGeometry.index).buffer;
Is this a change you guys would consider taking? This is with the goal of getting volumetric video content playing inside of THREE.js scenes.
Thanks! Evan
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (1 by maintainers)
Top Results From Across the Web
WebGLRenderer – three.js docs
The WebGL renderer displays your beautifully crafted scenes using WebGL. ... parameters - (optional) object with properties defining the renderer's ...
Read more >3D Rendering Using Three.js | Built In
js internally uses a WebGL renderer by exposing a simple API. A Simple Example: Rotating a Cube. Let's start off by creating a...
Read more >Extending three.js materials with GLSL | by Dusan Bosnjak
Three.js materials all share a common base in order to be able to work with the entire rendering system. All of them share...
Read more >Introduction | three-elements
three-elements is a small library that provides a Web Components layer for declaratively building Three.js applications. If you're familiar with both Web ...
Read more >Team:Munich/Hardware/threeJS - iGEM 2018
var attribute = geometry.attributes.position;. if ( attribute !== undefined ) {. for ( i = 0, l = attribute.count; i < l; i...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Nice 👍 What’s the status of this feature overall, are there plans for #13196 to make it into a release anytime soon?
I just wanted to chip in and say this feature is exactly what I need 😃 We stream geometry in chunks and doing the roundtrip through
BufferGeometryreally is a pain. TheGLBufferAttributeof https://github.com/mrdoob/three.js/pull/13196 also looks pretty good, so that would be totally OK too.