-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Meshable extrusions #13478
Meshable extrusions #13478
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this quite a lot! Mostly I just want more documentation (both user-facing and internal) about how the process is expected to work.
Specifically:
- I think the
MeshBuilder
constraint is reasonable, and adding it to everything should be fine (if anything, I think making these uniform is good). - I think that encoding the perimeter of two-dimensional meshes in a trait on the builder seems like the right approach.
- I think that the way that flat and interpolated normals are computed seems quite reasonable.
The only things I'm kind of iffy about are the way that UVs are constructed (not a big deal anyhow) and the reimplementations of resolution
on extruded builders.
Co-authored-by: Matty <weatherleymatthew@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple minor remaining things but I'm pretty happy with this now. :)
The migration guide should also probably mention the obligatory MeshBuilder
bound on Meshable::Output
, since Meshable
is a public trait.
Co-Authored-By: Matty <2975848+mweatherley@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with this API, and this functionality seems like a reasonable way to use extrusions.
Like always, docs and code quality are excellent.
# Objective - Implement `Extrudable` for all meshbuilders of shapes that have been added after #13478 was created ## Solution - Implemented meshing for extrusions of `CircularSector`, `CircularSegment` and `Rhombus` ## Testing - The correctness of these was confirmed visually. ## Additional information Here is an image of what they look like :)  Co-authored-by: Lynn Büttgenbach <62256001+solis-lumine-vorago@users.noreply.github.com>
Thank you to everyone involved with the authoring or reviewing of this PR! This work is relatively important and needs release notes! Head over to bevyengine/bevy-website#1363 if you'd like to help out. |
Objective
Meshable
forExtrusion<T>
Solution
Meshable
requiresMeshable::Output: MeshBuilder
now. This means that allsome_primitive.mesh()
calls now return aMeshBuilder
. These were added for primitives that did not have one prior to this.Extrudable: MeshBuilder
has been added. This trait allows you to specify the indices of the perimeter of the mesh created by thisMeshBuilder
and whether they are to be shaded smooth or flat.Extrusion<P: Primitive2d + Meshable>
is nowMeshable
aswell. The associatedMeshBuilder
isExtrusionMeshBuilder
which is generic overP
and uses theMeshBuilder
of its baseshape internally.ExtrusionMeshBuilder
exposes the configuration functions of its base-shapes builder.3d_shapes
example to includeExtrusion
sMigration Guide
.mesh().build()
on primitives where you have previously called.mesh()
Output
type of customMeshable
implementations must now deriveMeshBuilder
.Additional information
+Z
) is in the area between(0, 0)
and(0.5, 0.5)
,-Z
) is in the area between(0.5, 0)
and(1, 0.5)
(0, 0.5)
and(1, 1)
. EachPerimeterSegment
you specified in theExtrudable
implementation will be allocated an equal portion of this area.Here is an example of what that looks like on a capsule:
Extrusion.UVs.mp4
This is the texture used:
The
3d_shapes
example now looks like this: