grapereader / GameNamePending

An awesome new Roguelike written in Javascript.
https://www.viaware.ca/gnp
3 stars 0 forks source link

Lighting performance in firefox #6

Open grapereader opened 9 years ago

grapereader commented 9 years ago

Lighting performance is abysmal in Firefox (10-15 FPS), but perfectly fine in Chrome (50-60 FPS).

Weird shit.

grapereader commented 9 years ago

Doing some profiling. It looks like the current configuration creates a TON of shaders. That might be part of the cause. Firefox doesn't have shader caching, so it's compiling these shaders every time it creates one. Very bad.

Solution. Render everything to two RenderTextures. One with the diffuse, and another with the normals. Then we put the filter on the diffuse render texture and render it to the canvas. Should reduce all those shaders to 1.

grapereader commented 9 years ago

This does work, and it reduces the shaders to 1.

However, this is actually at a detriment to performance. So scrap that idea.

grapereader commented 9 years ago

Looks like it might have something to do with my system configuration.

Tested on another computer with good performance.

grapereader commented 9 years ago

Tested it on my own computer with a spoofed system configuration and performance was much better.

Obviously due to this: https://wiki.mozilla.org/Blocklisting/Blocked_Graphics_Drivers

Nothing I can due but try to make lighting more efficient, or make a lighting fallback that isn't so OpenGL intensive.