Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LODs
#1
Hi, 

Is there a way to define LODs for generated meshes? For example spline meshes that are more far away from the camera can have a lower spline and crosssection resolution and should have better performance with that.

Also, do you have plans to convert Curvy to DOTS?

Thank you!
Reply
#2
Hi

About LOD: you can either generate offline multiple versions of the mesh, and using usual LOD solutions to switch between them, or make a script that will change in real time the resolution of the shape extrusion based on the distance between the generator and the camera

No plans for DOTS for now, but that doesn't mean that performance is not going to be enhanced in the future. Next big update (8.0.0) will have major optimizations regarding memory usage of generators, allowing for more complex real time modification of generators
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
Sounds good, thanks!

Another question if you don't mind: I'm using the API to spawn splines from dynamic data and need to spawn multiple splines along with meshes generated by the Generator. Is there a way to spawn the generared meshes so that it won't freeze the game? If there is no built-in way, how can I spawn/generate the meshes one by one without having the regenerate/respawn all everytime I do .Refresh on the generator?
Reply
#4
(03-21-2021, 07:59 PM)digot Wrote: Is there a way to spawn the generared meshes so that it won't freeze the game?
The freeze happens when too much work is done while generating the mesh. Reducing that amount of work really depends on each case. What I recommand is:
- if not already done, read this: https://curvyeditor.com/documentation/pe...tips/start
- profile the frame that makes your game freeze, and see what is taking time, and whether you need it. For example, if you don't need a mesh collider, don't generate it, or maybe generate a simpler box collider instead.

(03-21-2021, 07:59 PM)digot Wrote: Is there a way to spawn the generared meshes so that it won't freeze the game? If there is no built-in way, how can I spawn/generate the meshes one by one without having the regenerate/respawn all everytime I do .Refresh on the generator?
Sorry, no automatic way, but you can duplicate your generator, and make each copy generate a parth of the mesh, and make them update alternatively. This is done in InfiniteTrack.cs, used in example scene 51
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#5
Okay so assuming I really need the mesh collider, tangents, etc. and reducing quality and the amount of data processed by the generator is not an option, what else can I do?

Currently I have one generator for about 50 splines (with each spline generating mesh). Would it be better to just use one generator for everything or one generator for one spline? What do you recommend? Also are there any methods that can be called from a different thread to maybe only really have the creation of the final meshes/gameobjects in the game thread?

Thanks by the way for being so supportive and responsive! Smile
Reply
#6
There is unfortunately little you can do that doesn't involve Curvy's code modification. Besides the idea of subdividing the work on multiple generators, and update them at different frames, I don't see much to do. But maybe if I have a look at your scene, I might find something to improve the situation. I am right now in the middle of making some optimizations for Curvy Generator, so sharing your scene might be helpful for me to use as a benchmark

About having a single generator or multiple ones, every generator comes with an overhead, but it is a negligible overhead compared to whatever your generator is doing if it manages to freeze the game.

About multithreading, CG is single threaded right now, and besides modifying Curvy's code, there is nothing you can do to execute a CG in a multithreaded fasion.
Having multithreading in CG is definitely something that could improve the performance. I am not expecting huge performance increase from it, since Unity's methods are very often not allowed to be called from outside, and the nature of the CG implies a sequential order of execution between the different modules, but still things can be further improved with more multithreading.
When Curvy 8.0.0 will be released, one of the new modules in it will execute most of its work in different threads, but nothing major will be done to make the whole Curvy Generator multithreaded.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#7
I understand, thanks for the insights! If you don't mind I have further questions, if you want me to open seperare threads, let me know!

Is it possible to have one controller which moves through the spline while having another controller which is linked to the main controller and being "pulled" by it? I know the train example scenes but if I understand trains correctly then for example at a curve the train has to have different wheel speeds at front and rear axis else the train wouldn't be able to maintain the same length and break apart, which would mean that I can't just use two SplineControllers with the same speed. Is it possible to replicate this behaviour without physics using controllers?

Also a little feature request: After using SplineController.TeleportBy I want to know the MovementDirection of the controller after the teleport and not have it changed backed to the original one. It's at CurvyGenerator.cs line 1027 in my version, I have commented it out for now on my computer, but could you maybe add an optional flag which specifies whether the MovementDirection should be retained or reset?

Thank you!
Reply
#8
Hi
Just to say that due to technical issues, I can't work for now. Will answer you once things get fixed, hopefully before the end of the week.
Thanks for your patience
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#9
(03-23-2021, 02:59 PM)digot Wrote: Is it possible to have one controller which moves through the spline while having another controller which is linked to the main controller and being "pulled" by it? I know the train example scenes but if I understand trains correctly then for example at a curve the train has to have different wheel speeds at front and rear axis else the train wouldn't be able to maintain the same length and break apart, which would mean that I can't just use two SplineControllers with the same speed. Is it possible to replicate this behaviour without physics using controllers?
Well, maybe I am seeing things way simpler than what they are, but I believe that the solution is having a script that will every frame do the following:
Code:
controller2.AbsolutePosition = controller1.AbsolutePosition + distance;

(03-23-2021, 02:59 PM)digot Wrote: Also a little feature request: After using SplineController.TeleportBy I want to know the MovementDirection of the controller after the teleport and not have it changed backed to the original one. It's at CurvyGenerator.cs line 1027 in my version, I have commented it out for now on my computer, but could you maybe add an optional flag which specifies whether the MovementDirection should be retained or reset?
I don't feel like this needs a change in Curvy's API, you can just call TeleportTo, then follow it by
Code:
controller.MovementDirection = oldPosition < controller.Position
                ? MovementDirection.Forward
                : MovementDirection.Backward;
Sure having a new Teleport method including the line above would be useful for you, but in an effort to keep the API as simple (and thus easier to use) possible, I avoid adding new methods if all what they do is simply to call other public methods/properties.
Is my answer satisfying?
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#10
The problem with this is that my the controller navigates over connections and the splines don't all have the same direction (and flipping splines is not an option) so I can't just calculate the direction like you suggested
Reply


Forum Jump: