That’s one of the reason I really like you. I already have a question for you but I like to ask that via a PN
So as I said before, in my system their is some physics involved and when its active I get a drop of 4-5fps. Now this is not much but I want more complex physics which would mean a greater drop in fps.
Example: all particles testing each other for collisions. A grid based system would improve performance but for a things like water and what not grid based systems would not look very good.
One I idea I have on improving the performance of the calculations is using bitwise operations. Now from what I understand division is the biggest offender when it comes to speed. So would it be a good idea to cast things to ints so you could use bitwise operations on them? You would lose some accuracy but for some non real world physics simulations I don’t think that would be a big problem.
Also, is casting an double/float to an int take that long?
Having 1000 particles all affecting each other means doing 1000^2 test between them. A grid is a very good way of reducing the number of tests to a very low amount for each particle. Why wouldn’t water particles work with grids? I’ve never heard of water with telekinesis…
Casting to an int, doing a bit-shift and then casting back to a float is definitely more expensive than a single float divide. Especially the float->int cast is slow in my experience. Either use floats or ints, don’t cast too much between them…
Note that it is very hard to benchmark casting, since it will often be optimized away in minimal tests and it’s also pretty hard to measure the difference. Micro benchmarks are really hard to do the right way and should only be used as hints, not facts in my opinion. I’ve gotta admit that they are funny as hell to do though. xD
I hate you so much
That’s one of the reason I really like you. I already have a question for you but I like to ask that via a PN
TS— TS— TS— TSUNDEREEEEEEEEEEEEE!!! Obviously R.D. asked me out. I now officially have a tsundere lover. I consider myself the luckiest man on Earth.
(Joke… ._.)
TS— TS— TS— TSUNDEREEEEEEEEEEEEE!!! Obviously R.D. asked me out. I now officially have a tsundere lover. I consider myself the luckiest man on Earth.
xD I told you to not do that!!! >:|
Okay, enough off-topic ._.
Ok so some times you want particles to overlap and others not to in order to get some cool effects. Also most using a grid based system in 3d is much to great of a hassle and having a grid span a huge world in 3d seems a bit big. I don’t know if it really is that hard because I have never programmed a massive game world but it seems very hard.
I have test my particle system with absolutely no rendering just particle updating/physics and with basic movement, I can get 50k-60k particles before a fps drop but with physics its 50k that starts to drop fps. So rendering is a performance hit but the particle updating is also a huge bottle neck. So I am wondering how other people do their particle updates and what not to see if maybe my system has some issues in the updating.