Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Performance and Raycasting

Author
Message
Raizzan
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location:
Posted: 12th Jan 2016 11:17

Hi there.
Ive got a question (especially to the devs).

Right now im writing my Bachelor-Thesis inside AGK2. It will be (hopefully) a Pathfinding-Algorithm with the use of Raycasts.
So my questions are:

1. Are Physicsraycasts beeing processed by GPU or CPU (in agk2) / (in Box2D) ??
2. CAN they be processed by CPU ? Can they be processed by GPU? (in other games/engines?)
or is Raycasting like... always beeing processed by CPU ?
3. How bad are Raycasts for the FPS?

thanks for answering


Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 12th Jan 2016 11:55
here it said it can used the gpu
http://bulletphysics.org/wordpress/
i remember the nvidia physics engine can choose gpu or cpu by user options.
raycast are just maths. i.e. line/triangle intersections.
if the line is longer you have more triangles for a intersection test.
so a shorter line test should be faster.
its the amount of Raycasts that can affect the fps or unnecessary maths.
often you can also use a line/sphere sphere/sphere test first for complex objects.


AGK (Steam) V2.0.16 : Windows 10 Pro 64 Bit : AMD (15.30.1025) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Raizzan
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location:
Posted: 12th Jan 2016 12:37
Quote: "here it said it can used the gpu
http://bulletphysics.org/wordpress/"


could you give me a more exact place you find that information?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 12th Jan 2016 13:01
Collision detection is more complicated than just projecting a line and checking what it hits. But the complexity makes it more efficient.
Most engines will build an Octree. The first check will be which parts of the octree the ray has passed through. Then, checks will only be made against the objects that also reside within those parts. Depending on the complexity of the geomertry, the engine may make multiple passes through the tree, becoming more precise with each pass.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 12th Jan 2016 13:30
Quote: "could you give me a more exact place you find that information?"

at this wordpress url me just look at the word GPU.
i think the best source for information is the source code at github itself.
but me not know if this the version is that agk2 using.
AGK (Steam) V2.0.16 : Windows 10 Pro 64 Bit : AMD (15.30.1025) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Raizzan
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location:
Posted: 12th Jan 2016 13:53
sooo:
is agk2 using bulletphysics?

is it possible to raycast only through GPU?
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 12th Jan 2016 17:21
We use Box2D for 2D physics and Bullet for 3D physics. All our physics calculations are done on the CPU, we don't use the GPU features. GPUs aren't as good at branching code, which makes it more difficult to use them for ray casting through tree structures, so we keep it simple and use the CPU.

Performance will be based on how many polygons the object has that you are casting through, and how many ray casts you do every frame. You can usually do lots of ray casts every frame without any significant impact.

Login to post a reply

Server time is: 2024-11-17 02:45:07
Your offset time is: 2024-11-17 02:45:07