Re:Polygon Shredder
by spite on Sunday February 07, 2016 @02:41PM
(#11054422)
It is a nice track! I wanted to do something with audio, stretching the cubes, changing their scale, and emitting different number of particles based on some audio analysis. The next experiment ^_^
About the frakenpolys: the hash info doesn't directly say the number of cubes to generate, but the side of the texture that hold the position. So if it is 256, it's a 256x256 RGBA Float32Array, 65536 particles that are then rendered as cubes. For odd numbers, or simply numbers that are not power of two, it doesn't work (well, it works, but the access to different vertices is all garbled and you get all those franken-noodle-cubes)
Re:Polygon Shredder
by spite on Sunday February 07, 2016 @03:11PM
(#11054565)
Should work on Chrome, Firefox, Safari, IE, Opera, Edge... any that supports WebGL with OES_standard_derivatives (so basically 99% of browsers according to http://webglstats.com/)
What version of Firefox, OS, GPU, etc. are you using?
Re:Polygon Shredder
by spite on Sunday February 07, 2016 @04:45PM
(#11055036)
Technically, they're wrong because the stats are collected by trackers in sites about WebGL, so there's a bias towards having complete WebGL implementations.
Of course there are more than 1% browsers that support, but we're talking about implementations, not devices. You can can have an old iPhone running iOS pre8 and it won't run WebGL, but one can say that iOS does support WebGL now.
Re:Polygon Shredder
by dave2000 on Sunday February 07, 2016 @05:04PM
(#11055128)
Right.
So firefox is a class, and there are instances of that class running. Most instances are running on mobile devices, so it really makes sense to say that only a small minority of browsers are capable of running WebGL.
I'd say most of mobile browsers can run WebGL, it's just that the experiences are not designed for mobile platforms (this Polygon Shredder, for instance, it does work on mobile, it's just too slow to be good, but I can probably make it work)
Re:Polygon Shredder
by spite on Sunday February 07, 2016 @03:48PM
(#11054749)
Firefox beta/Aurora/DeveloperEdition... all but stable have a regression on WebGL and reporting missing extensions support, like OES_texture_float. Most of the three.js recent content will probably not work on them.
Re:Polygon Shredder
by spite on Sunday February 07, 2016 @02:43PM
(#11054434)
You laptop has a fan, but it was probably spinning to cool down the GPU. This effect is 99.9% running on your graphics card; once everything is setup by the CPU, it's all running in shaders and video memory. Still hot, but just wanted to make clear where the power is being used.
Re:Polygon Shredder
by spite on Sunday February 07, 2016 @02:48PM
(#11054463)
Hence the "insane", it means 2048x2048 base particles. That's over 25 million triangles (or 75 million vertices) per pass, and it's done twice (color and shadow mapping). Also the curl noise is pretty expensive, and 2048x2048 is quite a lot of operations. I think the browser locks before being able to allocate all necessary info, and if it does, probably the GPU can't keep up. Not everyone's card can push that much, but I've seen people getting to 4096!
Re:Polygon Shredder
by onion2k on Monday February 08, 2016 @03:07AM
(#11056897)
That shouldn't stop you. three.js makes webGL really easy to write, and most of the maths can be borrowed from other code. You can do some pretty awesome stuff with only a basic knowledge of JS. It's very rewarding to give it a try. My math-fu sucks but I've still been able to make fun things like http://library.ooer.com/2015/11/15/Cube-Ocean/
Some more variations we came up with:
http://alteredqualia.com/tmp/solitaire/
http://alteredqualia.com/tmp/cash/
http://alteredqualia.com/tmp/mario/
http://alteredqualia.com/tmp/meeseeks/
http://zz85.github.io/explorer-crasher/
http://zz85.github.io/explorer-crasher/fur.html
Also, choosing an odd number of polys to be rendered creates frankenpolys: https://www.clicktorelease.com/code/polygon-shredder/#33
About the frakenpolys: the hash info doesn't directly say the number of cubes to generate, but the side of the texture that hold the position. So if it is 256, it's a 256x256 RGBA Float32Array, 65536 particles that are then rendered as cubes. For odd numbers, or simply numbers that are not power of two, it doesn't work (well, it works, but the access to different vertices is all garbled and you get all those franken-noodle-cubes)
I thought Firefox supported WebGL. That's sad. So basically, this is Chromium-desktop-only.
What version of Firefox, OS, GPU, etc. are you using?
Well, those stats are wrong, because a lot more than 1% of browsers are on mobile platforms with no WebGL support.
Of course there are more than 1% browsers that support, but we're talking about implementations, not devices. You can can have an old iPhone running iOS pre8 and it won't run WebGL, but one can say that iOS does support WebGL now.
The actual implementation stats are here http://caniuse.com/#search=webgl
So firefox is a class, and there are instances of that class running. Most instances are running on mobile devices, so it really makes sense to say that only a small minority of browsers are capable of running WebGL.
WebGL was enabled on Android on KitKat, and according to starts, that's 70,8% of installations (http://developer.android.com/about/dashboards/index.html)
WebGL was enabled on iOS on 8, and that's 93% of installations (https://developer.apple.com/support/app-store/)
I'd say most of mobile browsers can run WebGL, it's just that the experiences are not designed for mobile platforms (this Polygon Shredder, for instance, it does work on mobile, it's just too slow to be good, but I can probably make it work)
Other experiences like https://www.clicktorelease.com/code/cruciform/ or https://www.clicktorelease.com/code/xmas-virus/ are supported and do work as expected.
You're right that there's a lot of phones that are too underpowered to run WebGL experiences, but the browsers themselves do support it perfectly.
[for cooling off CPU taxed with rendering confetti]
This is great work, looking forward to your write-up!