Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Delete CurvySplineSegment from the start of a Spline causes UV's to change
#1
Brick 
Hello,

I am building an infinite runner and using the samples I have built a nice track that produces spline segments and the game runs well, however
I want to be able to delete spline segments at the start of the spline as the infinite runner progresses to reduce memory consumption as we'll
never be heading back to that location.

My problem is when I delete spline segments even far away, sometimes there's a small UV shake/regeneration of UV's /mesh and this is quite visibly annoying
when running. 


What I've tried so far is that segments that are quite far away to avoid the mesh changing but the UV's still change at times.

Was wondering if it's possible to delete a CurvySplineSegment at the start of a CurvySpline without the UV's shaking/changing. 

This issue is not there when I called the InsertAfter method and add a CurvySplineSegment

Any help would be much appreciated

Thank you
Reply
#2
Hi
A solution is to do something like what is done in scene 51_InfiniteTrack, which is to have multiple generators (4 in that scene) each one representing a section of the spline, and then moving those generators instead of moving the CPs of the spline.
Other than that, I guess that by computing exactly what length of the spline is deleted due to the deletion of the first CP, you can deduce by how much you should modify the UV offset parameter to avoid the visible change of UVs. That parameter is in the Volume Mesh module. This recent post might help: https://forum.curvyeditor.com/thread-1441.html
Have a nice day
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
Thank you for your reply,

I had not noticed there were 4 generators in the 51_InfiniteTrack example. I think this solution of moving generators will work well for me. Second solution is too
difficult as I'm using Game mesh object generation and deform, not the volume Mesh module.

Will try this and you can consider this solved because it looks like it won't be a big deal to implement. Will reply to thread again if I get stuck. Thanks once again
Reply
#4
Hi,

Unfortunately I just realized I don't use the BuildVolumeMesh module, I am instead using the GameObjectToMesh and DeformMesh module and this doesn't seem to have a way to
set the UVOffset that I am aware off on MaterialSetttings. (Btw, there's a typo in MaterialSetttings of the BuildVolumeMesh module in the source code)

Is there a way to set the UV offset so that I can use multiple generators for the DeformMesh/GameObjectToMesh module?

Thank you
Reply
#5
Hi,

I found a way to make GameObjectToMesh beautifully without multiple generators. I simply disable autoRefresh, then I also don't refresh when I delete a segment and I refresh whenever I add a new segment
and during that stage for some reason whatever segments (Control points) that got deleted then don't affect the UV's when the generator is refreshed after adding new control points!

Hope this helps anyone who might run into the same issue.

Thanks once again!
Reply
#6
Glad that the problem was solved.
Indeed MaterialSetttttttings Wink is present only when generating a new mesh via extrusion, since its UVs are to be defined. When deforming existing meshes, the object already has UVs.
If and when you feel like it, please leave a review for the asset, that helps a lot.
Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Odd behavior when drawing spline ricke 9 12 11-28-2022, 10:34 AM
Last Post: _Aka_
  Input Spline Shapes from Prefabs destroys graph tairoark 5 6 11-24-2022, 05:08 PM
Last Post: _Aka_
  Scale Deform Mesh Along Spline? / aligning colliders MamasToast 9 61 10-31-2022, 03:44 AM
Last Post: tairoark
  Gap between spline mesh segments Beaver_Boy 13 66 10-24-2022, 09:37 AM
Last Post: dromo

Forum Jump: