Skip to content

Conversation

@Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Feb 15, 2021

Related issue: see #20732 (comment)

Description

The implementation of WebGLState.state() is currently problematic. It resets flags but at the same time it does not reset the WebGL API to its original state.

The idea of this PR is to keep both in sync. If the flags are reset to their original values, same is done for the WebGL API now.

@jscastro76 @b1616 Can you please verify if this change would solve your issues?

@Mugen87 Mugen87 marked this pull request as draft February 15, 2021 10:54
@jscastro76
Copy link

Yes, in my case, it works. Shadows are back again even if context is shared with Mapbox.
image

Thanks @Mugen87! when this PR is aproved, if you want, you can answer the original question in SO and I'll accept it and vote it up.

@Mugen87 Mugen87 marked this pull request as ready for review February 15, 2021 15:33
@mrdoob mrdoob added this to the r126 milestone Feb 15, 2021
@mrdoob mrdoob merged commit 01e4aaa into mrdoob:dev Feb 15, 2021
@mrdoob
Copy link
Owner

mrdoob commented Feb 15, 2021

Thanks!

@daumann
Copy link

daumann commented Aug 29, 2021

With the latest version, it seems broken again.

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Aug 29, 2021

The fiddle from the original issue still works with r132: https://jsfiddle.net/k7tw4boy/1/

It would be broken if no shadows are rendered.

@webglzhang
Copy link
Contributor

webglzhang commented Nov 14, 2021

I'm sorry that I haven't paid attention to #20732 for a long time due to work reasons. Let me explain the problem I'm trying to solve.I use the potree to do something, potree use the gl command to render pointCloud and use three.js to render mesh and backgroud. In the change the renderer,potree use the webglstate.reset to ensure the states of different renderers are isolated,but i found webglstate.reset is not do reset webgl state completely. And in this pr is fixed completely.👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants