Announcement

Collapse
No announcement yet.

❀ DoN's Dynamic Mesh Effects ❀

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by VSZ View Post
    You'll need to prepare a 2nd UV channel for the character meshes as described in these knowledge base articles - Character Painting FAQ, Preparing your Mesh for Painting. That means you will need to export your marketplace meshes to your 3D tool of choice and reimport them back after adding the 2nd UV channel. This step is not required if the first UV channel has no overlapping faces, though that is very rare.
    The linked resource seems to be a bit barren and assumes at least some level of familiarity (and some links are broken in the documentation as well). Would you be able to provide something showing how to get skeletal mesh painting functional, from start to finish? A video would be absolutely amazing, but I'll take what I can get.

    An example of what's throwing me for a loop is the material function on the quick start page (there is no information on it or what it is doing), and the assumed knowledge on lightmaps. While I do understand that spoonfeeding information in regards to the basics of UE4 is outside the bounds of what a reasonable person could expect from you, I do hope that's not how this request is coming across. I'm a visual person, and seeing something done in 30 seconds will do more for me than 600 pages of documentation. I'm certainly not expecting a detailed rundown on what lightmaps are, how to create them, etc. Skip that part if you'd like. I'm just asking for a guide on preparing a skeletal mesh from start to finish, and hopefully some explanation on what your MF is doing on the quickstart page.

    Basically, something showing what work was/is required to have functional mesh painting for a skeletal mesh, on a fresh new project. I'd greatly appreciate anything that could clear it up a bit.

    All-in-all, the plugin seems amazing and I'm looking forward to the prospect of integrating it in my game. I can tell you've put countless hours of hard work into the product, and see a tremendous amount of advanced functionality when checking out your demo videos. Kudos to you and your team, the product is very impressive!
    Last edited by One Mode Only; 07-16-2018, 03:30 PM.

    Comment


      Originally posted by One Mode Only View Post
      Basically, something showing what work was/is required to have functional mesh painting for a skeletal mesh, on a fresh new project. I'd greatly appreciate anything that could clear it up a bit.
      The main setup occurs in your 3D modeling app rather than Unreal. Here are the steps briefly:

      Inside your 3D modeling app:

      1) In your 3D modeling app, unwrap your character mesh's UVs as per usual. The result is (usually) stored in the "UV0" channel.

      2) Now create a new UV channel (typically UV1) for your character mesh. This is what the plugin will use for skeletal mesh painting.

      3) Here's the important bit:
      Unwrap the character in UV1 channel, just like you did in Step 1, but make sure that no overlapping UVs are present this time. Typically symmetric parts of the body are overlapped into a single UV to save texture memory. We do not want that here, we want every face on the mesh to be unwrapped uniquely. The number of UV islands does not matter (so it can be one large block or many smaller ones), each vertex just needs to be uniquely represented on the UV map.

      Step 3 is the general process for how Lightmap UVs (wiki article) are typically made, although the PaintMap would probably be a better name for the plugin's sake as it is much easier to make these paintmaps as they aren't fussy about the uv layout unlike lightmaps.

      Inside Unreal Engine:
      4) Inside your material, add the node "Don Mesh Paint UV1" (documentation for this material node is on this page). The main thing you need to know is that these nodes are the mechanism through which you acquire whatever paint data that you have painted on your character. Connect/utilize the alpha / rgb of this node to your material as desired.

      5) If your character doesn't already have a physics asset, create one for it. Your painting accuracy will depend entirely on this, so make sure that collision bodies in PhAT closely match the character. You can open the sample project's demo character physics asset to see its setup.

      That should be it, you'll be able to use the Paint Stroke node at this point on your character.

      ~

      I don't have the bandwidth for a video tutorial atm (I don't have a team btw, I'm working solo ) so I'm afraid it will have to be text for now.

      Just let me know if you require further clarifications and I'll do my best to clarify
      Last edited by VSZ; 07-16-2018, 04:35 PM.

      Steam Early Access: Drunk On Nectar - The Nature Simulator

      UE4 Plugins: DoN’s Dynamic Mesh FX | DoN’s 3D Pathfinding

      Comment


        4.20 Update Submitted (New Features!)

        ~ Raycasting API ~ - As requested by users, you now have a Raycast API that is aware of your painted portals!

        Line tracing, Sphere sweeps, they're all supported! These are powerful recursive functions that can travel through multiple portals as shown below:

        Click image for larger version

