Schmavery / reprocessing

ReasonML graphics library inspired by Processing
https://schmavery.github.io/reprocessing/
MIT License
682 stars 24 forks source link

Issue with ellipse and stroke #18

Closed bsansouci closed 7 years ago

bsansouci commented 7 years ago

When I comment out noStroke env for the rain demo, I get a big slowdown and eventually an Fatal error: exception Invalid_argument("index out of bounds") (only on native, and web just happily continues but at a low framerate).

Schmavery commented 7 years ago

I'll try and fix the flush logic and see if that helps the crash. The slowdown may be unavoidable... There might be some faster way to do ellipse stroke that we can investigate. Have some ideas.

Schmavery commented 7 years ago

I just tried to fix this flush crash with 8b76a6a699486d886214fc16ffa44ca0c16305a3. Lmk if it helps?

bsansouci commented 7 years ago

Is that the right number of vertices? I remember spending some time making sure that math was right lol

Schmavery commented 7 years ago

xD arcstroke uses 2x the vertices of arc. Both might be a little off now. I'll go double check them later.

Schmavery commented 7 years ago

movefastandmiscalculatethings

Schmavery commented 7 years ago

Perfwise: If we switch our shaders to handle rendering bezier shapes on the GPU then we can approximate a circle using far fewer vertices. http://wdobbie.com/post/gpu-text-rendering-with-vector-textures/ http://http.developer.nvidia.com/GPUGems3/gpugems3_ch25.html

It could also be as simple as doing a pass with a profiler and cleaning up some calculations.

Schmavery commented 7 years ago

It's also possible that we're rendering way more triangles than we need and they would look good with fewer triangles + AA.

Schmavery commented 7 years ago

Going to let this issue be tracked with #24