How to Change exposure in JavaScript?

Is it possible to create a day and night effect in one scene through user selection?

For example, by adjusting exposure use JavaScript(API).

This is currently not possible. However, if you created two separate scenes with day & night lighting, you could allow the visitor to switch between the scenes using the Open URL extension (a trigger in the night scene would open the day scene and the other way round).

Alternatively, you could have your 3D model duplicated in the same scene and used a Camera Volume with different exposure for the duplicate. If it’s an interior scene you could also make the glass tint darker (effectively making the sun and sky-light less strong). To move between these you would have different views, e.g. Living room - night, Living room - day. You could then change the global value of WALK.TELEPORT_TO_VIEW_MAX_TIME to 0, so that the teleporting from night to day is instantaneous.

Keep in mind that this would increase the number of vertices and triangles by two times. It would also increase the required lightmap size therefore increasing the baking time and possibly decreasing the lightmap’s quality and also decreasing the performance of the scene. In some cases (where the scene isn’t heavy and the devices on which the scene will be viewed will be high-spec) it should work well.