Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3D Extrusion of Buildings #192

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Drabble
Copy link
Collaborator

@Drabble Drabble commented Nov 1, 2022

This is a simple implementation for showcasing 3d possibilities in Maplibre-rs.

We simply take the elements in the buildings layer and extrude them with a fixed height.

In the future, it would be very interesting to add details to the buildings that are extruded and extrude based on the height metadata available in OSM.

Extrusion can be enabled/disabled in the Style configuration.

Finally I probably should split the function in tile_pipelines.rs into smaller functions to make it easier to understand.

@Drabble Drabble added the feature-request Request for a new feature label Nov 1, 2022
@Drabble Drabble self-assigned this Nov 1, 2022
@maxammann maxammann marked this pull request as draft November 1, 2022 11:57
@maxammann
Copy link
Collaborator

Converted to draft, or it this ready for review? :)

@Drabble
Copy link
Collaborator Author

Drabble commented Nov 1, 2022

Converted to draft, or it this ready for review? :)

I think it's not quite ready for production but being an experimental functionality, we could just disable it by default and enable it when we want to.

I guess the main thing left to do is to cleanup the big function with the extrusion to simplify the code and review/discuss about the implementation details.

@maxammann maxammann removed the feature-request Request for a new feature label Nov 1, 2022
@DerKarlos
Copy link

Yes please, 3D buildings! The changes are not that much:
The renderer gets an optional 3D extrude. Therefore some APIs are extended form 2D to 3D.
Style access and normals are needed, why a camera to?
The extrude code is quite plain. Its good to see, how the the faces are build.
I would like to use/test it! How could I merge it into my fork?
I compared it with the 3D renderer OSM2World. We should think about it's concepts.
I could introduce, how it works if you like and we could discus a merge of ideas with maplibre-rs.
https://wiki.openstreetmap.org/wiki/OSM2World
We could create an FRC for 3D object rendering

@maxammann maxammann changed the title Implement 3d extrusion of buildings 3D Extrusion of Buildings Dec 13, 2022
@maxammann
Copy link
Collaborator

I'll resolve merge conflicts now!

# Conflicts:
#	maplibre/src/headless.rs
#	maplibre/src/render/stages/upload_stage.rs
#	maplibre/src/stages/request_stage.rs
@@ -99,13 +99,13 @@ impl Shader for TileShader {
// position
wgpu::VertexAttribute {
offset: 0,
format: wgpu::VertexFormat::Float32x2,
format: wgpu::VertexFormat::Float32x3,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we should upgrade from 2D to 3D for everything.
This will increase the required bandwidth to the GPU.

But I'm not sure how much the impact is performance wise.

@maxammann
Copy link
Collaborator

@Drabble Hi! Are you still interested in pushing this forward? :) I guess a lot changed, but I think it would be nice to keep this effort updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants