Closed mrjustaguy closed 2 years ago
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/com.unity.render-pipelines.high-definition@10.2/manual/hair-shader.html)
@mrjustaguy
(Edit: misunderstood intent of the proposal - sounds good, though I'm not familiar with rendering stuff at all)
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/com.unity.render-pipelines.high-definition@10.2/manual/hair-shader.html)
A feature being present in other engines is not justification for Godot to include it. By that logic, Godot should also come pre-bundled with a 3D character model with basic animations and dedicated nodes for executing basic movement logic for it. However these, too, are not included.
Generally speaking, Godot is intentionally preserved as a blank canvas so as to minimize size, complexity, maintenance burden on contributors. Adding a shader like that would set a precedent of including other miscellaneous assets. It also would never quite satisfy everyone who might want or need a hair shader, so you'd end up with a "core" shader and "community" shaders. And if the community is actively maintaining assets with the same purpose as the engine's version of the same, then why is the engine bothering to provide an "official" maintained version of said asset? It doesn't make sense.
The core engine is intended to be comprised of building blocks for making games while community-maintained addons provide the "library" of assets that the engine integrates. In fact, I think the only core assets are the Godot icon and possibly some built-in basic 3D mesh shapes (like sphere, cube, etc.). So if it is an asset you are putting into a game (like a shader), then it should probably be an addon.
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
These cases, where there is a core feature you need fixed/exposed/implemented in order to be able to create the assets you need for your game to work, are a good example of something to propose as a new feature. I suggest you create a separate proposal specifically for adding to the engine whatever tools are necessary to be able to create the assets you need.
Hmm, I think it's clear that you guys misunderstood exactly what I was asking for. I'm asking for the ability to Draw Edges in a similar way to G4.0's ability to Draw Points, The primary goal & use case of this is to simply make Hair, and will probably mostly be used for that, as Wireframe drawing is a niche, something that Hair, is not. Drawing Points is also a Shader capability, and really when I talk about a Shader, what I'm really talking about is a StandardMaterial3D Option addition, which also requires a Shader addition.
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
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.
mrjustaguy
I'm asking for the ability to Draw Edges in a similar way to G4.0's ability to Draw Points, The primary goal & use case of this is to simply make Hair, and will probably mostly be used for that
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 :slightly_smiling_face:
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 https://github.com/godotengine/godot/issues/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:
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.