Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Highlighted
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

WebGL Discussion

Prompted by the following Tweet:

#WebGL on #PlayBook or #DevAlpha still works poor Smiley Sad http://glsl.heroku.com/ not a single one working

 

I did some investigation and 140 characters just wasn't enough to discuss. Hence this thread.

 

To begin, the PlayBook is appearing to have issues at that URL for different reasons. Specifically, connecting Web Inspector yields the following error when attempting to load any demo:

 

QUOTA_EXCEEDED_ERR: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota.

 

This is coming from helper.js which seems to be common across most/all of these demos and would explain the number of failures being seen:

 

function initialize_helper() {
	window.onhashchange = function() { load_url_code(); };

	if (typeof localStorage !== 'undefined') {
		if ( !localStorage.getItem('glslsandbox_user') ) {
			localStorage.setItem('glslsandbox_user', generate_user_id()); /* ERROR OCCURS HERE. */
		}
	} else {
		// This fallback shouldn't be used by any browsers that are able to commit code.
		localStorage = { getItem: function(x) { return 'invalid_user'; } };
	}
}

 

The value itself doesn't end up being that large (one example: 755bfa3) so this may be worth gathering more information and logging a bug against the PlayBook. The call at hand seems to have an issue with what's returned here:

 

function generate_user_id() {
	return (Math.random()*0x10000000|0).toString(16);
}

 

On the Dev Alpha B, I do not see the above issue, but am seeing some issues compiling shaders. Some working examples include:

For reference, are you using Dev Alpha A or B? Also, can you please provide the full OS version that you are running?

 

The following http://glsl.heroku.com/e#4618.0 is an example of one that is not working on the Dev Alpha B. Web Inspector is indicating:

 

Link Error: Fragment shader was not successfully compiled.
VALIDATE_STATUS: false ERROR: 0

Though I'm not exactly sure what the cause of this error is. On one other sample (I'm unable to relocate it) I did spot a division by zero error on one example that prevented compilation, but it would take a deeper investigation into these shaders to identify the exact errors at hand.

 

Again though, it doesn't seem to be a WebGL issue as much as an issue with how these shaders are coded. That doesn't mean it is or is not a bug with our web engine, but there isn't any hard evidence to point either way at this time.

 

If you search for WebGL Samples there are a number that come up that run on both PlayBook and Dev Alpha, unfortunately it can be tricky finding mobile samples that don't require keyboard/mouse input.

 

On that note, I'm definitely open to discussion on this topic some more. If you have any specific errors that you can report for one of these samples, withi specific code that should work but isn't, I'd be happy to help escalate any bug reports.


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: WebGL Discussion

Quick note on the PlayBook side. Disabling Private Browsing got rid of the localStorage issue. I'm investigating now for actual functionality on the samples.

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.