0

I am trying to figure out the best way to display a scene that is made of of roughly 150k TriangleMesh. This is on the low end of what I need to be capable of displaying. Currently the FPS is unacceptably low. Are there any built in culling methods (other than setCullFace()) that I could potentially use?

Chris
  • 2,435
  • 6
  • 26
  • 49
  • The question is very broad, and sounds like a general question about efficient rendering, which could hardly be answered here, even *if* it is seemingly narrowed down to JavaFX. I think that one important question is what *kind* of `TriangleMesh` instances you are talking about (i.e. how many triangles does each of them contain?). But regardless of that: Even sophisticated rendering libraries may hit a limit when the *scene complexity* (i.e. the number of objects) becomes too large. There may be solutions (e.g. merging the meshes into a single one), but these may involve considerable efforts. – Marco13 Dec 21 '16 at 19:36
  • I realize it's definitely a broad topic but I can't find hardly anything other than basics about JavaFx 3D. Each of these 100k or so elements are rendered with 12 triangular faces (close to a cube). I need to be able to interact with each of them separately as well. I am not sure how to figure out which are the closest to the camera and which ones are out of sight without causing a massive hit to performance. – Chris Dec 21 '16 at 19:43
  • It's probably hard (and *might* be close to "impossible") to achieve a good performance for 150k distinct objects with a high-level graphics API like JavaFX. There are further relevant questions: What do you mean my "interacting" with them? And: Do they have different *materials*? There are other questions that this one could basically be considered a duplicate of (http://stackoverflow.com/q/31619781, http://stackoverflow.com/q/23749614 ... you likely already found them, and admittedly, they don't have *really* satisfactory answers either...) – Marco13 Dec 21 '16 at 21:01
  • Sorry for the late response. And yea I assumed this is near impossible and the only way it'd work is with some clever trickery. I am able to make all the points into a single mesh. I need to however select a section of the mesh and hide it so it would be calculation intensive to achieve that with a mesh of 150k verticies. As to the other posts, yea I saw those and there wasn't anything really beneficial to me - thanks though! – Chris Dec 22 '16 at 13:41
  • You might also have seen my comments in the other questions. I'd *really* like to give a helpful hint here. Many years ago, I played a bit with Java3D, and the JavaFX 3D parts seem to have "inherited" much from Java3D, at least conceptually. Java3D allowed some more fine-grained control (e.g. "compiling" a part of a scene graph, doing optimizations for parts that were not supposed to (structurally) change any more). One could now try "grouping" or "clustering" the meshes. Roughly: Not use 150k*12 faces, but 1.5k*1200 faces. But this also might require considerable efforts/restructuring... – Marco13 Dec 22 '16 at 14:14
  • Here is a nice application which might help to analyze the capabilities of JavaFX on your hardware. 1.5k*1200 faces should be easily doable on a decent graphics card. (Tested on my 4 year old MacBook Pro) http://www.interactivemesh.org/models/jfx3dtuxcube.html – mipa Dec 22 '16 at 14:29

0 Answers0