Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Deforming prefabs with LODs along a spine
#1
Is it possible to deform a prefab with multiple LODs along a spline?

For example I have a tree root prop that I want to curve throughout the level. The prefab consists of the root mesh with several LODs, and a separate moss & leaves mesh with its own LODs.
When I make a Generator with a Deform Gameobject template, the result generates a new mesh that combines all the meshes and lods together into a single object which is then repeated along the spine. While I do want the prefab to be repeated, I dont want everything to be combined into a new mesh like this. Is there any way to preserve the LODs?

If the whole root needs to lod at once I can live with that, but ideally each repeating prefab piece would lod individually so that a very long root can lod in segments as it trails away from the camera.
Reply
#2
Hi
Sorry, I couldn't answer you today, was very busy with the Spring Sales. I will answer you tomorrow. Sorry for the delay.
Have a nice day.
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#3
Hi again,

Yes, it is possible to combine mesh deformation of multiple objects and LOD. This is how I would make it:

  1. Create a template generator that is setup to deform mesh along the needed path.
  2. Supposing you have 2 meshes, and 3 LODs each, make 6 instances of this generator, one for each LOD level/mesh combination. The difference between these generators will be the input mesh. Provide the correct mesh LOD for each generator.
  3. Export the result of your generators (see the "Save output to scene" button in the generator toolbar). This way you can delete the generators if you need to.
  4. Create 2 gamebojects having the LODGroup component: https://docs.unity3d.com/ScriptReference/LODGroup.html
  5. Setup the component to use the meshes from output of your generators.

I will try to make this process easier in the future, by providing for example a Create LOD GameObject, which would take multiple meshes as input, and generate a gameobject having a LODGroup using the given meshes. Any suggestion or feedback is welcome.

Have a nice day
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#4
Thanks, I will give this method a try.
I'll post again with suggestions and feedback once I work out a method that works for my project.
Reply
#5
You are welcome, and thank you for planning to share suggestions and feedback.
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#6
Hello,

I'm currently developing a vast rail network and considering utilizing the "GameObject to Mesh" script from your plugin. However, I've encountered issues with positioning and accidental duplication when attempting to preserve LODs during mesh generation. ( I tried to add the preserve LOD option myself) The process creates parts with LODs, but they're placed incorrectly and result in repetitive spawning.

I'm using an FBX model that contains LOD0 and LOD1 data, and it would be significantly beneficial if the plugin could support direct conversion of tileable LOD GameObjects into meshes. This feature would streamline the process for large-scale environments like the one I'm working on.

Here’s the FBX model I intend to use for further clarity: Link to FBX model.
https://transfer2.beyondfuture.de/s/KbFQxw998gsPXHN

Implementing a feature where users could input GameObjects and convert them directly to mesh while retaining LOD details (option to keep LODs) would be incredibly advantageous. This approach would eliminate the need for complicated workarounds and make the plugin even more robust for large projects.

I appreciate your plugin's current capabilities and believe this addition could enhance its functionality substantially. Given the tight three-week timeline for my project, I would greatly appreciate your thoughts on this potential feature.

Thank you for your time and the continuous development of Curvy.

Best regards,
Max-Georg
Reply
#7
Hi Max-Georg,

This feature will definitely be useful, and I want to implement it in the next big update of Curvy Splines. However, this update is not planned for this summer.

In such cases, I usually suggest implementing the requested feature as a priority through contract work. Given the tight deadline, I am not sure I can implement the feature in under 3 weeks. I am not saying it is impossible. If you are willing to engage in contract work, please let me know so we can discuss this in more detail.

Besides implementing the feature, a workaround exists. To illustrate, please look at the attached scene first:
In it, you have two generators, one for each LOD. The workaround would be to make a script that iterates through both generators' generated GOs. For each pair of generated GOs, create a GO with a LOD Group attached to it, and set it up to use both GOs of the pair.

I hope this helped.
Please let me know if I can help further.

Have a nice day


Attached Files
.unity   LOD test.unity (Size: 3.5 MB / Downloads: 2)
.meta   LOD test.unity.meta (Size: 155 bytes / Downloads: 1)
.meta   240528_Schienen.fbx.meta (Size: 2.61 KB / Downloads: 2)
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  CurvyConnections inside prefabs CoolUser 9 3,884 10-02-2024, 06:41 PM
Last Post: _Aka_
Bug Issues when working with in-place prefabs Sacryn 4 7 02-27-2024, 04:08 PM
Last Post: _Aka_
  Custom CurvySplineSegment prefabs Lupos 1 10 10-02-2023, 09:36 AM
Last Post: _Aka_
  Using Prefabs with transformations reset to original state when using Deform mesh danne_lindwall 3 7 04-28-2023, 01:35 PM
Last Post: _Aka_

Forum Jump: