Omnimaga
General Discussion => Technology and Development => Web Programming and Design => Topic started by: Sorunome on November 09, 2012, 09:24:51 pm
-
Hey, I wanted to start and so some awesome stuff with WebGL but it looks as if my browser doesn't support it.
I have Chromium, this version: Version 22.0.1229.94 (161065) and i'm running on archlinux
my html code looks like this (from a tutorial to test if it's working):
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function initWebGL(canvas) {
// Initialize the global variable gl to null.
gl = null;
try {
// Try to grab the standard context. If it fails, fallback to experimental.
gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
}
catch(e) {}
// If we don't have a GL context, give up now
if (!gl) {
alert("Unable to initialize WebGL. Your browser may not support it.");
}
}
function doFirst() {
var canvas = document.getElementById("canvas");
initWebGL(canvas); // Initialize the GL context
// Only continue if WebGL is available and working
if (gl) {
gl.clearColor(0.0, 0.0, 0.0, 1.0); // Set clear color to black, fully opaque
gl.enable(gl.DEPTH_TEST); // Enable depth testing
gl.depthFunc(gl.LEQUAL); // Near things obscure far things
gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT); // Clear the color as well as the depth buffer.
}
}
window.addEventListener('load',doFirst,false);
</script>
</head>
<body onload="start()">
<canvas id="canvas" width="640" height="480">
Internet explorer SUCKS! :P
</canvas>
</body>
</html>
-
Does it pop up with the error message? It works fine for me in Chrome (beta channel).
Chrome should support WebGL since version 9.
-
yeah, the error message popus up
-
Maybe the Linux build of Chrome doesn't support WebGL? Though I can't see a reason why not.
EDIT: Is WebGL disabled in chrome://flags/?
-
it was deactivated, activated and thought woot, but that popup is still coming -.-
-
You un-checked the checkbox, right?
And did you restart Chrome afterwards?
-
Do you have 3D graphics acceleration?
-
@dt yes
and @willrandship: how do i find out?
-
easiest way:
glxinfo | grep rendering
it should say:
Direct Rendering: Yes
which means you have 3D acceleration. If it says no, you don't, and it's probably a driver issue.
It might get some other stuff too, but only the Direct Rendering line matters.
-
sorunome-laptop% glxinfo | grep rendering
direct rendering: Yes
What's then the problem? D:
-
Hmmmmm.....
I'm assuming you have a method of installing packages from the AUR. If so, try installing google-chrome. That will be the official build, so it has the flash plugin, and it might handle webGL a bit differently. Worth a try, at least.
-
meh, i'd prefer a chromium solution as i love it, you know...... :(
-
Well, whatever.
What video card do you have? Is it an nvidia video card?
-
i am not sure, i didn't pay attention to hardware when buying the laptop D:
-
run this, please.
lspci | grep VGA
-
sorunome-laptop% lspci | grep VGA
00:01.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Wrestler [Radeon HD 6310]
-
Ok.
Try running this and see if webGL runs in the window that comes up.
chromium %U --ignore-gpu-blacklist
-
nope, still not working
-
Hmmm.....if you want to you could try installing the catalyst drivers.
https://wiki.archlinux.org/index.php/AMD_Catalyst (https://wiki.archlinux.org/index.php/AMD_Catalyst)
For now, I'm off to bed.
-
well, if it is so complicated to get it working i don't really wanne do to much with it, so is it somehow possible to recalculate out of x/y/z the new x/y and scale for 3d?
How? :D
Thanks in advice ;)