I have a geojson fiels which I’m converting to 3d tiles of .b3dm tiles.
I have also .bil file which is raster file consiting ran/rf data (rsrp) at some pixel size of say 5m or 10m of a large area of say city or country.
I have those .bil file at different heights of say 1m, 3m, 5m, 6m, 9m till 90m or 120m etc.
I am embedding these pixels values inside the vertices of the buidings mesh by making a voxel of those .bil file data and storing it into .npy extension. I have stored those values in R-bank of RGB by normalizing it.
We store the .bil values into .npy tiles in 4 simple steps:
Read the .bil files: Each .bil file represents one antenna height (e.g., 1.5m.bil). We read its raster values using Rasterio, converting it into an in-memory GeoTIFF.
Normalize the values: We find the minimum and maximum RSRP values across all layers and convert each pixel value into a uint16 number between 1 and 65535. NoData values are stored as 0.
Stack the layers into a 3D volume: Each raster becomes one layer in the volume, stored in a memory-mapped file.
rf_volume[:, :, layer_idx] = layer_u16
The volume shape is (rows, columns, heights). Each pixel location contains values for all antenna heights.
Split the volume into tiles: We slice the 3D volume into smaller chunks of TILE_SIZE × TILE_SIZE × number_of_heights and save each chunk as a .npy file.
In short: .bil files → normalize pixel values → stack into a 3D volume → split into .npy tiles.
Important: The .npy files store the normalized uint16 values, not the original RSRP values.
A stored value of 0 represents NoData.
and finally getting the .b3dm tiles due to which I have to re-build those b3dm tiles if the .bil files changes.
I want to keep these two seperated so that I don’t have to re-build the b3dm tiles again if the .bil file changes. And to apply legend I am using Cesium’s customShader to apply coloring on the buildings.
I hope you understand the probelm, I know the solution is just simply not embed the rsrp into vertices but how then I will show the values on the buildings ? I even tried the atlas method but it’s very heavy on computation since I don’t have a GPU.
I think the main issue is that you’re treating the RSRP values as part of the building geometry, even though they change independently.
Would it make sense to keep the building tiles static and move the RF data into a separate set of textures? Your shader could then sample the appropriate RF tile using the building’s geographic position and height, instead of reading a value baked into each vertex.
The tricky part would be keeping the RF tiles aligned with the building geometry, especially across tile boundaries and between height layers. You’d also need to manage which RF textures are loaded as the camera moves.
But if that works, updating the coverage data wouldn’t require rebuilding thousands of .b3dm files. You’d only replace the affected RF tiles.
I’d probably test this with one small area and two height layers first. That should help establish whether shader sampling and texture management are cheaper than your current rebuild process.
This seems to be a follow-up from Minimize 3dtiles (b3dm) tile formation . It looks like a broader engineering and development question, in hope for a “solution”. There are some very specific aspects that are mentioned in the question, about BIL files and NPY files (and I had to look up what these are, and this probably won’t help answering the question without context), and about some uint16 storage (of which it is not clear how it is relevant for the broader task), and some aspects are not mentioned (like why you are using B3DM and not directly glTF).
But beyond that, there are too many unknowns in the creation process and goals (for me) to provide actual, goal-directed hints.
So only veeery broadly:
It sounds like you have some ~“data sources” that provide data that may change(!). And it sounds like you have some “geometry” data that - for itself - does not change. And it sounds like you’re trying to bring this “changing data” and the “constant data” together in the rendering process.
If this is roughly correct, then there may be some options to achieve that. One approach could be that Mrlaura suggested: You could store the changing data in a texture, and then just swap out the texture file. A glTF can refer to an external PNG file, for example, and when you change that PNG file, it will change the appearance of the object. Other options could be built on top of ‘Custom Shaders’, maybe also relying on some external texture access.
Thanks for considering my question. I also think the same as you told that I shouldn’t embed those rsrp values into the building geometry (vertices). I tried this method where I was using the concept of atlas (it’s a 2D image consisting of sets of image in that of a particular region and all heights I have (3m, 6m, 9m, etc)). So like this I have multiple atlas region. I used the atlas data and apply on buildings for coloring like this below:
How it works
Load atlas PNGs containing encoded RF signal data.
Map each building fragment to its RF grid cell using baked vertex grid coordinates (rf_grid).
Sample the PNG atlas to retrieve signal strength and validity data.
Convert the signal value (dBm) into a color using the RSRP legend.
Apply the color to the 3D building using Cesium’s CustomShader.
This approach did work and I get my expected result as well. However I find that after this my system start lagging and the application performance also degraded compared to my current approach (embedded rsrp in vertices).
That’s why I came here looking for any alternative existing solutions or any way to fasten my atlas method.
It’s kinda is,
And I am sorry if I wasn’t able to make you understand my question.
A bil file is a raster file which stores rsrp values at each bin (that bin can be of 5m or 10m or even 1m). These bins contains rsrp values which usually ranges from -40dbm to -140dbm (ranges vary).
A .bil file is nothing but a matrix or a gird of say (1000 x 500) shape.
Here each cell (0,0) or any cell can be of 5m or 10m. I hope up till now it is clear what bil files are what value does it contains.
Now this matrix I have is of different height above Ground level that is at 3m, 6m, 9m.
Talking about those .npy files extension that acts as my voxel where I have stored the 2D-raster (.bil files) as a stack and made them as a 3D. (You can relate it will putting a stack of sheets at a place makes them 3D).
Now I have normalized this rsrp values to uint16 (16 bits) storage so that they take less storage. Then using the below logic storing them into the building vertices.
How does the RGB band come?
RSRP value: The signal strength is sampled from the voxel data in dBm (e.g., −100 dBm).
Normalize it: Convert the RSRP into a range from 0 to 1:
Convert to color: In rsrp_to_vertex_color_batch(), the code sets:
R (Red) = t * 255
G (Green) = 0
B (Blue) = 0
A (Alpha) = 255 (fully opaque)
4. Store it: m.visual.vertex_colors = colors stores these RGBA values in the 3D mesh, which is then exported to GLB/B3DM.
That’s how the flow is.
On the suggestion of Mrlaura I tried to implement using the atlas concept I have explained here
I Know I have to stop embedding the rsrp values into the vertices and I can but then how to apply those rsrp on the buildings to show the values on data is a question for me.
Thanks once again for taking out time for me and helping me for my problem.
It might help if you could provide some example data that you are currently rendering (in a ZIP file), and the associated sandcastle. (But depending on the exact structure, it may be necessary to reverse engineer some aspects that are not clear, and it’s hard to say how much time that would take).