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.

Renderer state.reset() no longer resets attributes

See original GitHub issue

We perform some WebGL computation using the raw WebGL context (i.e. inside our animation frame callback but before our calls to Three to render the scene etc. We need to use the same context since we use some of the output from that work in three (e.g. some textures). In order to ensure that GL state is in a relatively predictable state before and after our raw context use, we call renderer.state.reset().

This was working great before r118, but it looks like that revision moved the management of attributes out of WebGLState and into WebGLBindingStates, and this means our call to renderer.state.reset() no longer disables the enabled attributes.

We were wondering if there was a way to clear these attributes with the new structure or, failing that, if you’d be open to us taking a look at how to introduce it with a PR?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
takahiroxcommented, Oct 23, 2020

Unfortunately we need to be careful to add this type of API as written in the above. So I’d like to suggest making your fork for now and revisiting in the core if we get the same feature request more.

2reactions
takahiroxcommented, Oct 23, 2020

I agree with @Mugen87. The Renderer inside (WebGL resource management) is complex. Exposing an API which affects internal WebGL resources can make it harder to maintain. Once we expose an API, we should keep the API unchanged as much as possible, then I think there my be a chance that exposing such an API can block the change (optimization) of the renderer inside.

But, on the other hand, I know we sometimes have requests from users that they want to finely control WebGL resources by themselves. So I think it might be acceptable if the change is very simple and easy, and many users want this feature.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I reset a react component including all transitively ...
This won't work if the current state includes any properties that are not in the initial state. While I don't believe that is...
Read more >
Forcing state reset on a React component by using the key prop
Forcing state reset on a React component by using the key prop ... Whenever the user clicks on a ChatList item, the App...
Read more >
CanvasRenderingContext2D.reset() - Web APIs | MDN
The CanvasRenderingContext2D.reset() method of the Canvas 2D API resets the rendering context to its default state, allowing it to be reused ...
Read more >
You Might Not Need an Effect - React Docs
You don't need Effects to transform data for rendering. ... If your Effect also immediately updates the state, this restarts the whole process...
Read more >
WebGLRenderer#state – three.js docs
parameters - (optional) object with properties defining the renderer's behaviour. ... autoReset = false; Call reset() whenever you have finished to render a ......
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