bubble-wrap icon indicating copy to clipboard operation
bubble-wrap copied to clipboard

Building style can use vertex lighting for better performance

Open bcamper opened this issue 9 years ago • 6 comments
trafficstars

@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.

bcamper avatar Feb 26 '16 15:02 bcamper

@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).

bcamper avatar Feb 26 '16 15:02 bcamper

Sounds good! Before / after images?

nvkelso avatar Feb 26 '16 16:02 nvkelso

@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 avatar Feb 26 '16 16:02 hjanetzek

@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.

bcamper avatar Feb 26 '16 16:02 bcamper

@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.

bcamper avatar Feb 26 '16 16:02 bcamper

@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.

sensescape avatar Feb 26 '16 18:02 sensescape