dwitter.net | f8f82804 (11350)

+ New dweet
function u(t) {
} //
122/140


Please log in (or register) to post a dweet (copy-paste the code somewhere safe to save it meanwhile)


u(t) is called 60 times per second. t: Elapsed time in seconds. S: Shorthand for Math.sin. C: Shorthand for Math.cos. T: Shorthand for Math.tan. R: Function that generates rgba-strings, usage ex.: R(255, 255, 255, 0.5) c: A 1920x1080 canvas. x: A 2D context for that canvas.
show FPS hide FPS share fullscreen

function u(t) {

}//
139/140


Please log in (or register) to post as a new dweet (copy-paste code somewhere safe to save it meanwhile).

Please log in (or register) to comment.

show FPS hide FPS share fullscreen

function u(t) {

}//
112/140


Please log in (or register) to post as a new dweet (copy-paste code somewhere safe to save it meanwhile).

Please log in (or register) to comment.

show FPS hide FPS share fullscreen

function u(t) {

}//
125/140


Please log in (or register) to post as a new dweet (copy-paste code somewhere safe to save it meanwhile).

  • katkip: Electricity. Sadly, #compressed x.globalAlpha=.1;x.fillRect(0,0,2e3,2e3);r=Math.random;f=p=>S(-p/42+t*2)<S(t);for(i=899;i--;){X=r()*1910,Y=r()*1070;if(f(Y/4^X/4))x.clearRect(X,Y,10,10)};

Please log in (or register) to comment.

show FPS hide FPS share fullscreen
remix of d/1112 by u/sigveseb

function u(t) {

}//
139/140


Please log in (or register) to post as a new dweet (copy-paste code somewhere safe to save it meanwhile).

Please log in (or register) to comment.

show FPS hide FPS share fullscreen

function u(t) {

}//
127/140


Please log in (or register) to post as a new dweet (copy-paste code somewhere safe to save it meanwhile).

  • f8f82804: I see a 3x speedup using putImageData over fillRect
  • f8f82804: for(i=1e4;i--;x.putImageData(...u[z=i%2e3]=(u[z]||[new ImageData(Uint8ClampedArray.of(z/8,0,b=r()*255,255),1),z,b*4]).map((v,j)=>j?v+2-4*r():v)))r=Math.random

Please log in (or register) to comment.

show FPS hide FPS share 1 remix fullscreen

function u(t) {

}//
135/140


Please log in (or register) to post as a new dweet (copy-paste code somewhere safe to save it meanwhile).

  • f8f82804: drawing smaller points doesn't help; this suggests the overhead is in color parsing

Please log in (or register) to comment.

show FPS hide FPS share fullscreen

function u(t) {

}//
139/140


Please log in (or register) to post as a new dweet (copy-paste code somewhere safe to save it meanwhile).

  • LimeLaser: 99 Accelerating Particles (thank you qm3ster)
  • LimeLaser: I have been hoping to make a particle system that persists individual positions and velocities for a while now. With the code golfing qm3ster has done, I can finally do it!

Please log in (or register) to comment.

show FPS hide FPS share 1 remix fullscreen
remix of d/12658 by u/qm3ster

function u(t) {

}//
135/140


Please log in (or register) to post as a new dweet (copy-paste code somewhere safe to save it meanwhile).

  • f8f82804: A little golf and a color tweak to get some room to play with performance. it seems like the limit is just in drawing; Math.random() seemingly can't be improved on. I'd like to look at putImageData as suggested by https://stackoverflow.com/a/4901604 because it's possible that color parsing is a big overhead cost.

Please log in (or register) to comment.

show FPS hide FPS share 1 remix fullscreen
remix of d/12666 by u/tomxor

function u(t) {

}//
141/140


Please log in (or register) to post as a new dweet (copy-paste code somewhere safe to save it meanwhile).

  • tomxor: Mini surface plotter v2! With an actual useful range and colour map this time.
  • tomxor: f=_=>S((S(X)**2+S(Y)**3)*3.14+t)**2
  • magna: Great!

Please log in (or register) to comment.

show FPS hide FPS share fullscreen

function u(t) {

}//
141/140


Please log in (or register) to post as a new dweet (copy-paste code somewhere safe to save it meanwhile).

Please log in (or register) to comment.

Loading...
Next page