godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.57k stars 20.4k forks source link

Polygon2d editor- Ability to Add/remove/move internal vertices - edit topology #20601

Closed blurymind closed 5 years ago

blurymind commented 6 years ago

Godot version:

3.0.6

Request description: This is a request to add the ability to have internal vertices on polygon2d shapes. The feature is required for a 2d skeleton deformation workflow - specifically for animations that fake head/torso turning. It can also be used for facial animations.

here is an example of that in spine2d: https://youtu.be/0Dd2M8XBTo0?t=8m56s and https://www.youtube.com/watch?v=Whe2qvEiZds

download

In general, Godot currently can only do very simple mesh deformation animations. The end result will always feel a bit stiff without the ability to have deformation inside the mesh - internal vertices

It's a huge limitation

vnen commented 6 years ago

I think this is solved by the 2D skeletal deform (which is a 3.1 feature): https://godotengine.org/article/godot-gets-2d-skeletal-deform

blurymind commented 6 years ago

@vnen what do you do if you want to animate the robot's eyebrows with an extra bone then? :/ untitled Can we add vertices on his face? This is a simple example, you have no other choice but to use internal vertices in more complicated cases.

Right now you can only add them to the silhouette , which sucks a lot for animators - its a huge limitation on creativity.

..or am I missing something?

Ranoller commented 6 years ago

I ask for this in every patreon poll after Skeleton2D commit. I hope it will be considerated. It´s a must have to bone animation.

Thing that are not hard (Actually exist but are hidden):

Things that can be hard:

https://www.youtube.com/watch?v=Sul-lc9D-8I (Sec 0:24)

https://www.youtube.com/watch?v=3mC9suxK6zM (Sec 0:42)

This is very clear (min 1:46):

https://www.youtube.com/watch?v=JgvhHRQ3mEs

blurymind commented 6 years ago

I wonder why @reduz decided to hide internal triangulation by default

