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.

Fragment shader compilation fails on init

See original GitHub issue

OS platform / Browser

Fedora 31 Linux (kernel: 5.7.7) / Mozilla Firefox 78.0.1 (64 bit)

melonJS version

7.1.1 (latest) Tried with 6.4.0 -> no error

Bug description

The entire framework doesn’t start. An error occurs while creating the WebGL renderer. Apparently the compilation step of the fragment shader of the QuadGLShader fails (see error log)

Steps to reproduce the bug

Execute part 2 of the platformer tutorial (only happens on my machine, checked with some colleagues, same configuration, different gfx card)

Console log Extract

Error creating WebGL renderer :0:2(12): warning: extension `GL_ARB_gpu_shader5' unsupported in fragment shader
0:21(29): error: sampler arrays indexed with non-constant expressions are forbidden in GLSL 1.30 and later
melonjs.js:19930:20

Uncaught TypeError: _context is null
    getContext2d http://localhost:8000/lib/melon/melonjs.js:20562
    init http://localhost:8000/lib/melon/melonjs.js:21378
    Class http://localhost:8000/lib/melon/melonjs.js:193
    autoDetectRenderer http://localhost:8000/lib/melon/melonjs.js:19934
    init http://localhost:8000/lib/melon/melonjs.js:20128
    onload http://localhost:8000/js/game.js:15
    onReady http://localhost:8000/:46
    _domReady http://localhost:8000/lib/melon/melonjs.js:454
melonjs.js:20562:14

Uncaught TypeError: me.video.renderer is undefined
    init http://localhost:8000/lib/melon/plugins/debug/debugPanel.js:232
    Class http://localhost:8000/lib/melon/melonjs.js:193
    init http://localhost:8000/lib/melon/plugins/debug/debugPanel.js:52
    Class http://localhost:8000/lib/melon/melonjs.js:193
    register http://localhost:8000/lib/melon/melonjs.js:31264
debugPanel.js:232:56

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
obiotcommented, Jul 31, 2020

sure yes, if it runs, and performances are as expected on your side, it’s acceptable 😃

end of next week is the maximum “deadline” for the 8.0 release anyway, so not long to wait !

0reactions
mboliscommented, Jul 31, 2020

Thanks @obiot for the clear answer.

I ended up overwriting me.QuadGLShader and passing on an unrolled shader. Being a bit in a hurry, I believe it’s an acceptable solution.

Do you believe it’s a passable solution, while 8.0 gets to release?

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is wrong with my shader initialization code?
Fragment shader (s) were not successfully compiled before glLinkProgram() was called. Link failed. error in shader validating Fragment shader(s) ...
Read more >
fragment shader did not compile: 0. Error ...
While running pxScene I'm getting the following error: rt:ERROR pxContextGL.cpp:1323 -- Thread-4876: Error: fragment shader did not compile: ...
Read more >
Data Type (GLSL) - OpenGL Wiki
Fragment Shader · Compute Shader · Other shading languages. The OpenGL Shading Language defines a number of data types. It also defines the...
Read more >
Compiling fragment shader gives "ERROR
Compiling fragment shader gives "ERROR: error(#60) Unknown char: " ... Basically I compile and attach shaders in a loop, and when all shaders...
Read more >
Making Shaders
In the tutorial, we have a vertex and a fragment shader; both of these are ... strShaderType = "fragment"; break; } fprintf(stderr, "Compile...
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