Intel bringing SIMD to Javascript

Discussion and feedback on Construct 2

Post » Sun Mar 30, 2014 12:17 pm

Sounds like its using Mozilla’s Emscripten compiler, so you write the code in C++, for example, and compile to the SIMD javascript.

Perhaps there might be critical sections (which slow down games) of the engine code which can to re-written in C++ and compiled as javascript, and used everywhere.
B
12
S
3
G
4
Posts: 57
Reputation: 3,186

Post » Sun Mar 30, 2014 1:32 pm

This is an interesting feature but is unlikely to produce significant performance improvements in a game engine like C2's. SIMD works best with basic arithmetic over very large datasets, such as changing the gain of a large audio buffer. This type of use case does not really crop up often in a game engine. Browsers probably already use SIMD in their native code to speed up things like audio processing and image decoding, so it's already been used in browsers for some time. Construct Classic only ever used it to speed up pixel-perfect collision tests, but then I still think polys are faster and a better choice anyway, so I'd still prefer not to add that to C2.
Scirra Founder
B
397
S
236
G
88
Posts: 24,421
Reputation: 194,551

Post » Sun Mar 30, 2014 2:44 pm

@TiAm I'm in a similar boat as you. I don't fully understand how all the pieces fit, but it's not for lack of trying! I'm always reading up on these forums and industry news, trying to connect the dots.

@Ashley Thanks for the explanation. It's exactly what helps me see which dots connect and which don't :)
ImageImageImage
B
38
S
5
G
4
Posts: 79
Reputation: 5,355

Post » Mon Mar 31, 2014 8:00 am

@Ashley : You are right, but I can see SIMD-speedup as a possibility to emulate image effects where WebGL isn't available, for example. It's true that it's not a game-critical area but I suppose some crafted plugins can do some nice tricks with it ;).
B
33
S
9
G
6
Posts: 708
Reputation: 6,704

Post » Mon Mar 31, 2014 8:24 am

@Ashley I thought SIMD would really help graphics related tasks, especially 3D rendering where its highly repetitive data, but surely it could be applied for 2d or even the particle system in C2? I think @Pode has a great point as WebGL currently is terribly slow and I would therefore label it broken for mobiles.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614

Post » Mon Mar 31, 2014 12:48 pm

@Pode @Silverforce - rendering work on a CPU is usually so slow as to be not worth the bother at all, even with SIMD. GPUs do that way better, and already do in WebGL mode! Also, what makes you think WebGL mode is slow? It benchmarks upwards of twice as fast as canvas2d in most cases.
Scirra Founder
B
397
S
236
G
88
Posts: 24,421
Reputation: 194,551

Post » Mon Mar 31, 2014 1:45 pm

@Ashley : I was thinking more about effects like altering colors or things like that.
B
33
S
9
G
6
Posts: 708
Reputation: 6,704

Post » Mon Mar 31, 2014 2:06 pm

@Pode: I don't see how that changes it. We wouldn't implement 'Tint' in software, because then you end up with a tricky memory management problem with all the cached copies of the tinted sprite, and fading the tint (changing it every tick) would still be prohibitively slow. Best to leave rendering features to the GPU.
Scirra Founder
B
397
S
236
G
88
Posts: 24,421
Reputation: 194,551

Post » Mon Mar 31, 2014 5:59 pm

@Pode - color filters would be the best way to do color shifts as they are way, way faster than the tint effect (CC had them if you want to see how fast they are - I found no speed difference at all between using them or not), and are done on the gpu. I'm still hoping they get implemented as they're one of my most wanted features.
Moderator
B
95
S
34
G
33
Posts: 3,006
Reputation: 27,874

Post » Mon Mar 31, 2014 9:49 pm

Ashley wrote:@Silverforce - rendering work on a CPU is usually so slow as to be not worth the bother at all, even with SIMD. GPUs do that way better, and already do in WebGL mode! Also, what makes you think WebGL mode is slow? It benchmarks upwards of twice as fast as canvas2d in most cases.


I am referring to WebGL effects, its utterly broken on mobiles as the performance hit is usually massive to a point of crippling performance on the latest hardware. So there is room for improvement right there.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 10 guests