Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BuildVolumeMesh issue
#1
Hello,

I have two issues:

1) My mesh generator uses two Splines as profiles to be able to change the width of each spline segment from one control point to the next. Currently, the leading profile is seems to have a problem with the mesh that is generated. I have tried to figure out what the problem is without success.  Can you tell me what setting is causing this cut corner on the mesh?

The attached MeshIncorrect shows the issue. The entire project is attached in the zip file UVTest.zip

2) I use KeepAspect.ScaleV to make the texture look good on the surface. But since each of the spline segments have their own generated meshes, I'd like to use UVOffset.Y to adjust the follow on texture so it starts where the previous segments texture ended. The problem is I don't know how to compute the proper value for this given the length of the segment and/or texture size and/or ???   Suggestions?

Picture of what I am trying to do are attached. AlignVs1.jpg shows how the texture don't align at the control point. With AlignVs2.jpg I manually adjust the UVOffset.Y on the follow on segment to show how it should look continuous. How can I calculate this automatically?


Attached Files Thumbnail(s)
           
Reply
#2
Hi
I see in your project that you use the Variable Mix Shapes module to mix between two similar shapes, having only their scale different. In this case, I recommande to instead use the parameters in the Scale Tab of the Shape Extrusion module. It's simpler to setup, takes less CPU power, and avoids the issue you encountered. Does this recommandation fits your needs?
I will take a deeper look at this in the upcoming days.
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 your for the response. Your suggestion simplifies things (one Shape profile instead of two) and gets rid of the bug.

But it also limits what I was also needing to do. I was going to have the 'curb' along the outside of the road built into the shape of the profile. But I don't want want the width of the road to also make the the curb wider as will happen your the suggested approach.

To get around this, is it possible to have a Shape Extrusion align to the outside edge of the volume like a "Volume Spot" does?  This would allow building of separate 'curb' extrusion that follow the outside of the road. This was something I was needed to support 'guard rails' too.

The "Generator" example (that went with the Tutorial video) is no longer included! It provided a useful resource to see how you did things. The 'Wire' in that example is offset from the center of the spline with a TRS Mesh. But I want to offset it from the Volume. Suggestions?
Reply
#4
For issue 1), I tried to see if 8.3 support for "Scale" in Deform Mesh might allow me to align the 'Guard Rail' (or 'Curb') along the edge of an extruded volume ('Track'). The values for "Scale" in the Deform Mesh are set to be the same as the "Scale" value for the 'Track' in the Shape Extrusion.

The results are something not correct at all! I'm not sure if I'm correctly configuring the Deform Mesh even after following the tutorial video (which doesn't really show it's use with "Scale"). My graph visually and as a prefab are attached.

Perhaps you could tell me if the new "Scale" feature can be used to achieve what I desire (issue 1)? If so, how to properly configure it for such use. Otherwise, what might enable this ability?

Thanks...


Attached Files Thumbnail(s)
   

.prefab   Track Geometry Gen (1).prefab (Size: 51.68 KB / Downloads: 1)
Reply
#5
Hi

I see what you are trying to achieve. Your solution will unfortunately not do it, for reasons I will explain in the next post. Give me some time and I will come up with something useful.

I haven't looked at the UV thing yet, will do it soon too.

I removed the project zip file you posted earlier, because it had a copy of Curvy Splines in it. This forum being public, that meant that anyone can get a free copy of Curvy Splines. Let me know if you need a copy of that zip, I still have it on my pc.

About the missing example scene, I just downloaded a copy of Curvy Splines from the store, and it did contain the example scene 29_CGDeformMesh_BarbedWire. This is the one you are speaking about right? If so, can you reimport Curvy's package and see if it is still missing?

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
#6
Now about why the solution your tried to implement is not working:
  • The Deform Mesh module deform a mesh along a path, and not on top of a volume. The module can take volumes as inputs, but use only their path, not their surface. Now I see that this is source of confusion. I will try to improve this in the future.
  • The Bounds input of the Volume Spots module, and the V Mesh input of the Deform Mesh module, should both be linked to the same V Mesh output. This is not the case in your generator. Basically, the Volume Spots generates spots based on the bounds of the mesh, and the Deform Mesh deforms the meshes based on their spots' positions.
  • The GuardRail mesh needed to be rotated by 90 degrees (using the TRS Mesh module)
  • I haven't investiguated much this last point, but the result seemed wrong when using the CPs range in the Track input spline path module. Using other ranges worked fine.
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
(10-31-2022, 10:18 PM)_Aka_ Wrote: Hi

