07-31-2022, 08:22 PM
Hi
I hope this helped
Have a nice day
- I have a more precise tangent computing code that in my tests removed the gap between meshes in some cases, but other cases still have the gap, but less visible it seems. Give it a try:
Go to the following method in CurvySplineSegment
and add the following at its startCode:public Vector3 GetTangent(float localF, Vector3 position, Space space = Space.Self)
As you can see if you check the code, the current implementation is computing the tangent by computing the delta between two very close points. The code above uses a specific implementation for Bezier splines.Code:if (Spline.Interpolation == CurvyInterpolation.Bezier)
return CurvySpline.BezierTangent(threadSafeLocalPosition.Addition(HandleOut),
threadSafeLocalPosition,
threadSafeNextCpLocalPosition,
threadSafeNextCpLocalPosition.Addition(cachedNextControlPoint.HandleIn),
localF).normalized;
- The handles you compute seem weird to me. It seems that, at least in some cases, the spline's first CP has a zero length handle, while the second one has a non zero length handle. This leads to a stretched spline, which you can notice from the UVs being stretched at the end of the mesh. Maybe solving this will solve the gap in mesh.
- This is not a solution, but as long as you are trying to fight the issue, it might be wise to set to false the Optimize parameter in the Shape Extrusion module, under the Path tab. Once the problem solved, you might then set Optimize back to true, and see if there are any regressions
- FYI, the tangents are computed when the mesh is rasterized in the Input Spline Path module. The equivalent class is InputSplinePath. The rasterization happens in its base class, SplineInputModuleBase, in its GetSplineData method. Look for the calls to InterpolateAndGetTangent in that method, that's where things happen.
Those tangents are then used by the Shape Extrusion module to make the mesh volume. Look for BuildShapeExtrusion.Refersh(), and specifically its usage of path.Directions (the list of tangents of each rasterized point).
- To go back to the unique mesh solution: you know your use case better than me, so you are probably right when you say that this solution is not fit for your use case. But please allow me to add some points that might make that solution viable in your eyes. If these points are invalid, you don't need to take the time to explain to me why:
You can use the Split parameter in the Volume Mesh module to split that single mesh into different meshes. The split meshes will not have the issue. The issue seems to come from using different extrusions with different splines. Single spline -> Single mesh extrusion -> Split Volume -> Different meshes with no gaps
About joining track, you can concatenate your different track splines into one spline, then generate a single extrusion out of it.
I hope this helped
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.