English 中文(简体)
How does WebGL (on firefox) work?
原标题:

I grabbed firefox 3.7a (note go to about:config and enable webgl) and ran the examples on this site http://www.iquilezles.org/apps/shadertoy/

The examples were cool then it hit me. How is it running? Code is being ran is it not? Is this an implementation of LLVM? is something else going on? Would i be able to run my own examples and do something like a command line text based game?

最佳回答

The shader examples on that site are written in a C-like language called GLSL, which is the (Open/Web)GL Shader Language. When they re executed, the JavaScript WebGL code sends the shader source off to your graphics driver s OpenGL functions, which compile it down to a machine code that runs directly on your GPU.

BTW, the shader-only style of coding, while very popular and a great way of writing cool demos, is not an entirely typical use of WebGL. Normally the shaders are used to do a lot of the heavy-duty number crunching, but the design and animation of the various objects that make up your scene is done in JavaScript. (In OpenGL, you would see a similar split between GLSL and some other language, such as C or C++.)

If you want to learn more about coding WebGL, you could do worse than visit the tutorials on my site, learningwebgl.com. I frequently link to other people s demos and tutorials too, so if you don t like my examples you should easily be able to find something better :-)

问题回答

暂无回答




相关问题
Destroying session on close of the browser from the task bar

When I close the browser window from the task bar the session is not getting destroyed. I could handle this on closing the browser using close(X) button or by pressing Alt+F4 using javascript. But ...

InvokeMethod not working on windows form

I have a windows form containing a webbrowser that navigates to a site which sends data back in the form of a table. I would like to transfer the data on that table to a application that runs some ...

Automated web browser?

For learning purposes I would like to automate some parts in a browser game, currently I am trying to fill out some simple text boxes, without any luck though. I ve created a WebBrowser component on ...

MySQL - Username to connect using Query browser

I m fairly new to my sql, and I need to know what is the default username for mysql, like in mssql you have sa . I can connect to the mysql command client but it does not ask me for a username.

Widescreen check on normal screen

I work normal screen and I develop some web application. When the application goes on widescreen some of the pages looks weired. Is there any way I can view my web page as it looks in Widescreen on my ...

How does Google get a toolbar right below the tabs in IE?

I researched through all BHO related documentation, but I just can t figure how Google gets the translation toolbar right below the tabs in IE. Any useful pointers how to achieve the same effect for ...

How to detect page zoom level in all modern browsers?

How can I detect the page zoom level in all modern browsers? While this thread tells how to do it in IE7 and IE8, I can t find a good cross-browser solution. Firefox stores the page zoom level for ...

热门标签