Samin ohjelmointiblogi
torstai 9. syyskuuta 2010
Samples broken
My WebGL samples are now broken in Firefox 4 beta 5, there is a bug in the new beta that truncates floating point literals in the shaders. Hopefully this will be fixed with the next version of the beta. I have now updated the samples so that they should work on Chrome Canary Build.
sunnuntai 5. syyskuuta 2010
Dynamic terrain
Firefox beta was updated and my examples became broken. Hopefully they won't become broken anymore except when support for WebGLFloatArray is dropped. I uploaded fixed versions and a sample that shows how to use displacement mapping to implement dynamic terrain. This sample is written quite lazily so the terrain height map is just the same as the "cellular flow" example.
perjantai 27. elokuuta 2010
N-body simulation
Here is an example of GPU accelerated physics using WebGL. The physics in the sample include simple collision handling and gravitation. There are no optimizations in the code, so each object is checked against each other object. Some features that could be useful are springs for making complex objects and collision detection with triangles to implement walls etc.Just as in the previous sample, Firefox 4 beta is needed to view the page. To implement the simulation, 24-bit colors are used to represent fixed point values. Hopefully there will be an extension for WebGL that supports floating point textures natively.
sunnuntai 22. elokuuta 2010
First post!
Last night I tried to write a code to simulate flow of raindrops on a window, but it didn't go exactly as expected. Here is the result. To view it, you need Firefox 4 beta with WebGL enabled. This system is a special case of Cellular automaton, which can be thought to be a discrete version of a physical field. Perhaps I should write some more interesting physical simulations this way.
I think this was a good way to open this blog. I will post about my projects next week.
I think this was a good way to open this blog. I will post about my projects next week.
Tilaa:
Blogitekstit (Atom)