OpenStreetMap 🗺 3D renderer with three-d #106
Replies: 14 comments 31 replies
-
Hi @DerKarlos. Sounds like a really interesting project 👍 I will be happy to help if you have questions or experience problems with |
Beta Was this translation helpful? Give feedback.
-
Could you give me an hint how to activate transparency / alpha? And SVG needs to be converted to bitmap first. |
Beta Was this translation helpful? Give feedback.
-
Most things are running well now. But for SVG I have a question:
I found your image_from_bytes but could not se, how to use it. |
Beta Was this translation helpful? Give feedback.
-
I don't test in wasm yet, only binary. And there are no messages or errors. |
Beta Was this translation helpful? Give feedback.
-
Hey @ASYN, by asking and requesting and issuing, I certainly disturb you working on other parts of three-d. You know, OpenStreetMap is a big thing but only voluntary, not by money. And me to: just a hobby. If my requests are just to much for you, do you know similar projects / cradles, also enabeling Rust and 3D by WebGL? |
Beta Was this translation helpful? Give feedback.
-
Yes, texture_2d works, thank you! I first use Loader::load for all textures and afterwards Texture2D::new and both takes time: I used cpu_material to set the texture AND the color. ("multiplication") |
Beta Was this translation helpful? Give feedback.
-
How / Is it possible to load a texture (or other files) while the render cycle is running? |
Beta Was this translation helpful? Give feedback.
-
I will try it. RC is cheating the ownership of Rust ;-) Meanwhile I added (many) instances in my project. There is no Z-Order inside of the Wood-Mesh :-( https://osmgo.org/wasm/zorder.png And most times, you can run my test there: http://osmgo.org/o2t/index.html |
Beta Was this translation helpful? Give feedback.
-
I just made a speed test with --release and the CPU =texture=> CPU war really fast :-) |
Beta Was this translation helpful? Give feedback.
-
Before, by adding my ExtrutionGeometries, a lot more details got visible, like railway beams or bus stops and wast baskeds. Now some cars are visible. A OBJ/MTL model is loaded, multiplied 5 times and the carrosserie color is changed. Many instances of each color may get visible, if the OSM data contain parking grounds. The Order of the Meshes and the Materials were not sorted according to the names. I edited my MTL as workaround. The model includes 8 Meshes. There is no way in three-d to handle they as one 3D object. I (Rust beginner) could not manage to clone the CPU_Material to set different albedos, so I instanced Material mutiple times. From the example I used the pipeline without really knowing what that means. And I was happy as it also works with InstancedMeshes. It was brain twisting to get my code in a "class". I would like to talk about it with you some day. All this was done in my car example. But as I merged it into the main code, there were differences in the three-d API! |
Beta Was this translation helpful? Give feedback.
-
Your GitHub uploads are ok; I like to get new functions like the albedo color-texture mix, even as I have to adapt my code quiet much. This time, the camera pan control was gone. Now I use the FlyControl and will make my own later. My code, to Tc textures did not work any more. I had a view in your code: Material creates Texture2D itselves and there seems to be a texture cache in three-d. One more thing: My OSM file is large and I often get timeout. Maybe reqwest::Url Options could be accesable to extend the time? (Is it ok this way or should I write more Issues?) |
Beta Was this translation helpful? Give feedback.
-
Some of my URI start like "data:image/png;base64,iVBORw0KGg... #[cfg(feature = "image-io")]
} Or is there a way to add the bytes to the "loaded"? |
Beta Was this translation helpful? Give feedback.
-
Most of you will know www.openstreetmap.org already. I do a lot of rendering the OSM data in 3D.
First I used ThreeJS for a plain viewer:
Next I used BabylonJS for a more realistic web front-end:
But as I like WebAssembly (more theoretically) I intend to use three-d now. Most functions I need seem to be there. Otherwise I will ask. The three-d API looks quite familiar:
🔘 User defined meshes
🔘 PBRMaterial = pong material
🔘 Water and Woods I already could see in the example "Spider game" (I can't find the sources)
🔘 Camera controls are customising, I assume.
There will be questions! The tools are always a challenge to me.
I wouldn't mind if one of you would join my project, for test or "consulting" me as a newbie.
If you are interested, I will describe the project structure and components, the intended functions and solutions in all details.
And you will get me as a tester for three-d
More about me: 👴 🇩🇪 Professional test engineer, now retired.
I use 🍎 "macOS-Linux" and Atom as IDE.
About Rust I only read some documents and made some tutorials. That will be an adventure to me.
www.twitter.org/osm__go
https://wiki.openstreetmap.org/wiki/User:-karlos- (a bit outdated)
++++++
Project overview:
There is a server doing the first steps: Get the OSM data Planet file (or Countries),
split it in 3x3 km tiles, create 3D objects (buildings, areas, ...) into a PBF file.
The frontend, using three-d, will request this tiles, decode them and create meshes.
It is like a infinite game level. The user may move or fly around on the virtual Earth,
new areas/tiles with real OSM data get visible inside a sky dome or out of the fog.
Project details:
The PBF file contains a material list with references to PBRMaterial textures.
There is a texture- and a materials-cash. Each PBF file brings its own list of materials.
The 3D objects are either triangle geometries or shape extrudes or instances of models.
There are also car models (obj) and rotating parts (windmills); may be trains to.
The 3x3 km PBF tile is split in 400x400 m tiles and different LoD layers.
Each layer as one mesh with Material groups is loaded into the GPU.
The tiles in the view focus will be loaded first, threes after the buildings.
The loading of additional tiles must not disturb the render cycle!
do be refined ...
Beta Was this translation helpful? Give feedback.
All reactions