Hi,
still can't really believe I fiddled through all those fortran translation libraries and scientific code comments (tap on my own shoulder) but somehow I made it work...
I now have a 3D model of earths internal and external magnetic fields by traced field lines every 72° longitude (pentagon) and every 9° latitude (I only need the the Northern Hemisphere since the lines connect to S) and up to 250 points each... which is as small as I found I could go, without provoking computation warnings. Of course I could also completly ignore the longitude and only trace the ones which are strictly parallel to the solar wind thus, drawing a 2D profile of the magnetoshere.
As expected its a hard hit on performance and I now get around 1.6 fps as opposed to 30+ as before.
Therefore my question would be if its possible to maybe run it as another thread (I have no idea of such programming concepts in c++, unfortunately), possibly even on the other core of my cpu ?
Otherwise, it would also be good to run another thread with a renderbar and stop the simulation updates so one can explore a high resolution model with decent frame rates. Maybe RTT image sequences would also be cool...
Any basic information on how to make new threads, links to some reading, anything.
thx in advance...
start a new thread ?
Are you computing the position of those lines every frame? If so, do they actually change, or are they static? How are you rendering your lines? I'd think that if you only had to calculate the points once and you rendered them using a line list, the performance wouldn't be that bad. It is only 12500 points right?
If, for some reason, you do need to recalculate the points periodically, you could do that in a thread. I wouldn't suggest it unless it is really necessary, but you could do it.
Travis
If, for some reason, you do need to recalculate the points periodically, you could do that in a thread. I wouldn't suggest it unless it is really necessary, but you could do it.
Travis
yes, right now I am computing the points on every frame, which obviously doesn't work fast enough.
I can change the angle of the solar wind by its typical +/- 4° aswell as the speed of it, so the points would change. I would really like to find a way to multi thread all that, but if I can't, I make a button to render them once, stop the simulation and make a static camera inspection tour or someting like that. The points are expressed in GSW coordinates, which is according to documentation:
I would love to have something like a simple easy spline class for irrlicht, because I really gave up on all the driver triangle fan etc. methods long time ago... Billboards seem to be quite performant, but they are only an improvisation.
I can change the angle of the solar wind by its typical +/- 4° aswell as the speed of it, so the points would change. I would really like to find a way to multi thread all that, but if I can't, I make a button to render them once, stop the simulation and make a static camera inspection tour or someting like that. The points are expressed in GSW coordinates, which is according to documentation:
So right now I'm trying to make an empty sceneNode with the described orientation (-X facing towards the sun), and parent wireframe billboards as children of it inside to visualize the lines./* IN THE GSW SYSTEM, X AXIS IS ANTIPARALLEL TO THE OBSERVED DIRECTION OF THE SOLAR WIND FLOW. */
/* TWO OTHER AXES, Y AND Z, ARE DEFINED IN THE SAME WAY AS FOR THE STANDARD GSM, THAT IS, */
/* Z AXIS ORTHOGONAL TO X AXIS, POINTS NORTHWARD, AND LIES IN THE PLANE DEFINED BY THE X- */
/* AND GEODIPOLE AXIS. THE Y AXIS COMPLETES THE RIGHT-HANDED SYSTEM. */
I would love to have something like a simple easy spline class for irrlicht, because I really gave up on all the driver triangle fan etc. methods long time ago... Billboards seem to be quite performant, but they are only an improvisation.
Are you using billboard scene nodes? If so then you need to batch everything together into one draw call instead. Drawing 500 triangles together will be very fast, but drawing 250 pairs 2 triangles is incredibly slow. If you're happy with wireframe billboards then copy and modify the particle system code, it renders thousands of billboards in one call.