seungho
January 21, 2022, 11:21am
1
error sample link
nomal sample link
When you run the error sample, there is a start button. The render is broken when the button is pressed.
However, if you run the normal sample and press the button, the render does not break.
The difference between the two is that one removes and creates the canvas, but
One refers to the created canvas.
What is the cause?
yaustar
January 21, 2022, 12:01pm
2
Itâs a bit dangerous for us to download unknown zips.
Could you post the code please on the forum, github or post a link to a PlayCanvas project?
What is the error? Are there any error messages in the browser dev console?
seungho
January 24, 2022, 12:24am
3
sorry. I misunderstood how to share a project.
I have attached a github link in the reply.
It is not the direct cause of the error, but the corresponding waring is coming out.
âWebGL: INVALID_OPERATION: bindTexture: object does not belong to this contextâ
thank you.
yaustar
January 24, 2022, 10:49am
4
Yeah, that makes sense. The engine has a reference to the canvas that it is rendering to and creates a WebGL context to it.
Recreating the canvas is likely to cause that error. At the moment, the engine does not support changing canvases after the engine has been created.
seungho
January 25, 2022, 12:22am
5
So how can we design the structure when the canvas needs to change? Do you have any best case examples?
yaustar
January 25, 2022, 12:29am
6
Afraid itâs not possible without destroying the PlayCanvas application and creating a new one with the new canvas.
What is the use case for having to change canvas?
Reuse canvas when using canvas as a popup.
I am creating after app.destroy without page refresh. If you do not reuse the canvas when creating, an error is coming out.
yaustar
January 25, 2022, 11:57am
8
Can you not hide it and re-add to the dom instead?
yaustar
January 25, 2022, 12:00pm
9
Iâm a bit confused on what your application is doing?
It looks like you are trying to destroy the entire app and recreate it again?
seungho
January 26, 2022, 12:36am
10
Yes I want to destroy the entire app and recreate it again.
Hiding is also a way, but I donât think itâs a fundamental solution.
I destroyed the app and started it again. The expected behavior at this time is normal behavior.
Please compare the index file code in the example. The part where the error occurs is the part I want to do.
yaustar
January 26, 2022, 10:57am
11
Iâm a little backed up on work here so wonât be able to look at until next week I think. Iâve created an internal ticket for this.
1 Like
seungho
January 27, 2022, 1:23am
12
Thanks for making the ticket internally. Can you raise the ticket priority? Path is required for this production.
There is a way we have solved it ourselves, please check whether the action is the right way.
I sent a pull request to github. thank you.
playcanvas:dev
â tizkzks96:tizkzks96-patch-1
opened 01:18AM - 27 Jan 22 UTC
Continued from the forum thread below.
There is a phenomenon that the render ⌠is broken when the app is destroyed and created without refreshing the page.
To solve this, we added a part to initialize samplesTexCache .
I haven't checked if there are any side effects, so please check and merge them or make additional corrections.
thank you.
Fixes #
I confirm I have read the [contributing guidelines](https://github.com/playcanvas/engine/blob/master/.github/CONTRIBUTING.md) and signed the [Contributor License Agreement](https://docs.google.com/a/playcanvas.com/forms/d/1Ih69zQfJG-QDLIEpHr6CsaAs6fPORNOVnMv5nuo0cjk/viewform).
yaustar
January 27, 2022, 9:31am
13
Unfortunately not, itâs currently me that triaging and going through the issues as fast as I can.
Now that youâve narrowed down the issue, I think someone on the engine team will take a look too
yaustar
January 27, 2022, 10:43am
14
We think this specific issue doesnât occur on engine 1.50.X. Would you be able to downgrade to the previous for the short term until the team fixes this properly?
1 Like
seungho
January 28, 2022, 12:21am
15
Okay. Please let me know when itâs resolved, thanks!