Hi there. I’m trying to get a depth map on top-to-bottom view, as there is only one camera in Cesium, I update the camera to get the depth map and then set it back one frame later. However tileset updated in the frame so it looks really different when I set camera back.
So is it possible to stop tileset update in the frame?
One way to do this is is with the Cesium3DTilesInspector. See this sandcastle. Under “Update”, select “Freeze Frame” to stop the tileset from updating.
Thanks! It works for me.
Hello @Erixen_Cruz, I got some error after loading the whole 3dtiles, some of the tiles loaded again when I set the camera near the 3dtiles, but it works fine when I set the camera far away from the 3dtiles.
It seems like the freeze part is limited by memory as there will be larger memory cost when I’m near.
Would you please create a sandcastle and exact steps for how to re-create the error that you are seeing? This would help us help you better.
Sorry for the late reply. I got an error while setting a quite small maximumMemoryUsage in the sandcastle.
But I’m pretty sure after reading the description of maximumMemoryUsage
. My tileset memory usage loaded exceed maximumMemoryUsage
, and when I set the camera far away they are unloaded even “Freeze Frame” is selected, any solutions to get rid of this except adding maximumMemoryUsage
?
I see in your sandcastle that you have maximumMemoryUsage
set to 1. This means that you are only allowing 1 megabyte of memory to be used on the GPU for caching! This is definitely too small for 99.9% of tilesets. It is very prohibitive. What exactly is your goal? What are you trying to do?
Here is an example of limiting to 100 megabytes, and freezing the frame after 2 seconds of loading as you did in your sandcastle. The difference is that I don’t define the 3D tiles inspector. When you define the inspector, if the checkbox for freeze frame is not checked, then it will set the tileset freeze frame to false. This is despite you setting it to true in the two second timeout. Without the inspector, when you set it directly, it remains frozen as you set it.
Sorry I didn’t make myself clear, this is the new sandcastle.
It says in the document:
If tiles sized more than
maximumMemoryUsage
are needed to meet the desired screen space error, determined byCesium3DTileset#maximumScreenSpaceError
, for the current view, then the memory usage of the tiles loaded will exceedmaximumMemoryUsage
.
I set the maximumMemoryUsage
to 1 just to simulate this situation and I’m pretty sure it is happening in my case, but it will get error when I freeze the tileset in the sandcastle.
In my case, I’ll add a texture to store what scene looks like in the last frame.
Then for the first frame, I’ll freeze the tileset and set the camera to another perspective to get the depth map, and use the texture above for rendering so users will not figure out the perspective changed but one frame delay.
Then for the second frame, I’ll unfreeze the tileset and set the camera to the origin perspective. I imagine it should absolutely look the same with frame 0.
The quesion is some tiles are unloaded in the first frame even if I freeze the tileset, so when I set the camera back to origin perspective, some tiles will start to reload since the second frame, that is not what I want.
I want to know if there is any solutions to get rid of this except make maximumMemoryUsage
larger.