Box2D raycast stress-test 10000 rays

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
788 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Oct 17, 2011

(Try 720p) Just a little test to check the speed of Box2D raycasting in a complex scene. The second part of the video shows 10,000 rays, which is so many that drawing a single pixel width line for all of them appears as a solid block of color. The maximum time for a raycast during the test can be seen in the top left: 0.004ms (average time is 0.0029ms).

Measurements taken on Core 2 Duo 3GHz.

Source code available here: http://www.iforce2d.net/b2djson/

Category:

Entertainment

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (iforce2d)

  • Its too fast, so its possible to make pretty nice lightning model or such stuff! =D

  • @Pr0glik well... depends what you are making. With 10,000 rays as in the video it's running at about 30fps, doing nothing else, so if you had other game code running I don't think it would be fast enough. But if you were to draw the rays thicker you could use less, I think even a few hundred would be plenty.

see all

All Comments (5)

Sign In or Sign Up now to post a comment!
  • You could only raycast the vertices of each polygon within range of the light.

  • @iforce2d yeah, about 20 rays per light would be enough.

  • this is really cool!

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more