-
Notifications
You must be signed in to change notification settings - Fork 72
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
BLEND alpha mode #192
Comments
Yes it's now hardcoded to AlphaMode.OPAQUE (https://github.com/Geodan/pg2b3dm/blob/master/src/wkb2gltf.core/MaterialCreator.cs#L13) I think the best is to add AlphaMode to the style.json (and default_alpha_mode to the options), like:
Then you can define 1 default Alphamode for everything, 1 AlphaMode per geometry, 1 AlphaMode per inner geometry or 1 AlphaMode per triangle |
thanks, will try to implement this and send PR in next 2-3 days |
Most easy is to only add default_alpha_mode to options (like defaultDoubleSided), if this is sufficient for your usecase. |
sure, but IMO then it should be explained to not combine with non-transparent objects |
We can add it in the styling readme https://github.com/Geodan/pg2b3dm/blob/master/styling.md |
It's in release 2.15 :-) I'll close this issue and create another one for adding alpha mode in the style json |
in our project we would like to extruded geometry to be transparent to mark certain area. E.g. this red area of forest is infested with bark beetle.
For quick preview I modified MaterialCreator.MaterialBuilder to set BLEND alpha mode intead of OPAQUE:
update ... set geom_triangle = ST_Force3D(St_SetSrid(ST_Translate(ST_Extrude(wkb_geometry,0,0,30),0,0,0.1), 4326));
I would like to make PR for this but I am not sure how you would like this to be customizable. I don't think its needed to have option to set MASK mode as whole geometry share the same base color
*
. But then should this be configurable per-geometry likeblendAlphaMode: true
in shaders json or should there be just simple switch that will enable this for all geometries or perhaps enable it per geometry anytime base color alpha channel is less than 1.I think its better to have it per geometry because if someone has huge dataset and only wants few geometries form it to be transparent. Then it could unnecessary slow down rendering if all objects had BLEND alpha mode.
*
https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#alpha-coverageThe text was updated successfully, but these errors were encountered: