-
Notifications
You must be signed in to change notification settings - Fork 4
SIMD Vs Non ‐SIMD Demos
I would recommend reading What is SIMD / NEON, as the DEMO here will greatly help you understand how all this SIMD/NEON stuff works, before reading the below, of course if you have already read it then just ignore this message.
There are two demos you can download and compare the speed and power of SIMD. These are Shadow Casting application.
The first demo is ShadowCast2D, you can download the demo here. This Shadow Caster was created by OneLoneCoder, a long time ago, and it is an amazing shadow caster application, beautifully written to be honest. You can watch the video here
The second demo is ShadowCast2D_SIMD, you can download the demo here. This is the exact same project as ShadowCast2D except the draw routines have been replaced with SIMD methods.
The below images compare the differences in frame rate. As stated int What is SIMD / NEON section “Frame Rate should not be used as an indication of how fast your game is running…”
But for our comparison we are going to use it anyway 🤦♂️
ShadowCast2D Debug (14 Fps):
ShadowCast2D_SIMD Debug (38 Fps):
ShadowCast2D Release (123 Fps)
ShadowCast2D_SIMD Release (193 Fps)
In the above comparisons we see a mark increase in performance when the SIMD methods are been executed. So, what did we change?
Only a few methods were updated in the ShadowCast2D_SIMD for this to work, and yes it was a simple change.
In the ShadowCast2D_SIMD.cpp file we changed:
DrawSprite(fSourceX - 255, fSourceY - 255, sprLightCast);
// To:
DrawSprite_SIMD(fSourceX - 255, fSourceY - 255, sprLightCast);
FillTriangle (…);
// To:
FillTriangle_SIMD(…);
FillRect(…);
// To:
FillRect_SIMD(…);
FillCircle(…);
// To:
FillCircle_SIMD(…);
- For Visual Studio All In One Android and iOS (Windows) Project Template: OLC Pixel Game Engine Mobile 2.2.8 Visual Studio for Android and iOS
- For Visual Studio Android Only (Windows) Use this project: OLC Pixel Game Engine Mobile 2.2.8 for Android Visual Studio
- For Android Studio (Windows/Linux/MAC) Use this project: OLC Pixel Game Engine Mobile 2.2.8 for Android Studio
- For Xcode (MAC) Use this project: OLC Pixel Game Engine Mobile 2.2.8 for Xcode