CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
13.03k stars 3.51k forks source link

Multiple light sources and light types #8518

Open lilleyse opened 4 years ago

lilleyse commented 4 years ago

Custom light sources were added in https://github.com/AnalyticalGraphicsInc/cesium/pull/8493 but there are still some limitations: only one light is supported and it must be a directional light.

It would awesome to have a scene with sun lighting, moon lighting, street lamps, and car headlights all working together. This could really open up new rendering possibilities for Cesium.

I see these being the main API changes:

Some questions:

emackey commented 4 years ago

For reference, STK supports:

Spot and Positional each have a position that can be specified in any of STK's various coordinate frames, allowing for example headlights on a vehicle to ride along with it, etc. These also offer constant, linear, and quadratic falloff.

Spot and Directional can be aimed from one frame to another (for example Sun to Earth, or one moving vehicle to another like a helicopter search light tracking a car).

For glTF 2.0 models, it's worth considering IBL as an additional form of lighting.

weiyinggh commented 3 years ago

Please ask when multi light source can support, thank you

hugcoday commented 2 years ago

Babylon JS

ThreeJS

Above the light can be supported ?

ggetz commented 1 year ago

Requested on the forum: https://community.cesium.com/t/point-light-sources/21306/2

ggetz commented 1 year ago

Point light sources requested in https://github.com/CesiumGS/cesium/issues/11431.

nuclearsecrecy commented 12 months ago

I just wanted to put in another +1 for this — if Cesium allowed for the rendering of actual light sources, it would DRAMATICALLY increase its usability for a million different applications. Being limited to essentially a single light source is very limiting. Obviously this is non-trivially difficult to implement. But it would be HUGE if it could be. HUGE! :-)

emackey commented 12 months ago

My $0.02: From the PBR 3D model point of view, having robust support for HDRI / IBL environment lighting can dramatically improve the look of models, to the point where all the various ThreeJS/BabylonJS/STK light source types described above are actually discouraged as they interfere and/or compete with natural IBL lighting.

It might be interesting to light an entire set of 3D Tiles from an IBL, and see if that yields better results than the default or a point light someplace.

nuclearsecrecy commented 12 months ago

I imagine it depends on what one is trying to do with it, yes? I am interested in being able to bring 3D models into a Cesium JS environment, and am not worried so much about the appearance of 3D Tiles. Being able to model multiple light sources, and/or having a real emission property for objects, is absolutely necessary if one wants flexibility for modeling anything other than a building. I'm interested in being able to render non-Sun lights, night scenes, better clouds, fog, smoke, glowing things, etc. Some of these things require more than multiple point or directional light sources to work well, of course, but you can fake a lot of them if you had them (and it's hard to fake them without them).

JensonMiao commented 10 months ago

I really hope to see multiple light sources in Cesium, it would make the virtual earth scenes more realistic. I hope you can consider this suggestion, thank you!

nghiajenius-dev commented 7 months ago

Hi @lilleyse, @ggetz, I see there is an example of multiple shadows in Cesium, but when I tried it, only the first shadowmap in the list is rendered in the view scene. Do you have any idea why or how can I add multiple shadowmaps in the scene? Thanks alot!

syzdev commented 5 months ago

@nghiajenius-dev In that example, only multiple shadow maps were created, but only one shadow map can take effect, and it is currently not possible to add multiple shadow maps to the scene.

mattwintercorn commented 1 month ago

Another ping here for supporting this. This would be incredibly useful!