bubble-wrap
bubble-wrap copied to clipboard
Building style can use vertex lighting for better performance
@hjanetzek do you want to submit a PR for your modification of the building style to use vertex lighting? I think that's worth it for the performance improvement, especially on lower end devices.
@nvkelso @sensescape for background, this doesn't have any visual impact on rendering, but can speed things up by moving some calculations from the per-pixel fragment shader to the vertex shader (where they will only be run a handful of times per building).
Sounds good! Before / after images?
@bcamper yes, I'll make a branch for it. Also the 'grid' style used by water can be speed up by 30% here when using vertex instead of fragment lighting. The grid 'color' block must be 'filter' in this case. Plus another 30% when the (to me barely noticeable) grain is disabled.
I think it would be good if one could set the default lighting for styles to override fragment as default lighting.
@hjanetzek I did have a branch awhile ago that let you set a default lighting param in the scene block. I plan to revisit that later. Styles that need fragment lighting for correct rendering would need to make sure they set it explicitly then though. But overall I think it makes sense.
@nvkelso once we have it re-integrated (@hjanetzek dropped it into Slack a few weeks ago), we can look at it for confirmation, but it is pixel-for-pixel identical, just moves the computation around.
@hjanetzek Yes, the grain is barely visible. I'll remove it. But its affecting the overall color, will have to do some color adjustments and then remove it.