Announcement

Collapse
No announcement yet.

Runtime Mesh Component

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

    So, 4.20 is adding 3 addition UV channels for the Procedural Mesh Component. 4.19 on the left and 4.20 on the right.

    Comment


      Hey everyone! I’ll have more of an update soon but for now I just wanted to open up a new discord server dedicated to the RMC. It’s far faster to get my attention that way and easier for me to respond as well as for people to be able to help each other.

      https://discord.gg/KGvBBTv

      ill be posting more information there first and more frequently.

      PS there is a 4.19 and 4.20 update coming soon.
      Last edited by Koderz; 06-18-2018, 03:11 PM.
      Runtime Mesh Component - The best way to render procedural/runtime created meshes! - Version 4.1 out now!

      Come talk about anything RMC or Procedural Mesh Related in our Discord!

      Comment


        How can I get the runtime mesh section out of the runtime mesh component? Just like you do with static or procedural? I need to read vertices and triangles data in order to copy it into another mesh section. Thanks

        Comment


          Does this plugin allow me to work with a mesh that's had morph targets applied to it? Collision doesn't update when morph targets applied and I *really* need to be able to do something like that. Nothing I've done so far get the vertex data out of a mesh that accounts for morph targets.

          Comment


            Originally posted by MrCheese View Post
            Does this plugin allow me to work with a mesh that's had morph targets applied to it? Collision doesn't update when morph targets applied and I *really* need to be able to do something like that. Nothing I've done so far get the vertex data out of a mesh that accounts for morph targets.
            Are you refering to this? https://docs.unrealengine.com/en-us/...s/MorphTargets
            I know there is morph target stuff with animation setups as well. But did not work with it.
            At least with the material version: Vertex position changes with material does not affect collision as it is only rendering data. Don't know whats the case with animation stuff.

            If you realy need that with the RuntimeMesh, export your Mesh in its original and morphed states. Then write some logic that interpolates (not big of a deal, node/functions are already there) the mesh data (Vertex, normals. tangents (and colors if needed)) between the original and the morphed. Destroy the mesh section and Create it again (dunno if collision update is possible with UpdateMeshSection). This however can get quite expensive depending on the complexity of the mesh and number of meshes you need to update per frame. Maybe Destroy and Create only if the morph value (interpolation alpha) delta is to high, update in the meantime, depending on your collision accuracy need.
            NodePrefabs | PluginBuilder | NotificationBackbone | WidgetBox | DebugWidget

            Comment


              Yeah, that's what I'm using. AFAIK, it's not a material deformer, it's working on the mesh directly.

              I'll explain what I'm doing, that might help. I have a project that we use for sciencey work that allows you to change the the shape of a person with 20+ morph targets. I can get loads of useful data, but ideally I'd like to be able to take measurements of the body shape after various morphs have been applied. Everything I've got to work so far just gets me the base mesh shape. I suspect that the new version of the skeletal mesh might help, but I'm not a very experienced programmer and got stuck when ComputeSkinnedPositions wanted me to stop rendering before reading data.

              Your idea will work if I rebuild the morphs using RMC, so thanks for that. I was hoping this plugin had a portion for reading data from existing meshes, but it doesn't seem that way.

              Comment


                Originally posted by MrCheese View Post
                Yeah, that's what I'm using. AFAIK, it's not a material deformer, it's working on the mesh directly.

                I'll explain what I'm doing, that might help. I have a project that we use for sciencey work that allows you to change the the shape of a person with 20+ morph targets. I can get loads of useful data, but ideally I'd like to be able to take measurements of the body shape after various morphs have been applied. Everything I've got to work so far just gets me the base mesh shape. I suspect that the new version of the skeletal mesh might help, but I'm not a very experienced programmer and got stuck when ComputeSkinnedPositions wanted me to stop rendering before reading data.

                Your idea will work if I rebuild the morphs using RMC, so thanks for that. I was hoping this plugin had a portion for reading data from existing meshes, but it doesn't seem that way.
                I yet did not work with skeletal meshes. I gues that the visual transform of the skeletal mesh you see when playing is rendering only + updates of the collision volumes for physics, otherwise you would need to transform all meshdata for every skeletal mesh every frame on the CPU.

                There is a function to retrieve the mesh data of a static mesh. I gues its called GetSectionFromStaticMesh or something like that.
                NodePrefabs | PluginBuilder | NotificationBackbone | WidgetBox | DebugWidget

                Comment


                  Hey Everyone!

                  As of now, RMCv3.2 on GitHub fully supports UE4.17-4.20. After some more testing and documentation I'll push that to the Marketplace to bring that version back up to date.

                  I've posted some additional information in the README in GitHub and also the first post in this thread, and will be updating the wiki documentation soon. I can use as many people testing it as possible and would love feedback on any issues you find as well as what platforms you've tested it on so I can see what platforms it's known to work on!

                  There is a new Discord server for the RMC you can find here: https://discord.gg/KGvBBTv I tend to post most things there first and try to respond pretty quickly to questions/suggestions/comments so feel free to drop in!


                  The RMC takes a substantial amount of time and effort to build and maintain. There's many more things I'd like to do it with, and other related tools I'd like to build. As much as I like just working on it, the reality is there's other things I can do with my time. To be able to justify the time commitment, I'm asking for support. Additionally I will be releasing an extended version of the RMC in the, hopefully, near future that just brings additional abilities, and useful tools to the RMC. The current "community" version will remain free, but the extended version will not be.

                  To find out more information on how to support the project, and on the upcoming extended RMC, see here!
                  Last edited by Koderz; 06-20-2018, 02:00 PM.
                  Runtime Mesh Component - The best way to render procedural/runtime created meshes! - Version 4.1 out now!

                  Come talk about anything RMC or Procedural Mesh Related in our Discord!

                  Comment


                    Hey Koderz, thanks for the update.

                    There is an small code issue with the 2UV channel function in RuntimeMeshData.cpp

                    Code:
                    void FRuntimeMeshData::CreateMeshSectionFromComponents(int32 SectionIndex, const TArray<FVector>& Vertices, const TArray<int32>& Triangles, const TArray<FVector>& Normals,
                        const TArray<FVector2D>& UV0, const TArray<FVector2D>& UV1, TFunction<FColor(int32 Index)> ColorAccessor, int32 NumColors,
                        const TArray<FRuntimeMeshTangent>& Tangents, bool bCreateCollision, EUpdateFrequency UpdateFrequency, ESectionUpdateFlags UpdateFlags,
                        bool bUseHighPrecisionTangents, bool bUseHighPrecisionUVs, bool bWantsSecondUV)
                    {
                        SCOPE_CYCLE_COUNTER(STAT_RuntimeMesh_CreateMeshSectionFromComponents);
                    
                        FRuntimeMeshScopeLock Lock(SyncRoot);
                    
                        // Create the section
                        auto NewSection = CreateOrResetSectionForBlueprint(SectionIndex, false, bUseHighPrecisionTangents, bUseHighPrecisionUVs, UpdateFrequency);
                    ...
                    Code:
                    void FRuntimeMeshData::CreateMeshSectionFromComponents(int32 SectionIndex, const TArray<FVector>& Vertices, const TArray<int32>& Triangles, const TArray<FVector>& Normals,
                        const TArray<FVector2D>& UV0, const TArray<FVector2D>& UV1, TFunction<FColor(int32 Index)> ColorAccessor, int32 NumColors,
                        const TArray<FRuntimeMeshTangent>& Tangents, bool bCreateCollision, EUpdateFrequency UpdateFrequency, ESectionUpdateFlags UpdateFlags,
                        bool bUseHighPrecisionTangents, bool bUseHighPrecisionUVs, bool bWantsSecondUV)
                    {
                        SCOPE_CYCLE_COUNTER(STAT_RuntimeMesh_CreateMeshSectionFromComponents);
                    
                        FRuntimeMeshScopeLock Lock(SyncRoot);
                    
                        // Create the section
                        auto NewSection = CreateOrResetSectionForBlueprint(SectionIndex, bWantsSecondUV, bUseHighPrecisionTangents, bUseHighPrecisionUVs, UpdateFrequency);
                    ...
                    NodePrefabs | PluginBuilder | NotificationBackbone | WidgetBox | DebugWidget

                    Comment


                      Can someone please explain the dual/tripple buffer thing? I gues it is for peformance improvements in some cases, but I can't find any documation about it.
                      NodePrefabs | PluginBuilder | NotificationBackbone | WidgetBox | DebugWidget

                      Comment


                        Has anyone been able to get the RMC working with materials and UVs? I posted my question to the Discord channel as well, but wanted to see if anyone here has any suggestions.

                        When using the RMC in place of PMC, the mesh is created and everything seems to work except it really seems to screw up the UV coords. Here's an example:

                        This screenshot is my mesh using PMC. The material being used is an texture atlas and I'm setting the UVs dynamically.

                        Click image for larger version  Name:	PMCmin.png Views:	1 Size:	306.2 KB ID:	1506338



                        Here is the same mesh but this time I'm using the RMC. All the data is exactly the same including the UVs and all other geometry data.

                        Click image for larger version

Name:	RMCmin.png
Views:	225
Size:	90.7 KB
ID:	1506342




                        From the looks of this last image, it appears the UVs are all messed up. Does anyone have any ideas?
                        Attached Files

                        Comment


                          Originally posted by CashCache View Post
                          Has anyone been able to get the RMC working with materials and UVs? I posted my question to the Discord channel as well, but wanted to see if anyone here has any suggestions.

                          When using the RMC in place of PMC, the mesh is created and everything seems to work except it really seems to screw up the UV coords. Here's an example:

                          This screenshot is my mesh using PMC. The material being used is an texture atlas and I'm setting the UVs dynamically.

                          Click image for larger version Name:	PMCmin.png Views:	1 Size:	306.2 KB ID:	1506338



                          Here is the same mesh but this time I'm using the RMC. All the data is exactly the same including the UVs and all other geometry data.

                          Click image for larger version  Name:	RMCmin.png Views:	2 Size:	90.7 KB ID:	1506342




                          From the looks of this last image, it appears the UVs are all messed up. Does anyone have any ideas?
                          should work. Do you feed the correct UV channel? Code snipped would be good as well.

                          Try a basic material. Just a texture, nothing fancy.
                          NodePrefabs | PluginBuilder | NotificationBackbone | WidgetBox | DebugWidget

                          Comment


                            Originally posted by Rumbleball View Post

                            should work. Do you feed the correct UV channel? Code snipped would be good as well.

                            Try a basic material. Just a texture, nothing fancy.
                            I'm only using one UV channel. Setting it like so:

                            Code:
                            mesh->SetSectionMaterial(0, material);
                            mesh->CreateMeshSection(0, vertices, triangles, normals, UVs, vertexColors, tangents, true, EUpdateFrequency::Infrequent);
                            Here's the code I use for creating the PMC mesh with no issues:

                            Code:
                            mesh->SetMeshSectionCollisionEnabled(0, true);
                             mesh->CreateMeshSection_LinearColor(0, vertices, triangles, normals, UVs, vertexColors, tangents, true);
                             mesh->SetMaterial(0, material);
                            When building the RMC mesh, I have to change the vertexColor and tangent arrays since they use a different structure than the PMC

                            Code:
                            TArray<FColor> vertexColors vertexColors;
                            // instead of
                            TArray<FLinearColor> vertexColors;
                            
                            TArray<FRuntimeMeshTangent> tangents;
                            // instead of
                            TArray<FProcMeshTangent> tangents;
                            I should note that when using the PMC I pass in an empty tangent array. I have tried that with RMC as well, but it makes no difference.

                            I'll attempt a basic texture and see how that goes.

                            Comment


                              Originally posted by CashCache View Post

                              I'm only using one UV channel. Setting it like so:
                              ...
                              Click image for larger version

Name:	RMCMaterialTest.PNG
Views:	219
Size:	483.0 KB
ID:	1506603
                              NodePrefabs | PluginBuilder | NotificationBackbone | WidgetBox | DebugWidget

                              Comment


                                There's clearly a shading issue with RMC on 4.20 right now. Comparison with ProceduralMeshComponent :

                                LinkedIn | Link custom Shaders | Atmosphere Modelisation & Procedural Planets | Distance Matching Locomotion | Nvidia GameWorks builds - 4.19.2 : VXGI2.0, Blast, HairWorks, Flow - Plugins: VictoryBP

                                Comment

                                Working...
                                X