Implementing shadows for GLTF models

Hi,

I am relatively new to Cesium and also to 3D rendering so I know that it will be a hard task, but I would like to add the capability of displaying shadows for buildings that are loaded from .gltf files to Cesium. I know the basics of shadow rendering (shadow mapping as well as shadow volumes), but I have no idea where and how to start off on the Cesium side. Can you give me any lead on this?

Best regards,

Donato Marro

Hi Donato,

Thanks for the kind offer.We are actively working on shadows in the shadows branch. For progress updates, keep an eye on pull requests into that branch and the roadmap, #2594.

Unless you know the internals of the Cesium renderer well and all the corner cases for shadow artifacts, this is a hard area to contribute to. You are welcome to, of course, but it might even be more impactful if you wanted to contribute in other ways to help balance the maintenance work with new feature development.

Patrick

Hi Patrick,

thanks for your answer. It wasn’t my primary intention to contribute to the project, since it would require a deep understanding of Cesium as you pointed out. I will start working on my diploma thesis soon, which will deal with the implementation of shadows for city models using the Cesium framework. Therefore my goal would just be a running demo szenario including shadow casting buildings (at best using shadow volumes).

How does the shadows branch relate to the depth-map branch? I read that the depth-map branch contains work on shadows, too.

Would you suggest the Cesium blog as a good entry point for understanding the internals of the Cesium renderer? Or is there some other good source of information / documentation aside from the tutorials?

Best regards,

Donato

HI Donato,

The depth-map branch is early work; the shadows branch is current.

To learn about Cesium’s renderer, see:

When will you finish your thesis? Perhaps we can showcase on the Cesium website like these?

Thanks,

Patrick

Hi Patrick,

I hope I will have finished my thesis by the end of the summer. But I don’t know yet if the demo will be publicly available.

May I ask one more question in this thread? I had a look at the demos at http://www.cesiumjs.org/NewYork and http://cybercity3d.s3-website-us-east-1.amazonaws.com/?city=Miami and I noticed that the lightning of the buildings is dependent on the sun’s position. Is there a simple switch to activate this sun dependent lightning? My buildings are always lightened by a light source that seems to be positioned at the camera’s position regardless of the orientation of the globe.

Bes regards,

Donato

Hi Donato,

For lighting, as of now, you’ll want to generate different shaders for glTF models embedded in the tileset.

Let us know if your work becomes public.

Patrick

Hi Donato,

Please do let us know when your thesis is finished and whether it’s something we can showcase on our website. I post Cesium’s showcases, and if you can demo your project, I’d love to work with you on getting it up. When things are ready, you can email me directly: schow@agi.com

Thanks and good luck,

Sarah