Pannellum: Custom background colour?

Created on 2 Jul 2016  路  3Comments  路  Source: mpetroff/pannellum

I can't find a way to change the background colour when the panorama doesn't reach all the way to the top or the bottom. Is there a way to do this easily? From what I can tell it's part of the WebGL, but I'm not sure where it would need to be changed.

question

Most helpful comment

I just looked at this again and decided it wasn't actually difficult to add and added the feature in 715866b67dc1060d18197054e6f034feba470b53. The background color can now be set using the backgroundColor parameter, e.g. adding "backgroundColor": [1, 1, 1] to a JSON configuration will set the background color to white.

All 3 comments

This is set in the equirectangular fragment shader. For example, changing 'gl_FragColor = vec4(0, 0, 0, 1.0);', to 'gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);', would change the background color to white.

Being in the shader, it's not all that easy to make it a configurable parameter. Unless there's a fair amount of demand, I don't plan on doing so.

Thanks for pointing me in the right direction.

I just looked at this again and decided it wasn't actually difficult to add and added the feature in 715866b67dc1060d18197054e6f034feba470b53. The background color can now be set using the backgroundColor parameter, e.g. adding "backgroundColor": [1, 1, 1] to a JSON configuration will set the background color to white.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fuzzybabybunny picture fuzzybabybunny  路  7Comments

clarknelson picture clarknelson  路  5Comments

ai-tushar picture ai-tushar  路  9Comments

dmstern picture dmstern  路  3Comments

shtrudelsupport picture shtrudelsupport  路  3Comments