WebGL Water Simulation
madebyevan.com
madebyevan.com
Awesome.
Writing the whole interface in a WebGL canvas could be really fun, but far too much work for an MVP, and would kind of mess with making it work on iPad etc.
Vertex shader sampler count exceeds MAX_VERTEX_TEXTURE_IMAGE_UNITS (0).
You might laugh at my hardware, but from my own OpenGL work I know the majority of users out there have crappy old chips or god-awful Intel graphics chips which the vendors can't be bothered to support any more with decent drivers that support the latest OpenGL features. Most people don't surf with a gaming grade GPU. If WebGL is this fussy about hardware, it could severely limit its uptake.
Example: WebGL doesn't even support compressed textures. The spec actually mandates "We will not support compressed textures, and this is by design". Facepalm...
Why is texture compression so badly necessary? Aren't downloaded PNG or JPEG files that you upload to the GPU uncompressed "good enough"? I don't think anyone's asking for COD5 to be in WebGL.
Given this, it makes sense to store your textures as JPEG and convert them to compressed textures at load time. That way you get the excellent compression ratio of JPEG for the download and the speed boost of compressed textures for rendering. For example, id Tech 5 (RAGE) does this for their megatextures (except they use JPEG XR instead of JPEG).
However, the lack of compressed textures, or any other specific feature isn't WebGL's biggest problem. It really is hardware compatibility. WebGL is the first web technology to expose significant hardware variations (with bonus buggy drivers!) directly to web content, and web developers aren't equipped to handle that. Deploying a WebGL app with any hope of wide compatibility will require testing on at least 3 and more likely 10+ different hardware/driver/os configurations, and the fact that a GPU is required makes automated testing difficult (VMs don't work, remote desktop solutions often don't work, driver crashes hang machines).
As for compressed textures. It hasn't been ruled out for ever. This is stil version 1.0 of the spec.
But it seems like you'd run into many of the same hindrances. For example, how will you get around the 5MB local storage limit? It would be unwieldly to re-download the whole visualization dataset each time, no?
P.S. I have nothing but respect for the medical visualization community. A lot of game graphics techniques were derived directly from work done in medical research (for example, BSP rendering and voxel rendering).
Also applications in the chrome web store can get around the local storage limitation. I'd browsers to offer a quota system where the user can assign a max amount to their applications. That would solve those issues.
http://screencast.com/t/IFtRRvLDQ
edit: NEW LINK -- http://www.youtube.com/watch?v=NGonSVJSrZI
http://www.ubuntugeek.com/howto-enable-webgl-on-firefox-4.ht...
Edit: I just got the demo to work in Chrome, and it says that, at least for caustics, OES_standard_derivatives is also required.
about:gpu
.. it might be a GPU that isn't supported?
For those who are interested, if you have a laptop with an intel based graphics card, you are probably using something called Mesa. After researching for a long time, Mesa is some sort of a graphics driver that works on Linux. Apparently, if you have Mesa 7.10+ and Firefox 6 webgl works, though I haven't figured out how to upgrade Mesa. The default on Ubuntu 10.04 is 7.4 or something like that. Apparently, Mesa is pretty buggy and can crash a lot.
If anyone has more info about this subject, I would appreciate it.
To the grandparent poster: Like any system component, the best way to upgrade Mesa is to upgrade your OS. Sadly, the latest version of Ubuntu is 11.04, which comes with Mesa 7.10.2, and Firefox blacklists every version of Mesa before 7.10.3, so you'll probably have to wait for 11.10 (or just force-enable webgl).
The demo works great on FF8 over here. Linux/NVidia.
http://nightly.mozilla.org/ <--- try one of these
Taking one notch of one of my 4 cpus, since it's obviously running mainly on my Radeon 5570 graphics card/
using latest chromium dev build on latest ubuntu 32bit. same error in firefox 5.
lspci gives me
VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07) (prog-if 00 [VGA controller])
Keep in mind we're entering a post-PC era. Our mobile and tablets already include (a bit) of GPU acceleration for certain CSS transitions. This is where WebGL will shine, in my opinion.
Edit: I have version 13 of Chrome and version 7.0a2 (2011-08-10) of Aurora.
Try violently lifting the ball out of placid water.
The water 'sticks' to the ball for a while.
Thanks for pointing out what.
Unfortunately can't get it to splash since it's just a height-field simulation.
WebGL is an emerging standard supported by FOUR major browser vendors (Google, Apple, Opera, Mozilla). Microsoft is the only one not currently adopting. It's a continuation of them doing their own thing without a care about inter-operability. Silverlight 5 implements GPU-accelerated 3D so Microsoft likely considers WebGL to be a competing product.