To me just creating internal vertices (inside the silhouette's volume) and binding them to a controller bone would be good enough

Hiding the triangulation, and not allowing internal vertices to be controlled seems like a huge problem

blurymind commented 6 years ago

Here is an example of animation that is only possible with internal vertices giggphy

blurymind commented 6 years ago

Another side effect of not being able to split edges both vertically and horizontally - have internal vertices is this horrible deformation: terriblesplits Notice how pixels suddenly cut in the middle

If we could set weights on internal vertices we would also be able to get much better controlled deformations and avoid this problem naturally.

This is too rough to be used in production imo

insomniacUNDERSCORElemon commented 6 years ago

This'd be great for just vector art as well, color-per face and much better vertex coloring! (particularly with an actual vertex painter)

I mean a faceted style currently is possible but you need to use multiple polygons (and likely more vertices), using partial transparency can make things a bit easier in some cases (but that brings its own issues as well). Meshes would make creation of anything complex much easier and faster, as well as being actually viable to edit later.

I talk about this (and Godot's polygon AA+expansion of polygon features) in this post that I made on r/godot. Including a test project with different experiments with Godot's polygons (vertex colors, animations/movement, scaling, textures+texture warps, 1 animated collision mesh, etc).

blurymind commented 6 years ago

To me the biggest problem with this is that the artist using it is always forced to produce subpar results with ugly skin deformations. Everyone will continue to choose dragonbones or spine over this - simply because on the very basic level it fails to be a better option

Vertex colors and turning svg files into polygon meshes is a whole other thing, that is just a pie in the sky atm. This is what Unity3d is doing atm btw. If you look at games like Night in the woods - cartoony 2d game made in unity- its all polygons moved by armatures

ghost commented 6 years ago

@blurymind Will make this my next suggestion / vote for the upcoming Patron polling.

Skeletal2D is something we really want to make use of, but so far it hasn't been functioning at all, and seems to lack basic features.

blurymind commented 6 years ago

@avencherus Thank you. Hopefully it will be addressed before the official 3.1 stable release.

To add more to the examples..

Dragonbones has a great mesh editor: mesh_deform it can automatically generate an initial mesh and it has tools to edit it -It allows to add vertices, split edges..

Here is an animation that would be impossible to do without internal vertices vj1de6j

1bdc40f78296a816bf5ba928b76799c9_original

That sort of torso/head turning is key to creating a better skeletal animation

ghost commented 6 years ago

@blurymind It's not a problem. X) I am glad someone else here is interested in this feature and vocal about what it needs.

When it comes to 2D, I feel like this an area where Godot unfortunately lags very far behind many of the other engines and tools. That said, I am more than eager to see it take shape, because of how powerful it will be coupled with the AnimationPlayer and GDScript.

I don't know a whole lot about it yet, so thanks for sharing these examples. The second one is something that looks very practical for a game. This is sort of effects we're aiming for in our game right now, but we're currently blocked until 3.1 stabilizes. :(

insomniacUNDERSCORElemon commented 6 years ago

@blurymind I don't think I saw your edit before

Vertex colors and turning svg files into polygon meshes is a whole other thing, that is just a pie in the sky atm.

Me mentioning svg importing was only a note about the only situation I could see neglecting a dedicated (vector-focused) 2D asset editor (or having it as an add-on/plugin/whatchamacallit) as being acceptable, I wasn't suggesting svg conversion. That likely wouldn't be super useful anyways without curve support, at which point conversion isn't really needed.

I don't think it's too much work, particularly sharing a lot with standard polygons that just needs some adaption/new cases. Though you're right, it's a few steps past being used only for a texture-deform skeleton... however, a mesh+vertex colors can produce some pretty neat things (see also Spyro's skyboxes back during the PS1 days, back when something that clean/smooth wouldn't have been viable with a skybox texture) for a low resource impact. Animation of a polygon character would also be significantly easier using a mesh just like a texture would, rather than having a 'body' polygon and then needing other elements as their own polygons that are animated separately. Vertex coloring would also be much more viable with internal vertices.

But I agree, it is likely "pie in the sky". Not because it's unrealistic technically, but because someone needs to work on it and that's unlikely unless someone both WANTS said feature and has the ability+time to implement it. Many people are fine with raster (even though it doesn't play nice both with high and low resolutions), and you can see the lack of care when it comes to Google/Mozilla trying to replace Flash without recreating the vector side of it (like the replacement for animations is just the HTML5 raster video player) despite the jump we've had in average screen resolutions AND 1440p/4K/8K looming in the future.

This is what Unity3d is doing atm btw. If you look at games like Night in the woods - cartoony 2d game made in unity- its all polygons moved by armatures

Not sure what you're trying to say with this, but I'd probably be interested in reading/hearing about it if you have devlogs/videos etc on any of it. Last time I checked with Unity, most vector support seemed like it required 3rd-party stuff, sometimes even paid. Though I'm not sure about polygons only.

I couldn't find anything on NitW, the main thing that pops up is their dialogue system (Yarn). I'd look at the game myself to make sure it wasn't pre-rendered, but I don't have money and I likely wouldn't buy it simply due to lack of replayability (even though I like adventure games).

blurymind commented 6 years ago

@insomniac_lemon

here is a link https://www.youtube.com/watch?v=BAyd5wSPQrM https://blogs.unity3d.com/2018/07/10/2018-2-is-now-available/#svg

Unity converts svg files to meshes and the color data seems to be transferred to the vertex colors data - resulting in this crisp resolution independent look.

The idea about svg from my perspective is binding the svg generated mesh to a skeleton :)

But in this issue, my request is not for that at all. It is to improve the authoring tools in godot and allow authoring the tessellation of polygon2d - to allow internal vertices.

Polygon2d is strange imo, because its not really a polygon - doesnt have 4 vertices - its not one face. Its just a very limited mesh. Should be called mesh2d?

insomniacUNDERSCORElemon commented 6 years ago

@blurymind

here is a link

Neat, that's refreshing to see! Seems like it's from early this year. I don't think NitW used that considering it came out in early 2017, and the kickstarter was from 2013 (where you can see a 3D view of the scene and a sprite tree)... but I guess the final game could use plane meshes imported from SVGs, maybe even with a custom importer.

Still no curves as I mentioned... though maybe it won't make too much difference performance wise, unless maybe compared to the stuff that need 20+ vertices to be smooth vs 1 curve. That is, particularly in cases where smoothness is wanted. I mean I don't mind a stylized 'cutout' look, but I like the super-smooth yet simpler look too (like an outline of a leaf made with only 2 vertices... which with 2 handles per vertex still offers a few possible shapes).

The idea about svg from my perspective is binding the svg generated mesh to a skeleton :)

But in this issue, my request is not for that at all. It is to improve the authoring tools in godot and allow authoring the tessellation of polygon2d - to allow internal vertices.

Well, internal vertices could do both. You could use it not only for better deforms and internal deforms as you've mentioned (tentacle and eyebrows respectively) but also for vertex weights. Plus you could animate the vertices directly (mouth and eye animations would not work very well with bones, or if possible it'd be really awkward both with the skeleton setup and with a cartoon-y/simple result).

