skeeto / webgl-particles Goto Github PK
View Code? Open in Web Editor NEWWebGL particle system demo
Home Page: http://skeeto.github.io/webgl-particles/
License: The Unlicense
WebGL particle system demo
Home Page: http://skeeto.github.io/webgl-particles/
License: The Unlicense
It seems like the particles drift left and upwards on mobile devices (both android and ios). I'm wondering if this is caused by the browser scaling the gl viewport to compensate for high dpi screens? You can see the effect by viewing the demo on any mobile device. I tried on a Samsung Galaxy S6 and iPhone 6S.
Any other ideas as to why this might be happening? Could there be a loss of precision or some kind of rounding error going on?
I checked and both devices have 16 slots for textures in the vertex shader with:
var vertexUnits = gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS);
FWIW window.devicePixelRatio is 4 on my Android and 3 on my iPhone.
Thanks!
Hello. I noticed that pressing Fewer
until 0 particles are simulated causes the simulation to crash with the errors:
WebGL: INVALID_FRAMEBUFFER_OPERATION: drawArrays: attachment has a 0 dimension
Uncaught Error: WebGL rendering error
This can probably be fixed by preventing the number of simulated particles from going below 1.
I'm a newbie of shader. (and with bad English, sorry)
Could you give me some advices ?
I want to use image as particles.
( do something like this : http://www.goodboydigital.com/pixijs/bunnymark_v3/ )
All particles use the same image file , but use different parts of the image. (like sprite-sheet)
Thanks.
@skeeto Hi :)
I'm glad to see your codes.
And I have a couple of question. In https://github.com/skeeto/webgl-particles/blob/master/js/particles.js#L15, What does mean in dividing by 3 ? and In https://github.com/skeeto/webgl-particles/blob/master/js/particles.js#L16, Why did you multiply 100 to channel1's(?) scale?
Thank you :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.