|
|
|
|
|
by ninetenfour
1746 days ago
|
|
I think you can tessellation on the CPU in an adaptive fashion (e.g. based on curvature or similar) and update that on a per frame (add, remove tessellation points) basis rather than re-tesselating from scratch each frame. The tessellation would just have weights from each control point. You can modify the vertices on the CPU, update the tessellation points and update those to the GPU. Get 60fps should be possible even when updating 1Ks of vertices (probably more) per second. Do this for whatever changed using dirty lists or something so you do not update everything to the GPU on each frame. This should be relatively fast if you using ArrayBuffers. 100% this can be done in JavaScript in a very fast fashion. It may only seem like it can not be done if you are doing JS poorly. Maybe people make the mistake of not using ArrayBuffers for everything and that makes it slow. The main limitation in JS is the lack of really great multithreading, but I do not think you need it here. If you want ultimate speed use WASM for the CPU-based updating of your geometry structures. Anyhow, you are mistaken in your current beliefs and it will hurt you going forward. |
|
But even if I had to start from scratch, I would still use C++. It is the most-used language in this field for rational reasons, not just for mistaken beliefs. Multi-threading is important, supporting custom pen tablets hardware is important, accessing Metal and Direct3D graphics API is important, being able to use the core as a shared library for command-line tools is important, being able to not crash when another tab makes the browser crash is important (okay, for this I could use electron). Being able to embed a Python interpreter is important (yes, it has to be Python it's a design decision). And we're not talking 1Ks vertices, but millions.
Again, AAA games are not developed in Javascript for a reason. Professional productivity graphics application have the same requirements than AAA games.