Like I said in my last comment... pure mesh shares many features as what you're asking for, only it requires a bit more work (deform only vs actually renders). Much like polygon2D already shares usage for polygon art and texture deformation, so internal vertices could be a step up for both.

It would be incredibly useful for creating static art yes, but it'd also be useful for making animated characters (or other animated things) that don't rely on textures. So in the case of animation we both want the same thing, only I want it expanded a little further to work with meshes on their own.

Polygon2d is strange imo, because its not really a polygon - doesnt have 4 vertices - its not one face. Its just a very limited mesh. Should be called mesh2d?

The prefix poly- just means 'many'. So Godot's usage is perfectly fine. I don't think 'face' implies 4 vertices either, you're likely thinking of quads.

Mesh2d should be reserved for when the mesh is controllable, like for this issue and for what I want. Internal vertices should not be done through polygon2d nodes, unless maybe they just get renamed to mesh2d assuming it gets fully upgraded.

swarnimarun commented 6 years ago

Let me sum up everything from this thread so that if someone wants to work on it, he/she won't have to read it through.

And improvements to the skeletal deforms. Not mentioned here but from my perspective they will be needed to make work with the internal vertices better.

Lastly the SVG importer improvements by adding tessalation to turn it into a mesh might also be a good idea if someone is up for it. But it probably should be a separate issue thread.

blurymind commented 6 years ago

@swarnimarun cage transform should not be regarded as a replacement for weight painting. In the example of the dragon wing, you can absolutely not achieve the control you need with a cage.

Cage transformation should be seen as an extra feature, not an 'instead of weight painting'. We absolutely need to be able to set the weight of internal vertices. Right now we can already set weights - its clunky as hell- but not impossible. The problem is that there is not even a way to create internal vertices to begin with- therefore we have absolutely no creative control in a big big way, when compared to all the other industry used 2d mesh implementations.

Here is another example where you need to very specifically set the topology of your 2d mesh: 3 6-meshtools this is commonly used to set up a simple eye blink in a rig

Godot's implementation is not a viable option at the moment. It won't ever be with this limitation. The sad thing is that all the options out there are proprietary. Dragonbones claim to be open source on their website, but their editor is not open source, nor is it free. They have imposed some terrible DRM requirements in the latest versions - you cant use their app unless you are logged into an online account at a chinese website.

The only easily accessible drm free option at the moment- that is even a part of a game engine is sadly the one in unity3d. Unity3d atm has the best implementation of this. https://www.youtube.com/watch?v=pRMeH_sc8PI Anima2d, which is now a part of Unity has all ofthis. Godot doesnt even have weight painting tools or auto smooth binding, like in Unity 68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f33363839392f36393333623632372d343461312d613565342d653939612d6235623538323231366561612e676966

These are imo for another issue request. This request's focus is solely the ability to create internal vertices and set weight on them.When that is out of the way, I can post a separate issue about the weight painting tools if nobody else does :)

ghost commented 6 years ago

@blurymind Another informative post. As it stands I don't think the results can ever get much better than the purple tentacle example from earlier posts. We've been trying to see what we can at least use out of it, but for the very issues here, the results have been very undesirable. Though it looks like it would be quite the effort to make the tools and features on par with the others.

blurymind commented 6 years ago