I see what you are trying to achieve. Your solution will unfortunately not do it, for reasons I will explain in the next post. Give me some time and I will come up with something useful.

I haven't looked at the UV thing yet, will do it soon too.

I removed the project zip file you posted earlier, because it had a copy of Curvy Splines in it. This forum being public, that meant that anyone can get a free copy of Curvy Splines. Let me know if you need a copy of that zip, I still have it on my pc.

About the missing example scene, I just downloaded a copy of Curvy Splines from the store, and it did contain the example scene 29_CGDeformMesh_BarbedWire. This is the one you are speaking about right? If so, can you reimport Curvy's package and see if it is still missing?

Thanks for your patience
Of course you should remove Curvy Spline library. I was wanting the project to work when you opened it so included it. Silly of me as you 'likely' have it... ha ha

I was not talking about the BarbedWire example. I was talking about the railroad track example with a figure eight where you show the Metadata is used to change 'track sleepers' and ground cover and rails. It has the overhead wires etc.... Not sure you have another tutorial example that change textures with Metadata.

(10-31-2022, 10:35 PM)_Aka_ Wrote: Now about why the solution your tried to implement is not working:
  • The Deform Mesh module deform a mesh along a path, and not on top of a volume. The module can take volumes as inputs, but use only their path, not their surface. Now I see that this is source of confusion. I will try to improve this in the future.
  • The Bounds input of the Volume Spots module, and the V Mesh input of the Deform Mesh module, should both be linked to the same V Mesh output. This is not the case in your generator. Basically, the Volume Spots generates spots based on the bounds of the mesh, and the Deform Mesh deforms the meshes based on their spots' positions.
  • The GuardRail mesh needed to be rotated by 90 degrees (using the TRS Mesh module)
  • I haven't investiguated much this last point, but the result seemed wrong when using the CPs range in the Track input spline path module. Using other ranges worked fine.

I can use Volume Spots to align object to the edge of the 'track' (like 'guard rail' support 'pole' objects) but I'd like an extruded 'guard rail' go with the 'poles' too.

I am not sure I understand how to reconfigure this from your textual description. Can you give me a 'generator' that show a how to connect up a graph that has a shape extrusion ('guard rail') aligned to the edge of another shape extrusion ('track')?
Reply
#8
About the missing tutorial, it is scene 25_CGExtrusionAdvanced, and it is included in the package I downloaded from the store as a test. Can you confirm it is missing for you even with a freshly downloaded package?

Thanks
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
About the UV calculation: the value to set to UVOffset.Y is the following:

yourBuildVolumeMesh.groupsByMatID[theRightIndex].AspectCorrectionV

Knowing that groupsByMatIDis defined as follow:
private List<SamplePointsMaterialGroupCollection> groupsByMatID;

Two things to solve to be able to use the code above:

1- theRightIndex: either 0 if you use only one material, or you find the index that indexes the SamplePointsMaterialGroupCollection instance with the right material ID.

2- groupsByMatID: it is a private field, you can make it public or add a getter to access it for example.

I believe this answers your UV related question
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
About the Variable Mix Shape issue, after investigating, i see what happens:

To summarize, it is the result of how the interpolation between the shapes is. Without getting into boring details, the gist of it is that interpolating between two rectangles can give intermediate shapes that are not rectangles. To see it in action, you can use the Mix Shapes module, and move the interpolation cursor left to right, and see how the shape is interpolated.
Increasing the resolution in the Cross tab of the Shape Extrusion module (with Optimize set to false) reduces the issue, but does not remove it though. The issue is especially visible for your case, since it is a perfect rectangle, but I believe that using the final shape (with the rail guards) will either not have the issue or have it in a less visible manner.
Please give this solution a try, and let me know if it worked or not.
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
Exclamation DuplicateEditorMesh performance issue Guillaume 5 12 01-18-2022, 01:44 PM
Last Post: _Aka_
  Lightmap/Shadow issue Sacryn 4 1,523 11-24-2020, 08:33 AM
Last Post: Sacryn
  UV issue with variable mix shape modifier MarioBag 4 3,312 12-07-2019, 01:43 PM
Last Post: _Aka_
  Follow Up Spline Issue JHulse95 8 8,099 07-25-2019, 02:36 PM
Last Post: _Aka_

Forum Jump: