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

Option --shaderscolumn deprecated #173

Closed
bertt opened this issue Jun 20, 2024 · 14 comments
Closed

Option --shaderscolumn deprecated #173

bertt opened this issue Jun 20, 2024 · 14 comments

Comments

@bertt
Copy link
Member

bertt commented Jun 20, 2024

Notice: Option --shaderscolumn is deprecated and will be removed in a upcoming release (breaking change)

With option shaderscolumn it's possible to define the shader per triangle in the database, using a predefined JSON format.
See https://github.com/Geodan/pg2b3dm/blob/master/styling.md

Although a very powerful mechanism, reasons for deprecation are:

  • function is not used much;

  • function is complex and slows down new developments;

  • function does not work when triangulation is performed by pg2b3dm (for example with lines or non triangulated geometries)

Alternative options are:

@bertt
Copy link
Member Author

bertt commented Jun 20, 2024

PR see #172

@mittermichal
Copy link
Contributor

hello do I understand correctly that this PR will break usage of tesselate_building that sets shaders column?
so it is planned that tesselate_building with pg2b3dm will create buildings with uniform color?

my use case can't use client-style styling because the output is intended for Cesium for Unreal which doesn't support that yet CesiumGS/cesium-unreal#1392

@bertt
Copy link
Member Author

bertt commented Jul 22, 2024

yeah it's a breaking change with result uniform styled geometries, good to you know you are using this feature. This change might need some reconsideration.
Are you using different styling for building roofs and walls?

@mittermichal
Copy link
Contributor

I don't have any particular data, but I was told by superior that its wanted feature and I already made REST API that wraps this conversion that can color features by attribute mapping, attribute intervals and interval to color interpolation, and configuration can be different for roof, wall and floor. I will ask them to participate in this conversation.

I think it would be better if it was possible to style it on client side, but it's just not supported in cesium for unreal.

@bertt
Copy link
Member Author

bertt commented Jul 22, 2024

As alternative I’m thinking to have 1 style per geometry (so not 1 style per triangle) that would reduce complexity and work in all cases

@mittermichal
Copy link
Contributor

what is geometry in this context? a polygon?

@bertt
Copy link
Member Author

bertt commented Jul 22, 2024

yes one of the input geometry types LineStrings/Polygon/MultiPolygon/PolyhedralSurface/TIN

Input table in this case will look like:

Geometry Shader
polygon1 {'PbrMetallicRoughness': {'BaseColor': ['#008000']}}
polygon2 {'PbrMetallicRoughness': {'BaseColor': ['#00FFFF']}}

Will this work for you?

@mittermichal
Copy link
Contributor

yes, thank you

@ivopisarovic
Copy link

@bertt Yes, I agree with @mittermichal. Coloring each polygon differently would be very beneficial for us.
Anyway, does the deprecation of shaderscolumn mean you plan to deprecate tesselate_building in the future?

Thanks for your awesome libraries! ❤️

@bertt
Copy link
Member Author

bertt commented Jul 29, 2024

@ivopisarovic I'm thinking if the above solution is in place (with 1 style per geometry) to rewrite the tesselate_building tool a bit, so for each building there will be 3 geometries in the table (for roof, walls, floor) with an extra attribute for the type. The style can then be set in the style column.
Would that work for you?

Note it will take some time to implement these changes so for now the current solution will still work.

@ivopisarovic
Copy link

@bertt Sure, it would be awesome! :) No problem it will take time. We can help with testing later if you need.

@bertt
Copy link
Member Author

bertt commented Aug 6, 2024

I've found another non breaking solution:

For geometry collection types like MultiLine, MultiPolygon and PolyHedralSurface there is a new possibility to have a shader per inner geometry.

For example consider a Multipolygon geometry of 2 squares:

MULTIPOLYGON Z(((0 0 0, 0 1 0, 1 1 0, 1 0 0, 0 0 0)),((2 2 0, 2 3 0, 3 3 0, 3 2 0, 2 2 0)))

The number of shaders can be:

- 1: all triangles are styled with the same shader; 

- 2: each square is styled with a different shader; (This is the Added method)

- 4: each triangle of each square is styled with a different shader.

Tool tesselate_building will still work the same, but can be simplified (by making use of this new method).

See #188 for the changes involved.

Closing this issue.

@bertt bertt closed this as completed Aug 6, 2024
@mittermichal
Copy link
Contributor

do I understand correctly that the order of geometry in geometry collection corresponds to order in shadercolumn BaseColors list?

@bertt
Copy link
Member Author

bertt commented Aug 6, 2024

yep

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

No branches or pull requests

3 participants