Name:	Don-Raycast-API.jpg
Views:	4
Size:	565.5 KB
ID:	1507758

        ~ Multi Layer Paint Collision ~ - To support my game's requirement of players building silk nests with different types of silk (see video!), paint collision (and importantly, duplicate paint stroke detection) are now aware of paint layers!

        ~ Major bugfixes across the board ~ - From static mesh seamless painting to Planar uvw validation logic to correct Bounds calculation for primitives located far away from their parent actor, this update brings various crucial bugfixes and covers many edge-cases.

        This update has been submitted to the marketplace along with my other plugins and should be available soonish
        Last edited by VSZ; 07-27-2018, 04:55 PM.

        Steam Early Access: Drunk On Nectar - The Nature Simulator

        UE4 Plugins: DoN’s Dynamic Mesh FX | DoN’s 3D Pathfinding

        Comment


          Thank you so much for adding this!!

          Comment


            can i use this in conjunction with a multi line trace to put a "hole" (or see-through point) through the players skeletal mesh, and whatever mesh's i have attached to the body?

            Edit: 1: (IN BLUEPRINT)
            Edit 2: i usually do C++ after but for prototyping i prefer blueprint if possible

            Comment


              Major Mints - The current design stores world-space locations for brush strokes which limits the collision API's usability to static things.

              It shouldn't be that hard to redesign it around local space positions (in which case your usecase would be possible along with things like Shields that can be punctured and admit arrows through holes in the shield, etc), but my focus is currently elsewhere so I probably won't be looking into it any time soon.

              If you're comfortable with C++ and/or diving into a code base, you might be able to rewire the code (via simple things like inverse transform position to convert Hit location to local space, etc) and get this to work. I've documented the code very liberally so it should be much easier than diving into the engine code for example.

              For the next update I have a pending request of "Infinite Damage Textures" which will take precedence; that one should have made it into this build but couldn't due to the 4.20 migration effort taking longer than I expected

              Steam Early Access: Drunk On Nectar - The Nature Simulator

              UE4 Plugins: DoN’s Dynamic Mesh FX | DoN’s 3D Pathfinding

              Comment


                I am using this plugin to place bullet hole decals on a skeletal mesh. It is working, but the problem is that the decal size seems to be changing all the time. I have a value of 1 set on my paint stroke node. My UV islands on that second UV set are proportional, so I think it is not a problem with that. I can shoot the same area multiple times and the bullet hole decal is sometimes very tiny or sometimes enormous, like a grain of rice or a manhole cover. I would say 80% of the time it's roughly the right size, but it is almost never the same. Any ideas for what might be causing this problem?
                Last edited by cpenny20; 07-29-2018, 02:24 AM.

                Comment


                  I'm a couple weeks late, but thanks for the in-depth reply to my question! And yes I was referring to Tom Looman's article, I'm glad we're on the same page with our concerns, that's what I was most curious about.

                  Comment


                    Originally posted by cpenny20 View Post
                    I am using this plugin to place bullet hole decals on a skeletal mesh. It is working, but the problem is that the decal size seems to be changing all the time. I have a value of 1 set on my paint stroke node. My UV islands on that second UV set are proportional, so I think it is not a problem with that. I can shoot the same area multiple times and the bullet hole decal is sometimes very tiny or sometimes enormous, like a grain of rice or a manhole cover. I would say 80% of the time it's roughly the right size, but it is almost never the same. Any ideas for what might be causing this problem?
                    The quickest way to debug this is to look at the render target which is generated (you'll find it on your character's material(s) in the outliner) and see how they line up with your UVs. Might not be a bad idea to even export that render target out as a jpg into a 3D application and see how the texture is being applied to your UVs. You can do this inside Unreal as well (with a dummy material that just outputs the Don UV1 node), but in your 3D app you'll have the advantage of seeing exactly how the vertices line up with the texture.

                    This will tell you whether your UVs islands are correctly sized relative to each other; decal projection is not seamless (for mesh-space painting) so if you're seeing different decal sizes being rendered for the same input brush size it usually means some UV islands have been unwrapped larger in size compared to the surface area their faces actually occupy.

                    I recommend using the seamless workflow for such a tiny hole (i.e. don't use decals, leave the Decal parameter empty) as that will guarantee consistency of hole size regardless of UV setup .

                    Steam Early Access: Drunk On Nectar - The Nature Simulator

                    UE4 Plugins: DoN’s Dynamic Mesh FX | DoN’s 3D Pathfinding

                    Comment


                      Originally posted by VSZ View Post

                      I recommend using the seamless workflow for such a tiny hole (i.e. don't use decals, leave the Decal parameter empty) as that will guarantee consistency of hole size regardless of UV setup .
                      Thanks for the reply, I just tried this, and the hole sizes are still a little bit different in some places. There are also places all over the model where the effect doesn't happen at all. I wonder though, is this problem possibly related to the physics asset? Also, I tried using a value of less than 1 for the brush size, like .85, and didn't see any holes at all. Is it possible to do this?

                      edit: i went back and looked through the thread and it does seem that maybe i need a more accurate physics asset for a small brush such as this. not sure if it explains the differing brush sizes though.

                      edit 2: i remade the physics asset to be much tighter and it does seem to be helping a lot. It's working well enough that I don't feel the need to make it any better for now i think!
                      Last edited by cpenny20; 07-29-2018, 04:27 PM.

                      Comment


                        Originally posted by cpenny20 View Post
                        i remade the physics asset to be much tighter and it does seem to be helping a lot. It's working well enough that I don't feel the need to make it any better for now i think!
                        Glad to hear! Yes accuracy of the physics asset plays a big role as the hit location needs to be as close to the material's pixels as possible.

                        Resolution of the positions texture is another factor By default its hardcoded to 512x512 for optimum performance. Increasing that should help further, but I'd only recommend that for a dedicated scenario like a painting app or a character customization screen where you're dealing with only one or few subjects.


                        Steam Early Access: Drunk On Nectar - The Nature Simulator

                        UE4 Plugins: DoN’s Dynamic Mesh FX | DoN’s 3D Pathfinding

                        Comment


                          4 follow up questions when you have the time!

                          1.) I'm not sure I understand: "the resolution of the positions texture" in your last reply, I'm curious what you mean by that?

                          2.) Also, i still see some seams between the UV islands as i paint on the mesh. Is there any way to avoid that? Thanks!

                          3.) I am trying to paint on a skeletal mesh that is a child component (a piece of clothing, attached to the main character using the "Set Master Pose Component" node) but it's not working. It works on the main body mesh, but not on his additional pieces. Any idea why?

                          4.) As I paint strokes on a character mesh, for a single frame, I see the morph targets resetting. Is there any way to avoid this?
                          Last edited by cpenny20; 08-01-2018, 08:25 PM.

                          Comment


                            Originally posted by cpenny20 View Post
                            1.) I'm not sure I understand: "the resolution of the positions texture" in your last reply, I'm curious what you mean by that?
                            Originally posted by cpenny20 View Post
                            2.) Also, i still see some seams between the UV islands as i paint on the mesh. Is there any way to avoid that? Thanks!
                            For both questions - The quality of your seamless painting can be improved by increasing the resolution of the "positions texture" - this is a special look up texture which the plugin generates by baking the local space positions of your character's pixels.

                            Currently the resolution of this look up texture is hardcoded to 512x512 inside DonMeshPainterGlobalActor.h (search for DefaultPositionsTextureSizeX and DefaultPositionsTextureSizeY).
                            Try increasing this to 1024x1024 and recompile the code although keep in mind that this will have some impact on performance - but mainly for decal projection seamless painting should be mostly unaffected as that's done completely on the GPU.

                            Before you do this, first try increasing the size of your UV islands for important areas. For seamless painting your UVs do not need to be uniformly sized (unlike for decals) so if some UV islands are really small then the corresponding resolution those pixels acquire in the baked position texture will also be lower and hence the accuracy.

                            Originally posted by cpenny20 View Post
                            3.) I am trying to paint on a skeletal mesh that is a child component (a piece of clothing, attached to the main character using the "Set Master Pose Component" node) but it's not working. It works on the main body mesh, but not on his additional pieces. Any idea why?
                            Does the cloth have a physics asset to go with it? The hitresult's location needs to roughly approximate the cloth's pixels for this to work. Obviously a primitive collision shape can never approximate the rich contortions of cloth, but you need some kind of collision to occur for the paint to be projected. Cloth support was recently added in 4.19 and should work as long as your cloth mesh has a collision body.

                            Originally posted by cpenny20 View Post
                            4.) As I paint strokes on a character mesh, for a single frame, I see the morph targets resetting. Is there any way to avoid this?
                            This is an engine bug that was reported to Epic a while ago. You can track the progress of that bug here: UE-54099. Do add vote your vote on that JIRA to show your interest!

                            Steam Early Access: Drunk On Nectar - The Nature Simulator

                            UE4 Plugins: DoN’s Dynamic Mesh FX | DoN’s 3D Pathfinding

                            Comment


                              4.20 Project Available (Raycast Example Added!)

                              Download it here!

                              ~

                              One Mode Only - Saw your post on the marketplace page, thought this would help!

                              Steam Early Access: Drunk On Nectar - The Nature Simulator

                              UE4 Plugins: DoN’s Dynamic Mesh FX | DoN’s 3D Pathfinding

                              Comment


                                Just an update that using the plugin in VR environments works just fine.
                                Colin M. Croft
                                President
                                Croft Interactive Inc.

                                Comment

                                Working...
                                X