Announcement

Collapse
No announcement yet.

Trunk Split Feature, or is it even possble?

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

  • Trunk Split Feature, or is it even possble?

    Hello my dilemma is quite unique,

    I'm making a top down RPG in UE4, love how the models turn out but, we are working on getting the tree mesh to disappear when the player character is obstructed by i and wanting to have it leave behind a cross section of that tree mesh (the trunk essentially) that is still visible.

    Here is my issue, I'm only able to export to UE4 with my UE4 sub, then attempting to export the mesh from UE4 to Studio max to make the edits needed to split the mesh in to it's 2 parts (the top and the trunk) causes ALL material ID's originally on the mesh to be removed leaving only 1 material (the bark).
    It's absolutely excruciatingly painstaking and a time thief to manually select every single leaf mesh in Studio max just to apply a new material ID to them that was originally lost on export.

    So far I have found no way around this issue, which makes a straight forward process of creating trees a nightmare.
    it would be nice to have an option in Speedtree to split the trunk spline in to two parts for exporting to UE4 to avoid the entire mess.
    Or an option added with the UE4 license to export to Studio Max for editing (keeping the assigned materials in tact) so the edits to the mesh can be made prior to importing to UE4.

    I've scoured the UE4 forums and no one has any answers other then just modeling the trees yourself which I can do but kinda defeats the purpose of using Speedtree.
    Anyone else run in to this issue and found a way around it?

    Much appreciated in advance for any advice.

  • #2
    Hello,

    Exporting to any static mesh format will lose everything that makes it a SpeedTree instead of just a mesh. You also lose wind and smooth LOD, etc.

    If I am understanding you correctly, you just want to hide the leaves but not the trunk/branches? The branches are usually a separate material from the leaves anyway. You could add a material parameter to the atlassed material(s) that is multiplied by the opacity before it goes to the material node. The default value should be 1, but if you ever want to hide them, just set it to 0 in blueprint/code. This should be much easier than having to deal with 2 meshes everywhere for each tree (and it will still work with instanced foliage, etc).

    Comment


    • #3
      Setting the Opacity to 0 would hide the leaves, but it would still incur a rendering cost and contribute to overdraw, no?

      Comment


      • #4
        You'll still be doing vertex processing, but it will still be faster than rendering the tree as normal. And this only happens sometimes when a tree gets between the player and camera, which is only occasionally? Playing with opacity can also let you fade it in/out smoothly instead of popping, too.

        But you probably could access the materials or elements in the tree as you render to disable the leaf ones, but that would be more complicated and I'm not sure how much access there is to do that in blueprint.

        Comment


        • #5
          So, my programmer and I came to a solution, it's not ideal as you still have the bottom trunk geo of the whole tree and the geo of a modified trunk that was cut in half running at the same time in a blueprint in UE4, but it's practical and gets the job done.

          I basically exported my speedtree model out of UE4 cut it where I wanted the tree to split, copied the new geo I built for the tree rings, attached them as one object maintaining 2 material id's, and reimported it into UE4. I sized it up and matched it up with the speedtree model and my programmer did some code for a shader which would fade the mesh upon camera ray race detection.

          As far as the LODs go UE4's LOD system seems to do a decent job crunching the polys without and discernable popping on the reimported mesh.

          It works and we get the desired effect just wish we didn't have all that extra geo on the whole model waisted. And the process is teiduos.
          Last edited by Apoc1980; 05-12-2018, 01:15 PM.

          Comment

          Working...
          X