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.

GL_INCOMPATIBLE even with WebGL2 support

See original GitHub issue

Hi,

I’m facing a problem very similar to #163 on a Samsung’s Galaxy J3 (older model), a Motorola’s Moto G4 Play and a Samsung’s Galaxy J6+. All of them return GL_INCOMPATIBLE on callbackReady().

As per the compatibility description in the README, all of those 3 models should support Jeeliz properly. I understand the difficulties of relying on different hardware and OpenGL implementations though.

Context

We’re running a proof of concept for a skin tone research, where we color-correct the image using a grey card. This lib has been extremely helpful on properly positioning the user face on the image (position, distance and angle).

Right now we’re asking close people to try it out in order to gather feedback regarding UX and reliability.

What we have now

I’ll focus on the Galaxy J3 which I can contact the phone owner easily.

Error happens on both Firefox 80.0.0-beta.6 (Build #2015757457) and Chrome 84.0.4147.125. It’s running on Android 7.0 (kernel 3.18.14-14795764). It says Galaxy J3 Prime on the about menu (phone name) and model number SM-J327T1.

WebGL Report says that WebGL 2 (88 of 88 functions) and WebGL 1 (including FLOAT and HALF_FLOAT) are compatible. Screenshots attached at the bottom.

This demo won’t run as well (blank page). I unfortunately can’t access the device’s console log. I can request tests on other demos as well if you find helpful.

Read Pixels Test is ok as well (“everything is fine bro”), from #41.

Our implementation

Our client code is pretty simple (single < 300 lines JS file) and relies on Jeeliz and Babel only.

Main code:

JEEFACEFILTERAPI.init({
	canvasId: CANVAS_ID,
	NNCpath: 'dist/',
	callbackReady: function(errCode, spec) {

		document.getElementById('loading').style.visibility = 'hidden';

		if (errCode) {
			console.log('Error: ', errCode);
			document.getElementById('text').innerHTML = `Failed to load câemra. Error code: ${errCode}.`;
			return;
		}

		document.getElementById('buttonWrapper').style.visibility = 'visible';
		document.getElementById(HEAD_ID).style.visibility = 'visible';

		CVD = JEEFACEFILTERAPI.Canvas2DDisplay(spec);

		docResized(); // perform an initial resize
	},

	// called at each render iteration (drawing loop):
	callbackTrack: (detectState) => {
		// * hidden for simplicity sake *
		// we only render a black rectangle on the canvas and update some DOM elements here
	},
});

Maybe not relevant, but we do call docResized on window`s resize event to fix the canvas aspect ratio. This isn’t very performant but works pretty well:

const docResized = () => {

	const vWidth = window.innerWidth;
	const vHeight = window.innerHeight;
	const aspectRatio = vWidth / vHeight;
	const isAspectRatioWider = (aspectRatio > PREFERRED_ASPECT_RATIO);

	const canvas = document.getElementById(CANVAS_ID);

	const setRelativeHeigth = () => {
		setElementWidth(canvas, vWidth);
		setElementHeigth(canvas, vWidth / PREFERRED_ASPECT_RATIO);
	}

	const setRelativeWidth = () => {
		setElementHeigth(canvas, vHeight);
		setElementWidth(canvas, vHeight * PREFERRED_ASPECT_RATIO);
	}

	isAspectRatioWider ? setRelativeWidth() : setRelativeHeigth();

	const canvasRect = canvas.getBoundingClientRect();

	updateCardSize(canvasRect);
	updateHeadSize(canvasRect);

	CVD.resize();
	JEEFACEFILTERAPI.resize();
}

Screenshots

Note: many texts are in portuguese, please let me know if you need any translation.

57578d45-088e-408c-82b6-b18270db3742

image

image

image

image

image

image

image

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
igor9silvacommented, Mar 23, 2021

I don’t have access to the device anymore, unfortunately. I’ll let you know if that issue appears again. Thanks!

1reaction
xavierjscommented, Aug 26, 2020

Thank you. It really does not want to render to texture with float / half-float precision =(

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebGL 2.0 | Can I use... Support tables for HTML5, CSS3, etc
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >
Enabling WebGL2
Enabling WebGL2 · Go to about:flags · Press Ctrl-F or Cmd-F and search for webgl 2.0 · Find WebGL 2.0 Prototype and click...
Read more >
1348952 - Allow WebGL 2 support even if native GL extension ...
Error reason: WebGL creation failed: * WebGL 2 requires support for the following features: transform_feedback2 * Exhausted GL driver options.
Read more >
Browser support for WebGL2 for transition animations #4748
Hello, I'd like to implement position transition animations, but even though I use the latest browser versions (Chrome 83+, ...
Read more >
Check if WebGL2 is supported and enabled in client's browser
WebGL2RenderingContext exists to try to guess if it's the browser that doesn't support WebGL2 or the user's OS/GPU/Drivers.
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