Performance Questions

Started by aZen, May 18, 2013, 07:00:38 PM

Previous topic - Next topic

aZen

Two questions:

A) Would it be possible to render only certain parts of the whole FrameBuffer in software mode? I'm updating only certain, well defined areas and would like to avoid re-rendering everything every time I do an update. I've already experimented with moving the camera, but that is extremely tricky to get right.

B) Hit testing is a performance problem for me at a certain point (when I have a lot of objects). I'm assuming you're using some kind of index for all the triangles and then doing a hit-test with the ray? I'm using http://www.jpct.net/doc/com/threed/jpct/World.html#calcMinDistanceAndObject3D%28com.threed.jpct.SimpleVector,%20com.threed.jpct.SimpleVector,%20float%29. Would it be possible/helpful to support this function with a set of possible objects or an area (using my own index)?

Thank you!

EgonOlsen

Quote from: aZen on May 18, 2013, 07:00:38 PM
A) Would it be possible to render only certain parts of the whole FrameBuffer in software mode? I'm updating only certain, well defined areas and would like to avoid re-rendering everything every time I do an update.
No, that's not possible and in almost every case, it's not needed and not worth the trouble. This would be possible in only some really special and rare situations anyway.

Quote from: aZen on May 18, 2013, 07:00:38 PM
B) Hit testing is a performance problem for me at a certain point (when I have a lot of objects). I'm assuming you're using some kind of index for all the triangles and then doing a hit-test with the ray? I'm using http://www.jpct.net/doc/com/threed/jpct/World.html#calcMinDistanceAndObject3D%28com.threed.jpct.SimpleVector,%20com.threed.jpct.SimpleVector,%20float%29. Would it be possible/helpful to support this function with a set of possible objects or an area (using my own index)?
Ray-polygon tests are done only if the ray intersects and object's bounding box, which is a pretty cheap test. So as long as your objects aren't located very close to each other, these expensive tests against each polygon shouldn't happen too often. You can disable collision checks on objects that you consider to be impossible to be hit by the ray before doing the check to see if that improves things.