Which influence do I have in SceneView on the behaviour of the Sun Light?

804
5
Jump to solution
07-25-2017 07:18 AM
Jeroenvan_Onzen1
New Contributor II

Hi all,

we are currently developing an application within ArcGis Javascript.

We want to have influence on the behaviour of the sunlight, for the following observations:

1) When turning on the option:

view.environment.lighting.cameraTrackingEnabled 

The North Pole and South Pole are partly in dark. In the following old thread, they were working on a solution; but we found no additional information how to disable sun? 

2) When turning off the option 
view.environment.lighting.cameraTrackingEnabled 

The sun is behaving as expected. However; the dark side of the earth is too dark for us. We see a light source active (as it is not black), so are we able to power up this light source?

Secondly; especially when the user is zoomed in at a location, we would like to enlighten the earth more. 

Which options do I have to use AmbientLight only, or to push up the AmbientLight to get a nicer view?

With regards,

Jeroen van Onzen

PS. The documentation for cameraTrackingEnabled  is missing.

0 Kudos
2 Solutions

Accepted Solutions
Jeroenvan_Onzen1
New Contributor II

Hi Thomas,


                view.environmentManager._updateLightParams = function(d) {
                   //TODO: Create formula to change ambient light depending on zoomlevel and options
                   sunUtils.settings.global.ambient = 0.4;
                    this.__proto__._updateLightParams.call(this, d);
                }

With regards,

Jeroen van Onzen

View solution in original post

by Anonymous User
Not applicable

Happy to announce that you can choose now between sun and virtual light for your scenes.

With JS API 4.23 released last week,  we introduce a new lighting mode called "VirtualLighting". This positions the light source relative to the camera, minimizing the amount of visible shadows. Assign it to SceneView.environment.lighting as an alternative to the existing lighting.

We also updated the documentation about the lighting, including the parameter for cameraTrackingEnabled

Check out more about the virtual lighting and other new features in our release notes for 4.23.

View solution in original post

0 Kudos
5 Replies
ThomasSolow
Occasional Contributor III

There doesn't seem to be a lot of user-facing options for these things.

There are various things you could do to obstruct the scene from shadowing the side of the earth opposite the sun.  For example: JS Bin - Collaborative JavaScript Debugging 

That sample modifies a function on the environment manager so that it doesn't have a reference position for the camera and therefore falls back to generic lighting settings (entire earth is illuminated).  It's not clear to me that's what you're looking for, though.

One option would be to call that code to modify that function under certain circumstances and then revert to the prototype function when you want normal lighting to resume.

It can be "dangerous" to play with this kind of stuff as a bug in your codes results in the view freezing with no error message.

Jeroenvan_Onzen1
New Contributor II

In the specifications for the product, there is a request to have an optional day/night view, so I need to support both views.

I guess my preferred option is to have influence on the ambient light (color/intensity), and bump this up to a higher value, depending on certain conditions (i.e. zoomlevel, and modus).

0 Kudos
ThomasSolow
Occasional Contributor III

One option would just be to adjust the time.  IE: make it night time at the user's position when night is toggled on and make it day time when day is toggled on.

I don't know of a way to influence ambient light.

0 Kudos
Jeroenvan_Onzen1
New Contributor II

Hi Thomas,


                view.environmentManager._updateLightParams = function(d) {
                   //TODO: Create formula to change ambient light depending on zoomlevel and options
                   sunUtils.settings.global.ambient = 0.4;
                    this.__proto__._updateLightParams.call(this, d);
                }

With regards,

Jeroen van Onzen

by Anonymous User
Not applicable

Happy to announce that you can choose now between sun and virtual light for your scenes.

With JS API 4.23 released last week,  we introduce a new lighting mode called "VirtualLighting". This positions the light source relative to the camera, minimizing the amount of visible shadows. Assign it to SceneView.environment.lighting as an alternative to the existing lighting.

We also updated the documentation about the lighting, including the parameter for cameraTrackingEnabled

Check out more about the virtual lighting and other new features in our release notes for 4.23.

0 Kudos