question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exposing objects ( THREE.WebGLObjects ) for faster target rendering

See original GitHub issue

I was looking into a faster way to render fbos into rendertarget using the renderBufferDirect threejs method. Got it working

this.renderer.setRenderTarget( prop.output );
this.renderer.objects.update( prop.mesh );
this.renderer.renderBufferDirect( this.camera, null, prop.mesh.geometry, prop.mesh.material, prop.mesh, null );

But it needs this object : https://github.com/mrdoob/three.js/blob/dev/src/renderers/WebGLRenderer.js#L286

to be exposed as a property of the renderer in order to update buffer attributes.

It could help to render objects and fbos immediately without using the whole render function. And also help to speed up post-processing effects method !

Is it worth exposing it ?

Three.js version
  • Dev
  • r81
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • Linux
  • Android
  • IOS
Hardware Requirements (graphics card, VR Device, …)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:14
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
mrdoobcommented, Nov 23, 2016

I wouldn’t expose it directly… Maybe build an API on top of it? renderer.getInternalProperty( value )?

2reactions
Mugen87commented, Apr 29, 2020

@mrdoob I do not recommend to open up the renderer in the suggested way. The more internals are exposed (even via methods), the harder will it be to refactor and optimize the renderer in the future since users will rely on certain assumptions.

I think it’s better when above uses cases are realized when projects fork and modify the renderer according to their use cases.

Read more comments on GitHub >

github_iconTop Results From Across the Web

third_party/blink/renderer/modules/webgl ... - Google Git
#include "third_party/blink/renderer/bindings/modules/v8/webgl_any.h" ... bool WebGLRenderingContextBase::DeleteObject(WebGLObject* object) {.
Read more >
WebGL Specification - Khronos Registry
This specification describes an additional rendering context and support objects for the HTML 5 canvas element [CANVAS].
Read more >
Three.js Render Targets
A render target in three.js is basicaly a texture you can render to. After you render to it you can use that texture...
Read more >
WebGL Workshop :: @Xavier_Ho - GitHub Pages
THREE.WebGLRenderer creates a rendering context for us to add ... [Exposed=(Window,Worker)] interface WebGLSampler : WebGLObject { }; ...
Read more >
WebGL - Real-Time Rendering
The visual capture handles all the possible renderable outputs such as cube textures, 3D textures, draw buffers, render target texture, render buffers and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found