Announcement

Collapse
No announcement yet.

Runtime Mesh Component

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

    Originally posted by wilberolive View Post
    [MENTION=141752]Koderz[/MENTION] - So I eventually got everything compiling and running. Those warnings from my previous post are still there though. Looks like the build files haven't been updated as needed.

    I was so excited to upgrade as I thought I might finally get rid of that annoying bug I have... but to my great devastation, I'm still hitting that same exception breakpoint every time I try to use RMC for the first time. See my other previous post from a while ago about it. It breaks out to VS at some exception breakpoint in the engine code. I then have to click Continue to keep going. Then I can continue using RMC with no problems until I stop the current game and then click play again. Then it happens all over again. So frustrating when you have to click play, let it break to VS, click continue in VS, then go about testing your game... like 100 times a day.

    I've tried different engine versions as well as creating new fresh projects. It was all working amazingly for me back in 4.14. Don't understand why I'm seemingly the only person hitting this problem, unless nobody else uses RMC in C++... surely not. If you use it just in BP then there is no issue.

    I remember you saying that you fixed this issue... was that for v3 though?
    Yeah, forgot about the warnings, and not much point in pushing a whole new update to fix just that.

    As for the other, I've never seen it and I only work with it from C++. It has to be specific to something you're doing differently that it's not liking but I don't know what it would be. I'm still on 4.15 for work project, but work with 4.16 and 4.17 almost daily now working on the new RMC. Not sure what would cause that though. For materials the RMC should be setup almost identically to the PMC.
    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


      [MENTION=141752]Koderz[/MENTION] - So I've worked out what the problem is. It turns out you cannot set a material on a mesh section if that mesh section either doesn't exist already or is not created in the same tick.

      My actors add an empty RMC to themselves in the constructor. No materials or mesh sections are set at this point. Later on as the game dictates for a given actor, a material needs to be set and a mesh section needs to be created. The problem is that these two conditions are not met in exactly the same tick. For example, the player may choose a material and then it takes a few ticks before the mesh section needs to be created.

      So the problem was that I was setting a material into slot 0 on the RMC, but I'm guessing slot 0 doesn't exist as there is no mesh section yet. However if I force it to create the mesh section in the same tick, then it works fine. Even if I set the material before creating the mesh section. This explains why it would fail the first time and then work each time after that as the mesh section was now created.

      Unfortunately, I cannot set the material and create the mesh section in the same tick. So to get around the problem I need to create a dummy mesh section in the constructor, so the RMC is not empty. To do this, I'm just using three vertices all at the world origin so they effectively make an invisible triangle and then create a mesh section from that. This ensures that material slot 0 exists and I can then set the material when needed. Later on, when the real mesh section is created, it simply overwrites the three dummy vertices.

      So, not an ideal solution, but I can't think of any other way around this issue. I'm not sure if this is a bug with RMC or just a limitation?

      Comment


        Originally posted by wilberolive View Post
        Don't understand why I'm seemingly the only person hitting this problem, unless nobody else uses RMC in C++... surely not.
        I also saw that issue, and I just fixed it with commenting out that ensure in the source, that ensure is just for telling you that something is wrong, but since everything works, its just not needed. If you don't want to edit the UE4 source, you obviously can't just comment it out.

        And the reason why it's only "failing" once is that ensures in general in UE4 are only breaking execution on the first time they are called. Later, they are ignored.
        Easy to use UMG Mini Map on the UE4 Marketplace.
        Forum thread: https://forums.unrealengine.com/show...-Plug-and-Play

        Comment


          Originally posted by wilberolive View Post
          [MENTION=141752]Koderz[/MENTION] - So I've worked out what the problem is. It turns out you cannot set a material on a mesh section if that mesh section either doesn't exist already or is not created in the same tick.

          My actors add an empty RMC to themselves in the constructor. No materials or mesh sections are set at this point. Later on as the game dictates for a given actor, a material needs to be set and a mesh section needs to be created. The problem is that these two conditions are not met in exactly the same tick. For example, the player may choose a material and then it takes a few ticks before the mesh section needs to be created.

          So the problem was that I was setting a material into slot 0 on the RMC, but I'm guessing slot 0 doesn't exist as there is no mesh section yet. However if I force it to create the mesh section in the same tick, then it works fine. Even if I set the material before creating the mesh section. This explains why it would fail the first time and then work each time after that as the mesh section was now created.

          Unfortunately, I cannot set the material and create the mesh section in the same tick. So to get around the problem I need to create a dummy mesh section in the constructor, so the RMC is not empty. To do this, I'm just using three vertices all at the world origin so they effectively make an invisible triangle and then create a mesh section from that. This ensures that material slot 0 exists and I can then set the material when needed. Later on, when the real mesh section is created, it simply overwrites the three dummy vertices.

          So, not an ideal solution, but I can't think of any other way around this issue. I'm not sure if this is a bug with RMC or just a limitation?
          I'm conquering the same issue. Unfortunately I'm not able to solve it they you were able to. It happens on my end after clearing and than creating the section + setting the material again. To solve it, I just made sure the create + set material is happing only once.
          NodePrefabs | PluginBuilder | NotificationBackbone | WidgetBox | DebugWidget

          Comment


            Originally posted by wilberolive View Post
            [MENTION=141752]Koderz[/MENTION] - So I've worked out what the problem is. It turns out you cannot set a material on a mesh section if that mesh section either doesn't exist already or is not created in the same tick.

            My actors add an empty RMC to themselves in the constructor. No materials or mesh sections are set at this point. Later on as the game dictates for a given actor, a material needs to be set and a mesh section needs to be created. The problem is that these two conditions are not met in exactly the same tick. For example, the player may choose a material and then it takes a few ticks before the mesh section needs to be created.

            So the problem was that I was setting a material into slot 0 on the RMC, but I'm guessing slot 0 doesn't exist as there is no mesh section yet. However if I force it to create the mesh section in the same tick, then it works fine. Even if I set the material before creating the mesh section. This explains why it would fail the first time and then work each time after that as the mesh section was now created.

            Unfortunately, I cannot set the material and create the mesh section in the same tick. So to get around the problem I need to create a dummy mesh section in the constructor, so the RMC is not empty. To do this, I'm just using three vertices all at the world origin so they effectively make an invisible triangle and then create a mesh section from that. This ensures that material slot 0 exists and I can then set the material when needed. Later on, when the real mesh section is created, it simply overwrites the three dummy vertices.

            So, not an ideal solution, but I can't think of any other way around this issue. I'm not sure if this is a bug with RMC or just a limitation?
            Thanks for the info! I'll see what can be done in v3. Will probably need to figure out a way to fix that as v3 is being setup to explicitly handle creating empty sections for your type situations so that might actually become more of a problem without something to get around it.


            On that note, I'm actually coming close to completing the core of v3! Will have more info soon!
            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


              I'm in the process of updating to UE4.16. Im stuck at the changes to the build.cs files

              Code:
              2>C:\Program Files\Epic Games\UE_4.16\Engine\Plugins\Marketplace\RuntimeMeshComponent\Source\RuntimeMeshComponent\RuntimeMeshComponent.Build.cs : warning : Module constructors should take a ReadOnlyTargetRules argument (rather than a TargetInfo argument) and pass it to the base class constructor from 4.15 onwards. Please update the method signature.
              2>C:\Program Files\Epic Games\UE_4.16\Engine\Plugins\Marketplace\RuntimeMeshComponent\Source\RuntimeMeshComponentEditor\RuntimeMeshComponentEditor.Build.cs : warning : Module constructors should take a ReadOnlyTargetRules argument (rather than a TargetInfo argument) and pass it to the base class constructor from 4.15 onwards. Please update the method signature.
              2>C:\Program Files\Epic Games\UE_4.16\Engine\Plugins\Marketplace\RuntimeMeshComponent\Source\RuntimeMeshComponentSlicer\RuntimeMeshComponentSlicer.Build.cs : warning : Module constructors should take a ReadOnlyTargetRules argument (rather than a TargetInfo argument) and pass it to the base class constructor from 4.15 onwards. Please update the method signature.
              Having this issue with some more plugins as well. I gues it was changed in the plugin for the 4.16 release? Just want to make sure it is changed in the code that was submitted. But I would gues it is cause non else mentioned issues?

              I downloaded the plugin via the launcher (Marketplace) on two different PCs. Both downloads are missing that change.

              C:\Program Files\Epic Games\UE_4.16\Engine\Plugins\Marketplace\RuntimeMeshComponent\Source\RuntimeMeshComponent\RuntimeMeshComponent.Build.cs
              Code:
              // Copyright 2016 Chris Conway (Koderz). All Rights Reserved.
              
              using UnrealBuildTool;
              
              public class RuntimeMeshComponent : ModuleRules
              {
              	public RuntimeMeshComponent(TargetInfo Target)
              	{
                      PrivateIncludePaths.Add("RuntimeMeshComponent/Private");
                      PublicIncludePaths.Add("RuntimeMeshComponent/Public");
              
                      PublicDependencyModuleNames.AddRange(
                              new string[]
                              {
                                      "Core",
                                      "CoreUObject",
                                      "Engine",
                                      "RenderCore",
                                      "ShaderCore",
                                      "RHI"
                              }
                          );
                  }
              }

              And here the version file. Did the launcher download the correct version?
              C:\Program Files\Epic Games\UE_4.16\Engine\Plugins\Marketplace\RuntimeMeshComponent\Source\RuntimeMeshComponent\Public\RuntimeMeshVersion.h
              Code:
              // Copyright 2016 Chris Conway (Koderz). All Rights Reserved.
              
              #pragma once
              
              #include "RuntimeMeshComponentPlugin.h"
              
              
              // Custom version for runtime mesh serialization
              namespace FRuntimeMeshVersion
              {
              	enum Type
              	{
              		Initial = 0,
              		TemplatedVertexFix = 1,
              		SerializationOptional = 2,
              		DualVertexBuffer = 3,
              
              		SerializationV2 = 4,
              
              		// -----<new versions can be added above this line>-------------------------------------------------
              		VersionPlusOne,
              		LatestVersion = VersionPlusOne - 1
              	};
              
              	// The GUID for this custom version
              	const static FGuid GUID = FGuid(0xEE48714B, 0x8A2C4652, 0x98BE40E6, 0xCB7EF0E6);
              };
              NodePrefabs | PluginBuilder | NotificationBackbone | WidgetBox | DebugWidget

              Comment


                Originally posted by Koderz View Post
                On that note, I'm actually coming close to completing the core of v3! Will have more info soon!
                I'm very excited to see what v3 will bring to the table! i hope for a deep blueprint integration, as i'm heavily relying on your plugin with my current project!

                Comment


                  Originally posted by Rumbleball View Post
                  I'm in the process of updating to UE4.16. Im stuck at the changes to the build.cs files

                  Code:
                  2>C:\Program Files\Epic Games\UE_4.16\Engine\Plugins\Marketplace\RuntimeMeshComponent\Source\RuntimeMeshComponent\RuntimeMeshComponent.Build.cs : warning : Module constructors should take a ReadOnlyTargetRules argument (rather than a TargetInfo argument) and pass it to the base class constructor from 4.15 onwards. Please update the method signature.
                  2>C:\Program Files\Epic Games\UE_4.16\Engine\Plugins\Marketplace\RuntimeMeshComponent\Source\RuntimeMeshComponentEditor\RuntimeMeshComponentEditor.Build.cs : warning : Module constructors should take a ReadOnlyTargetRules argument (rather than a TargetInfo argument) and pass it to the base class constructor from 4.15 onwards. Please update the method signature.
                  2>C:\Program Files\Epic Games\UE_4.16\Engine\Plugins\Marketplace\RuntimeMeshComponent\Source\RuntimeMeshComponentSlicer\RuntimeMeshComponentSlicer.Build.cs : warning : Module constructors should take a ReadOnlyTargetRules argument (rather than a TargetInfo argument) and pass it to the base class constructor from 4.15 onwards. Please update the method signature.
                  Having this issue with some more plugins as well. I gues it was changed in the plugin for the 4.16 release? Just want to make sure it is changed in the code that was submitted. But I would gues it is cause non else mentioned issues?

                  I downloaded the plugin via the launcher (Marketplace) on two different PCs. Both downloads are missing that change.

                  C:\Program Files\Epic Games\UE_4.16\Engine\Plugins\Marketplace\RuntimeMeshComponent\Source\RuntimeMeshComponent\RuntimeMeshComponent.Build.cs
                  Code:
                  // Copyright 2016 Chris Conway (Koderz). All Rights Reserved.
                  
                  using UnrealBuildTool;
                  
                  public class RuntimeMeshComponent : ModuleRules
                  {
                  	public RuntimeMeshComponent(TargetInfo Target)
                  	{
                          PrivateIncludePaths.Add("RuntimeMeshComponent/Private");
                          PublicIncludePaths.Add("RuntimeMeshComponent/Public");
                  
                          PublicDependencyModuleNames.AddRange(
                                  new string[]
                                  {
                                          "Core",
                                          "CoreUObject",
                                          "Engine",
                                          "RenderCore",
                                          "ShaderCore",
                                          "RHI"
                                  }
                              );
                      }
                  }

                  And here the version file. Did the launcher download the correct version?
                  C:\Program Files\Epic Games\UE_4.16\Engine\Plugins\Marketplace\RuntimeMeshComponent\Source\RuntimeMeshComponent\Public\RuntimeMeshVersion.h
                  Code:
                  // Copyright 2016 Chris Conway (Koderz). All Rights Reserved.
                  
                  #pragma once
                  
                  #include "RuntimeMeshComponentPlugin.h"
                  
                  
                  // Custom version for runtime mesh serialization
                  namespace FRuntimeMeshVersion
                  {
                  	enum Type
                  	{
                  		Initial = 0,
                  		TemplatedVertexFix = 1,
                  		SerializationOptional = 2,
                  		DualVertexBuffer = 3,
                  
                  		SerializationV2 = 4,
                  
                  		// -----<new versions can be added above this line>-------------------------------------------------
                  		VersionPlusOne,
                  		LatestVersion = VersionPlusOne - 1
                  	};
                  
                  	// The GUID for this custom version
                  	const static FGuid GUID = FGuid(0xEE48714B, 0x8A2C4652, 0x98BE40E6, 0xCB7EF0E6);
                  };
                  I'll try to push a fix for a few things like this within the week. I will though say those are just warnings, they won't stop you from compiling.


                  Originally posted by a_prototype View Post
                  I'm very excited to see what v3 will bring to the table! i hope for a deep blueprint integration, as i'm heavily relying on your plugin with my current project!
                  Blueprints are something I want to support better, but to be completely fair, most real mesh generation scenarios are better done in c++.
                  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


                    Just throwing my support behind v3. Can't wait to see how this turns out. I do all my mesh generation in C++. It is way easier to write all the math in code than use blueprints for the elaborate meshes I generate.

                    Comment


                      Yes i figured that writing mesh generation code in c++ has a lot of advantages. I'm using RMC for a very interactive setup though and using blueprint enables me to more rapidly prototype my ideas. i hope to be able to share some info on my project in the next few months.

                      Comment


                        Originally posted by Koderz View Post
                        I'll try to push a fix for a few things like this within the week. I will though say those are just warnings, they won't stop you from compiling.
                        Thanks for that hint. There was an error further down the log. Usually I work the stuff top to bottom to get rid of everything.
                        NodePrefabs | PluginBuilder | NotificationBackbone | WidgetBox | DebugWidget

                        Comment


                          Hi everyone. I've been using Runtime Mesh Components for some time, and something has changed in my build (not sure when it changed). I have custom panels created with RMC, but they are not rendering in the Z PrePass (I'm pretty sure they used to, back in the 4.14 days?) I'm on 4.16 now, and using RenderDoc, I can see that they no longer are part of the depth pre-pass, and thus I'm getting a lot of overdraw, which is killing my performance. I have "Render in Main Pass" checked. Any ideas what could be wrong? Anything I should check? This is a VR app, so performance is crucial.

                          Comment


                            Nevermind. It has something to do with my material and not anything to do with RMC. (I tried my material on a regular static mesh and it is no longer in the Z prepass either) Sorry for the noise here, though any side suggestions to my problem would be most appreciated

                            Comment


                              Originally posted by Dustums View Post
                              Nevermind. It has something to do with my material and not anything to do with RMC. (I tried my material on a regular static mesh and it is no longer in the Z prepass either) Sorry for the noise here, though any side suggestions to my problem would be most appreciated
                              Actually, I spoke too soon about speaking too soon. It seems that if you use a Pixel Depth Offset in a shader, even a regular static mesh won't render in the Z Pre-Pass. However, RMC won't render in the Z Pre-Pass even with a simple shader that doesn't use PDO. RMCs do render in the Z Pre-Pass if using the Forward Renderer, but I need to use the Deferred Renderer for my project. Is there any way to get a RMC to render in the Z Pre-Pass with a Deferred Renderer? Am I missing something? I've even set "Early Z-pass" to "Opaque and Masked Meshes" under Project Settings->Rendering->Optimizations, but that didn't seem to help.

                              Comment


                                Another issue with simple collision here with UE 4.16.2 and the RMC from the marketplace. Basically the procedural meshes apparently have no collision or at least I every time I use the blueprint function "GetClosestPointOnCollision" for them I get the error "LogPhysics:Warning: GetDistanceToBody: Component (/Game/Maps/UEDPIE_0_evaluation.evaluation:PersistentLevel.Room_7.Floor) has no simple collision and cannot be queried for closest point."

                                I have an own class, that has a couple of RuntimeMesh Components defined like this:

                                UPROPERTY(EditAnywhere, BlueprintReadWrite)
                                URuntimeMeshComponent* Floor;

                                and initialized like that in the class constructor:

                                Floor = CreateDefaultSubobject<URuntimeMeshComponent>(TEXT("Floor"));

                                In the runtime I do

                                Floor->CreateMeshSection(0, Vertices, Triangles, Normals, UVs, VertexColors, Tangents, true);
                                Floor->SetRelativeLocation(delta);

                                and leave it like that.

                                Here is how the component details look like in the editor:
                                Click image for larger version

Name:	UE_RuntimeMesh_collision.PNG
Views:	1
Size:	142.0 KB
ID:	1131902

                                There was somewhere a report that having only one RuntimeMesh component in the class solves the issue, but it didn't for me.

                                Any hints towards solution for this issue will be appreciated!
                                Last edited by Mtimofeev; 08-01-2017, 05:42 PM.

                                Comment

                                Working...
                                X