When to use scene background without environment, and vice versa?

I’m a newb in this area. When would someone want to define an equirectangular scene.background but not scene.environment? And when would they do the opposite (environment, but no background)?

Trying to understand the practical use cases.

As far as I understand, scene.background is meant to be used when you need a visible texture background, thus avoiding the need to create and wrap a big sphere geo with it just to be able to see it. On the other hand, scene.environment is reserved for shaders that actually would use some kind of reflection (like pbr materials), and having it a scene level is more efficient if most (or all) your materials use the very same texture.

So for instance, npr and toon/cell shading in general would be a scenario in which you want a background but not necessarily shaders to reflect it, as long as materials in this case generally are flat (i.e. not phong).

The oppossite is kind of rare I guess, but I saw once a slideshow of the Portal game dev that showed something like that: a case where there was the need to use pbr materials (and so to reflect the environment), but in a way that needed to not render that texture as a background (cause objects beyond ‘portals’ are in a different scene).

For sure there are others cases that make more sense, but that is my two cents from direct experience.

1 Like

Scene background - literally the image you see in the background.
Scene environment - the image reflected in compatible materials (ex. MeshStandardMaterial with low roughness.)

When would someone want to define an equirectangular scene.background but not scene.environment ?

Ex. when you want real-time reflections. Reflections then consist of background and scene objects (for example here.)

And when would they do the opposite (environment, but no background)?

Ex. when you’re building a branded model viewer, in which you’d still want to display a model with “studio-like” reflections (without any reflections materials look odd), but don’t want any fancy background.

2 Likes

Thanks guys, those are good summaries!