I'm trying to work out whether a certain website is using WebGL. I'm fortable using Chrome's developer tools, but I'm not quite sure what I'm looking for. I see various variables and classes with "webgl" in the name, but no call to initWebGL()
for instance.
Is there a reliable, perhaps simpler, way to tell?
I'm trying to work out whether a certain website is using WebGL. I'm fortable using Chrome's developer tools, but I'm not quite sure what I'm looking for. I see various variables and classes with "webgl" in the name, but no call to initWebGL()
for instance.
Is there a reliable, perhaps simpler, way to tell?
Share Improve this question asked Oct 19, 2015 at 22:53 Steve BennettSteve Bennett 127k45 gold badges186 silver badges244 bronze badges3 Answers
Reset to default 3First, there should be a <canvas>
element in the body. If not, it can't be WebGL.
Second, open the chrome debugger and press Ctrl+Shift+F (Command+Option+F for MacOS). At the very bottom, expand the search pane if necessary. Search for "bindBuffer". You absolutely must bind buffers to do anything with WebGL. It will be used.
In Google Chrome Version 97 this worked for me:
- Open the "Elements" tab in Chrome DevTools
- Select the
<canvas>
in the DOM which you want to inspect, so it shows== $0
next to it (see screenshot below) - Open the "Console" tab in Chrome DevTools
- Enter
$0.getContext('2d')
, when it showsnull
then it's a WebGL-powered canvas, when it showsCanvasRenderingContext2D
then it's a plain 2D canvas
Here are some sites to try:
WebGL Canvas - https://get.webgl/
Non-WebGL Canvas - http://www.professorcloud./mainsite/canvas-nebula.htm
Screenshot:
Its been awhile since the original question but thought I would share:
If you use the "Profile" tab in Chrome Dev Tools, and record a second or two you should see in the results a row with the name "GPU". If there is a <canvas/>
in the DOM, but it's not using WebGL, the GPU row won't be there.
With WebGL
Without WebGL
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745223269a4617345.html
评论列表(0条)