@avencherus thank you. It is indeed unusable at the moment. Even basic deformations dont look good. If you would like to have mesh deformations in godot, the unofficial dragonbones runtime is the best option. It unfortunately means running a custom build of godot and a drm riddled external editor for the animations. Hopefully this will get much needed attention before the official release, when the feature implementation will likely be criticized and compared to others by much more users than just us.

Btw I really like gun-toting cats. Well done!

ghost commented 6 years ago

@blurymind I hope so, we will have to see how many people are actually aiming to use it. If it hits the floor as is, oh my.

The downsides about Dragonbones are very much deal breakers. If Spine delivers a run-time for Godot by the end of the year as has been suggested, we'll probably invest in that. Though we're just starting to evaluate the animation needs, it may turn out that we can make do with cut-out puppets.

Thanks. X) Now that we've decided to take the game on seriously, there will be some very ambitious improvements made to it.

reduz commented 6 years ago

Guys, if you want to add internal vertices, this work should be focused on the Polygon2D editor. As I mentioned before, importing SVG as mesh is nice and it should not be too difficult, but this is not a good enough solution for this.

blurymind commented 6 years ago

@reduz thank you, I renamed the title of the issue. The request here is for internal vertices. If that is added to the polygon2d editor- it would close this issue.

The svg stuff is not a suggested solution, just an off topic mention - related to 2d animation in godot in general

reduz commented 6 years ago

As I mentioned, importing SVGs as Meshes is not too much work, but having to add internal vertices to them is a huge amount of work in comparison to just add internal vertices to Polygon2D

blurymind commented 6 years ago

@reduz for this issue lets focus on the lower hanging fruit- ability to add internal vertices in polygon2d editor :) I think most people will use bitmap sprites anyways

Svg import and tessellation is for a separate feature request imo.

We now have this feature, but it is still missing a key ingredient to be complete

Ranoller commented 6 years ago

Really godot node system has now all features that spine/dragonbones has except internal animation vertices... you can do re-skinning, you can change z position, add/delete parts of the body, triggers, etc... you can do more things that integrated editors in spriter/spine/dragonbones.... but the internal vertices (a.k.a mesh deformation in 2d slang) is dead end to 2d animations "darkest dungeons" like (spine).... we try to maintain dragonbones runtime compatibility jet (module compiles in 3.1, but original module developer don't seems to interested), spine runtime is now outdated and think doesn't compiles because COW changes and math2d split (i'm spine customer but i don't want to do the job, i'm not programmer and spine has programmers), spriter now is worst that godot animation system... in the future this can be a top feature for 2d godot so please don't lost focus on that.

blurymind commented 6 years ago

@Ranoller I agree that it would be great if we don't have to rely on third party devs/software. Unfortunately without internal vertices it is really unusable for production. Until godot catches up with dragonbones on the most basic of features- we will have to use it instead.

So thank you for maintaining it btw

blurymind commented 6 years ago

Everyone who wants this feature- dont forget to vote for it here https://docs.google.com/forms/d/e/1FAIpQLSeULEXXLknOgWdaDfDPD-OJjXhUw-y27G4HQ6scPBBTEAlGww/viewform

swarnimarun commented 6 years ago

@blurymind isn't that for patreons only?

blurymind commented 6 years ago

@swarnimarun everyone can vote, however if you are a patreon your vote counts as more than one vote..at least thats how I understand it

reduz commented 5 years ago

This wad added some days ago, so closing.

blurymind commented 5 years ago

Thank you for the fantastic work!

On Fri, Jan 18, 2019, 2:34 PM Juan Linietsky <notifications@github.com wrote:

Closed #20601 https://github.com/godotengine/godot/issues/20601.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/20601#event-2083057836, or mute the thread https://github.com/notifications/unsubscribe-auth/AGMbVW2Oukpmhl9n_ifRk0amrsTEwV_0ks5vEdtlgaJpZM4VmRjT .

JWBWork commented 3 years ago

To clarify, it was just internal vertices that were added right? We're tools like cage transforms to animate internal vertices added?

Calinou commented 3 years ago

@JWBWork I don't think cage transform tools are implemented yet. If you need this feature in a project you're working on, please open a proposal on the godot-proposals repository.