Posts: 44
Threads: 14
Joined: Dec 2017
I'm trying to use curvy to make some small detail objects, like cables or wires, that are only 1 or 2 cm in diameter.
In Shape Extrusion > Cross I'm turning off optimise and putting the resolution at 100% but the resulting mesh seems to be optimised to 2 points in shape (a flat mesh) instead of a tube like shape.
Am I missing something here? Is it possible to work with Curvy at small scales?
Posts: 1,844
Threads: 77
Joined: Jun 2017
Hi,
Yes, Curvy can be used with small scaled shapes. You will need to increase the density of the cached spline points. Please select your shape, and in the inspector increase it's Cache Density to 100.
Did it work? If not, what is the radius of your shape?
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Posts: 44
Threads: 14
Joined: Dec 2017
Hi,
I tried to change the density but it didn't seem to have any effect, the mesh is optimised instead of a tube like shape. The radius is 0.01~0.06 (1 to 6cm)
Posts: 1,844
Threads: 77
Joined: Jun 2017
You are right, it didn't work as expected for things this small.
This bug will be fixed in the next curvy version. But for now, here is a quick fix for you:
In SplineInputModulBase.cs, line 146, replace
Code: raster.Resolution = Mathf.Max(raster.Resolution, 2);
with
Code: raster.Resolution = Mathf.Max(raster.Resolution, Mathf.Max(spline.CacheSize, 2));
For a 1cm radius circle with the default cache density value, it will produce a wire with a triangular cross section. I think that most games don't want to waste more polygons on something that small. But if you need Curvy to produce more detailed mesh, let me know and I will show you how.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Posts: 44
Threads: 14
Joined: Dec 2017
02-08-2018, 10:27 AM
(This post was last modified: 02-08-2018, 10:35 AM by hawken.)
Thanks for the code, I replaced but as you say its now just a triangle profile. Ideally I'd like a more detailed mesh at this scale, is it possible to turn off optimisation at scale?
here on a 1m sq plane
Posts: 1,844
Threads: 77
Joined: Jun 2017
Yes it is possible. You will need to set a higher value to the Max Cache PPU setting. A value of 20, combined with a Cache Density of 100, should be enough for your usage.
undefined
I strongly advise you to read the Curvy documentation about caching to be aware of the impacts of changing the Max Cache PPU.
There is a known issue with standalone builds when changing Max Cache PPU. It is described here, with a work around. I don't know if the same issue happens for IOS builds. If it does, the workaround concept can be applied on IOS builds too.
I am planning to fix this issue in the next update.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Posts: 44
Threads: 14
Joined: Dec 2017
02-09-2018, 03:18 AM
(This post was last modified: 02-09-2018, 03:38 AM by hawken.)
(02-08-2018, 01:36 PM)_Aka_ Wrote: Yes it is possible. You will need to set a higher value to the Max Cache PPU setting. A value of 20, combined with a Cache Density of 100, should be enough for your usage.
undefined
I strongly advise you to read the Curvy documentation about caching to be aware of the impacts of changing the Max Cache PPU.
There is a known issue with standalone builds when changing Max Cache PPU. It is described here, with a work around. I don't know if the same issue happens for IOS builds. If it does, the workaround concept can be applied on IOS builds too.
I am planning to fix this issue in the next update.
Thanks for this, the documentation goes in to some detail about working in different scales, 20 certainly is enough for the shape, but the path is still low resolution (I'm assuming this is because the angle threshold only goes down to 10cm)
Is there a way to make the angle threshold lower (1cm or so?) I tried to change in BuildShapeExtrusion.cs AngleThreshold but it didn't change
Posts: 1,844
Threads: 77
Joined: Jun 2017
02-09-2018, 02:39 PM
(This post was last modified: 02-09-2018, 05:36 PM by _Aka_.)
(02-09-2018, 03:18 AM)hawken Wrote: Is there a way to make the angle threshold lower (1cm or so?) The angle is measured in degrees. Thinking about it as a distance will just confuse you. Think about it as the minimal angle between two rasterized points on the spline. The minimal value of 0.1 degrees is small enough for any reasonable real-time 3D mesh. The issue you encounter comes from something else: the "Min Distance" parameter in the Curvy Generator's inspector
As the tooltip says, this is the "Minimum distance between rasterized sample points". Its default value is 0.1m (10 cm), which is too high for your scenario. Lower it and you will have a more detailed (as long as the input spline is also detailed, which is your case already).
I will try, in an upcoming update, to make it simpler to parameter the Curvy Generator to generate very detailed meshes for users who want to work with very small objects like you.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Posts: 44
Threads: 14
Joined: Dec 2017
(02-09-2018, 02:39 PM)_Aka_ Wrote: (02-09-2018, 03:18 AM)hawken Wrote: Is there a way to make the angle threshold lower (1cm or so?) The angle is measured in degrees. Thinking about it as a distance will just confuse you. Think about it as the minimal angle between two rasterized points on the spline. The minimal value of 0.1 degrees is small enough for any reasonable real-time 3D mesh. The issue you encounter comes from something else: the "Min Distance" parameter in the Curvy Generator's inspector
As the tooltip says, this is the "Minimum distance between rasterized sample points". Its default value is 0.1m (10 cm), which is too high for your scenario. Lower it and you will have a more detailed (as long as the input spline is also detailed, which is your case already).
I will try, in an upcoming update, to make it simpler to parameter the Curvy Generator to generate very detailed meshes for users who want to work with very small objects like you.
I see thank you!!
Posts: 44
Threads: 14
Joined: Dec 2017
02-12-2018, 08:16 AM
(This post was last modified: 02-12-2018, 08:17 AM by hawken.)
(02-08-2018, 01:36 PM)_Aka_ Wrote: Yes it is possible. You will need to set a higher value to the Max Cache PPU setting. A value of 20, combined with a Cache Density of 100, should be enough for your usage.
undefined
I strongly advise you to read the Curvy documentation about caching to be aware of the impacts of changing the Max Cache PPU.
There is a known issue with standalone builds when changing Max Cache PPU. It is described here, with a work around. I don't know if the same issue happens for IOS builds. If it does, the workaround concept can be applied on IOS builds too.
I am planning to fix this issue in the next update.
yes it seems this doesn't let Unity build to iOS, I get the following error:
Code: NullReferenceException: Object reference not set to an instance of an object
FluffyUnderware.Curvy.Generator.CGModule.GetManagedResources (System.Collections.Generic.List`1& components, System.Collections.Generic.List`1& componentNames) (at Assets/Packages/Curvy/Base/CG/CGModule.cs:697)
FluffyUnderware.Curvy.Generator.CGModule.OnDestroy () (at Assets/Packages/Curvy/Base/CG/CGModule.cs:318)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
|