nunuStudio icon indicating copy to clipboard operation
nunuStudio copied to clipboard

Three.WebGLRenderer: Error creating WebGL context

Open Algorush opened this issue 4 years ago • 10 comments

Hello! I am trying to port the code for this example to NunuStudio. What should I consider when doing this, what are the features of Nunu? http://jsfiddle.net/t2w6bagq/ I ran into this error in the editor when I pressed the Run button. "Three.WebGLRenderer: Error creating WebGL context" Then when I press the Stop button. This is my first time trying to do something with NunuStudio. Below is the code I'm trying to run. What are my mistakes? Tell me please. https://github.com/Algorush/NunuStudioTest/blob/main/Projector.js

Algorush avatar Nov 07 '20 14:11 Algorush

Hello

You dont need most of that code, the renderer, cameras and scene is already created for you.

You can create the shader material in the GUI and only need to reuse the geometry code in a script.

Please read the documentation available on the project page.

Cheers

tentone avatar Nov 07 '20 21:11 tentone

Hello, thanks for help! I'll try to do as you say. But can I create camera manually with 'new' operator? In this script, if I understood correctly, a second camera is created that projects video onto the Mesh.

Algorush avatar Nov 08 '20 20:11 Algorush

You can use the new operation without any problem.

In this script, if I understood correctly, a second camera is created that projects video onto the Mesh.

I dont know about that it is your script!. You can create cameras from the GUI or from the script without any problem.

tentone avatar Nov 08 '20 21:11 tentone

It turned out that the problem only occurs when using the Chrome browser. For some reason nunu writes that WbGLRenderer is not supported. This error does not occur on Firefox.

Algorush avatar Nov 09 '20 15:11 Algorush

Do you have GPU acceleration available in chrome?

Check by accessing the chrome://gpu/ URL in the browser

tentone avatar Nov 10 '20 11:11 tentone

Yes, it seems like: Canvas: Hardware accelerated WebGL: Hardware accelerated WebGL2: Hardware accelerated

Algorush avatar Nov 10 '20 16:11 Algorush

Can you please post the actual error that you're getting from the console?

Thanks a lo

tentone avatar Nov 15 '20 13:11 tentone

I am getting the following errors and warnings in chrome:

THREE.WebGLRenderer: Error creating WebGL context
THREE.WebGLRenderer: Context Lost
THREE.WebGLRenderer: Context Restored

Maybe I do something wrong. But there is no such error in the firefox browser, only warnings with context lost. I am opening NunuStudio on a laptop with AMD Ryzen 5 2500U processor and integrated Radeon Vega graphics. Now also errors in both browsers with shaders:

THREE.WebGLProgram: shader error
...
Must have a compiled vertex shader attached.

But here, most likely, I did something wrong. Although the vertex shader is defined in the code

Algorush avatar Nov 16 '20 08:11 Algorush

There must have been some error while compiling the vertex shader.

I will have to take a closer look into your code, if possible provide a nsp file for your project.

tentone avatar Nov 23 '20 16:11 tentone

  1. Go to your chrome://settings/
  2. Click on System, on the left side panel
  3. Turn on "Use hardware acceleration when available"
  4. Click "Relaunch"

Good luck!

nttminh avatar Sep 25 '23 04:09 nttminh