Announcement

Collapse
No announcement yet.

Runtime Mesh Component

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

  • replied
    Thanks, Koderz, this looks really good. I'm curious though. It seems not to have an equivalent 'Get Section from Procedural Mesh' node (I'm using blueprints atm). I'm not sure how to update an existing mesh in realtime without it. Am I missing something obvious?

    Leave a comment:


  • replied
    Originally posted by bishop86 View Post

    Managed to build, but now when I try to copy a static mesh to runtime mesh I get 'assertion failed'. It's only happening with one mesh though, other meshes work fine. The mesh works fine with the procedural mesh component though...
    Make sure all meshes you want to retrieve the mesh data from are CPU accessible. Open the static mesh in question and use the search bar to search for "CPU".

    Leave a comment:


  • replied
    Originally posted by bishop86 View Post
    Is it possible to use this with the 4.19 flex version of unreal? I've added the plugin to my project but having problems building.
    Managed to build, but now when I try to copy a static mesh to runtime mesh I get 'assertion failed'. It's only happening with one mesh though, other meshes work fine. The mesh works fine with the procedural mesh component though...

    Leave a comment:


  • replied
    Is it possible to use this with the 4.19 flex version of unreal? I've added the plugin to my project but having problems building.

    Leave a comment:


  • replied
    Originally posted by MaximumDup View Post
    There's clearly a shading issue with RMC on 4.20 right now. Comparison with ProceduralMeshComponent :
    I'm having the same issue. It looks like all vertex normal values are coming out positive (comparison shown with a default static cube):

    Leave a comment:


  • replied
    Originally posted by CashCache View Post

    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);
    Try setting the material after CreateMeshSection().

    Leave a comment:


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

    Leave a comment:


  • replied
    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:	87
Size:	483.0 KB
ID:	1506603

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    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:	86
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

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    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);
    ...

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    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.

    Leave a comment:

Working...
X