sceneform-android-sdk icon indicating copy to clipboard operation
sceneform-android-sdk copied to clipboard

Setting environment lighting

Open itanbp opened this issue 6 years ago • 11 comments

Hi, Is it possible to define a uniform environment lighting? When adding a ModelRenderable to the scene graph, one side of the model is darker than the other, according to the Sun position. I don't want to show shadows at all, so I'm looking for a uniform lighting. I tried the following, but it just made the scene darker:

arFragment.getArSceneView().getScene().getSunlight().setEnabled(false);

Thanks!

itanbp avatar Jul 30 '18 15:07 itanbp

The sun light is not the only light enabled by default. Sceneform adds an environment light based on an image (IBL/image-based lighting). This environment light cannot be customized currently, hopefully in a future version.

Do you want a uniform environment light or simply to turn off lighting for your object? If the latter you should simply used an unlit material.

romainguy avatar Jul 30 '18 21:07 romainguy

@romainguy can you please explain the difference between "uniform environment light" to "turn off lighting for your object"?

itanbp avatar Jul 30 '18 21:07 itanbp

@itanbp With a uniform environment we will compute per-pixel lighting on your object, it's just that it will look the same from all angles at a rather large cost. The appearance of the object will depend on the color of the light, its intensity, etc. With an unlit material, we won't perform any lighting computations at all. Your object will also look the same from all angles, but it will be very, very cheap.

Do you have more information about what you're trying to accomplish? Models or screenshots would be helpful to find a solution to your problem.

Thanks!

romainguy avatar Jul 30 '18 21:07 romainguy

@romainguy look how at the first image the sphere looks white, while in the second more off-white. This are the opposites angles of the same sphere.

white

off-white

itanbp avatar Aug 02 '18 07:08 itanbp

Yes that's because of the default environment light.

romainguy avatar Aug 02 '18 17:08 romainguy

So @romainguy , is there a way to disable, or customize the environment lighting ? I'm trying to create a dark room lit with just a few candles. I'm using point-lights to do so but the default environment makes the whole thing off.

xgouchet avatar Sep 20 '18 16:09 xgouchet

The public API is still unavailable unfortunately. @dsternfeld7 might be able to talk more about this.

romainguy avatar Sep 20 '18 16:09 romainguy

Another use case is using SceneView for non-AR purposes - when using SceneView, it should be possible to disable the IBL completely.

damianw avatar Nov 05 '18 23:11 damianw

The sun light is not the only light enabled by default. Sceneform adds an environment light based on an image (IBL/image-based lighting). This environment light cannot be customized currently, hopefully in a future version.

Do you want a uniform environment light or simply to turn off lighting for your object? If the latter you should simply used an unlit material.

any progress on this? how to change sun's position? a want to put the sun just right above some node, because shadows produced by my nodes do not look realistic very often

ivstka95 avatar Jun 24 '19 13:06 ivstka95

Second this....need to use sceneform for non AR...just as a 3D environment and the IBL needs to be disabled 😔

kenyee avatar Aug 21 '19 02:08 kenyee

Any news about this one? I'm trying to display signs (Cubes constructed by the SHapeFactory) the user supposed to read, and the lightning in some cases completely washes away the colors and the sign becomes almost unreadable (white).

MrCsabaToth avatar May 13 '20 22:05 MrCsabaToth