-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Add shader edge drawing to support hair shaders #2805
Comments
This can and should be an add-on, not a core feature. Godot can't provide every type of visual effect out of the box. EDIT: When I wrote this comment, the title of this proposal was "Implement Hair". |
Well a part of it seems very unlikely to be doable as an addon, but it's unclear if it is a bug or intentional.. Mesh Instances don't allow for Edge-only geometry to be assigned a material, which is required to give it a Shader to draw it, which is a part that Could be an addon, but considering that Point rendering isn't an addon, Edge rendering shouldn't be an addon as well, especially as Edge Rendering is possibly more useful compared to said Point rendering, because it can be used for Wireframe Rendering (Niche) and Hair rendering (Which is common for any games having people, especially the anyhow realistic ones), and while yes, one of the techniques above can be used, they're outdated and/or don't provide a realistic result. Most Modern Engines allow for some form of easy to use Hair rendering, like Unity and Unreal (see https://docs.unrealengine.com/4.26/en-US/WorkingWithContent/Hair/Overview/ and https://docs.unity3d.com/Packages/[email protected]/manual/hair-shader.html) |
(Edit: misunderstood intent of the proposal - sounds good, though I'm not familiar with rendering stuff at all)
|
Hmm, I think it's clear that you guys misunderstood exactly what I was asking for. Implementing Edge Drawing, on Edge based Geometry (Not Triangle based, and well I guess it'd make sense to be able to draw Points on Point based and Edge based geometry, but I personally don't see too many specific use cases for that), is essentially drawing Hair. |
Ahhh, then yes, indeed, that was a misunderstanding. The title should probably be adjusted to more clearly state the purpose, e.g. "Add shader edge drawing to support hair shaders," or something to that effect (can't do it myself). |
aaronfranke
mrjustaguy
Yeah, I was a bit surprised by aaronfranke's reaction to this, since AFAIK, we basically can only talk about use cases (where the problem originates from), because Godot's development is extremely pragmatic, this kind of proposal at least deserves attention. The problem is that there's no place to document use cases using Godot proposals... That's why I'm suggesting to enable GitHub Discussions to gather user feedback and their needs: #2069. |
@Xrayez The original title of this proposal was that @mrjustaguy was asking for "Implement Hair", which is what I was reacting to. I don't think Godot should provide hair shaders built into the engine. As the proposal is now, I don't have an objection to it, since adding a new rendering mode that can be used for hair is very different from Godot providing a hair implementation. |
Yeah it's clear that The Title was quite a bit misleading, and some of my wording didn't help with expressing exactly what the Proposal wants to be added, leading to the misunderstanding, my bad... Edit: The Proposal was Updated a Little to clarify What exactly is desired for Engine Implementation and further clean-up the points leading to the misunderstanding |
I realize this, but then again, the proposal could be more about describing problems of implementing such a feature yourself in detail. The implementation (general or not) could be proposed in the actual proposal that would also cover more use cases (not just hair). I'm just saying that we have organizational problem in Godot's proposals system which could be solved relatively easy with #2069 (because it would be no longer about "core vs plugin", but more talking about problems users experience with the engine, regardless of "core vs plugin" polemics, which unnecessarily shift the potentially useful discussion away from solving actual problems. 😝 The fact that I'm talking about this here already shifts away useful discussion, so I'm sorry about this fact as well. 😕 |
It's already possible to render lines when using procedural mesh generation (the same goes for point rendering). You have to specify the primitive type when creating the mesh. This means there's no way to override the primitive type from the material. Also, using line rendering to render hair doesn't sound like a good idea to me, unless you are going for a minimalist art direction. One reason for this is that line width is not well-supported across hardware, so the only line width you can reliably use on all hardware is 1 pixel. |
In 3, yeah for rendering non-triangles you can only use something like that I suppose... in 4.0 however Points can be rendered on Triangle based meshes.. Adding Edge rendering makes sense.. and eh, even if the limit is 1 pixel, with the rest not being reliable, allowing drawing even 1 pixel makes sense to draw lines, and anything else should then be added as an option with a warning that it cannot be reliably used across hardware, but even then a pixel width is enough for most use cases (maybe not Hair, unless there's plenty of Lines rendered when close up). Still even just considering that Points can be Rendered with Materials in 4.0, it makes sense for Points and Edges to at least get the ability to get Materials to be Used for rendering Points (for point and edge based geometry) and for rendering Edges (for edge based geometry, if line drawing is added) |
Godot 4.0 has built-in support for alpha-to-coverage and alpha hashing. This should cover most needs when it comes to hair rendering 🙂 Alpha hashing will be more useful once temporal antialiasing is implemented. In the meantime, alpha antialiasing is also available separately from alpha-to-coverage. It works even if MSAA is disabled. |
Closing in favor of godotengine/godot#64500, as this is actually a bug. |
Describe the project you are working on
Game with Humans
Describe the problem or limitation you are having in your project
Current Hair creation workflow possibilities are:
Pros: Very Light weight Hair
Cons: Hard to Make & even harder to make look Good
Pros: Looks fairly good, fairly easy to make
Cons: Computationally expensive, as it often takes about 100-200k triangles, and LODs have to be created similar to 1.
Pros: Light weight Hair, similar to 1.
Cons: Hard to Make & Close up the method quite clearly visible
Pros: Super Light Weight, Easy To Create
Cons: Very Unrealistic
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add a Way to Render Edges (Currently only Vertices and Triangles are capable of being Rendered, and Vertices seem to be only Renderable only when in a Triangle based Mesh, but that's a topic for another day)
Adding such an option would allow for this workflow, with blender for example:
Create Particle Hair
Convert Particle Hair to Mesh (resulting in the Hair being Edges)
Pros: fairly Light weight hair, Quite Realistic (as each Strand is an Edge, grown to some size, More Strands and lower size increases quality, but decreases Performance, and the other way around)
Cons: can Fairly easily be overdone by the user (too high hair strand density) for little to no extra quality at a High Performance cost
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Allow for Edge Based Meshes to get Materials
(Point Based Meshes should get this too, as it makes sense, as Points can Already be Drawn using Materials)
Add an option to draw Edges, much like was done with Vertices.
(Godot 4 has the ability to Draw Points using Materials, so adding the Ability to Draw Edges using Materials makes sense)
Result: Cheap & Easy Wireframe rendering of meshes (as in no need for using things like Blender Wireframe on the Mesh to have edges rendered as lines), much like Point clouds can be rendered with Vertices (however only when they're in a Triangle Based Mesh, Allowing Edge and Point based Geometry to be assigned Materials would allow for actual Point based geometry to render the Point clouds, see Notes)
Common use cases: Rendering Hair, and other similar very thin geometry that are basically just edges
More Niche use cases: Rendering Wireframes of Meshes
Notes:
Point Based Meshes Should be Allowed to get Materials to render Points (Currently only Triangle Based Meshes can get Materials, and Can render Points)
Edge Based Meshes Should be Allowed to get Materials to render Points and Edges (Currently only Triangle Based Meshes can get Materials, and Can render Points, but Not Edges)
Triangle Based Meshes Should be Allowed to render Points, Edges and Triangles (Currently Only Edges aren't an option in Godot 4)
If this enhancement will not be used often, can it be worked around with a few lines of script?
No
Is there a reason why this should be core and not an add-on in the asset library?
Not sure if it can be done in an addon.
The text was updated successfully, but these errors were encountered: