Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BuildVolumeMesh issue
#27
(11-14-2022, 10:15 AM)_Aka_ Wrote:
(11-11-2022, 10:00 PM)tairoark Wrote: Using a Variable Shape Mixer Or the X Multiplier under Scale of the Shape Extrusion module to control the width of my track profile I'm still left with a problem. I still need to create a guardrail.

In the 25_CGExtrusionAdvanced you make a Shape Extrusion 'wire'. This wire follows the spline, just vertically offset by a fixed amount using a TRS Mesh module.

But a guardrail needs to follow the extruded cross-section's width. This width varies based upon the Shape Extrusion via one of the two methods described above.

I'm still unsure how to do this?

I'm sorry if I missed your explanation previously. I should have separated all these issues as they came up.

I wad thinking of using the Variable Shape Mixer to mix two shapes, both with guard rails. For example:

These shapes are very simplified. Maybe your real use case can not be achieved with the solution I am suggesting. If it is the case, let me know and I will talk to you about the last resort solution.

What you are showing IS part of my original architecture. To change road widths, I run through the profile points and push them out from the center to change the road width, allowing the edges to remain unscaled. This was why I was using two profiles (start and end) with the Variable Shape Mixer.

The suggestion for using the Scale values of the Shape Extrusion is a cleaner solution (one profile, no manual point manipulation as just described) and more efficient. It does however prevent using the profile to define edge specific shapes (like you drew above) for the 'guard rails' as they would get improperly scaled with the road width.

The Variable Shape mixer approach also has other problems / complications:
1) I would need four separate profiles for each road: no guard rails, left side only, right side only, both sides
2) You should be able to see between the bottom of the guard rail and the top of the road. The guard rail support posts would be visible from both sides. Can I have CG Meta data say there is NO texture on part of the profile or does there need to be a transparent part of the texture that maps there (now more expensive because I turn on transparency)
3) If I have a 'curb' AND a 'guard rail' or a 'sidewalk' and a 'guard rail'; the permutations start to multiple



Your suggestion of Shape Extrusion scaling of the base road seems a generally better method. If there was just a way to align another extruded shape along the edge of the previous extrusion?

It is likely possible for me to (after a Refresh update):
A) calculate the edge points of a road (using the road's spline and the ScaleMultiplierX AnnimationCurve used for the road)
B) create a new spline along this edge
C) extrude the guard rail in a separate graph

This just seems like something a graph module would be best suited for in a single pass but not in my area of expertise. The graph already knows these edge points.

Your thoughts are appreciated

(11-14-2022, 10:06 AM)_Aka_ Wrote:
(11-11-2022, 09:08 PM)tairoark Wrote:
(11-01-2022, 10:38 AM)_Aka_ Wrote: 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

I only have one material.

What exactly IS AspectCorrectionV.   I need the value of the ending V of a previously generated segment ? 

If I understand what you are saying, here is my attempt at it:
Code:
var bvmA = genOfSegmentA.GetModule<BuildVolumeMesh>( "Track Vol Mesh", true );
var bvmAplus1 = genOfSegmentAplus1.GetModule<BuildVolumeMesh>( "Track Vol Mesh", true );
bvmAplus1.MaterialSetttings[ 0 ].UVOffset.y = bvmA.GroupByMatID[0].AspectCorrectionV;

The problem is that in the debugger, BuildVolumeMesh.groupsByMatID is always null !!
No array is set  :-(

Yes, that code should do it. The groupsByMatID array becomes different than null after the generatore refreshes. I am guessing you are executing your code before the generator first refresh. If that is the case, either wait until the next frame, or you can listen to the OnRefresh event on the Curvy Generator or on the module.
Did this work?

Yes, I was checking at graph setup time before the refresh.  I have other code that also run's after the graphs first refresh. I can move the code there. 

This is also the reason my generators default with AutoRefresh off. I need to catch the first refresh (I use the generated mesh). So at the end of graph setup I call generator.Refresh and in its handler I turn on AutoRefresh. This way I am assured to not miss the first refresh before returning from graph setup.

If my memory serves me, I did it this way because if have AutoRefresh on by default, OnRefresh may be called before I finish setting up the graph. This causes problems; flashing an incorrect mesh being one of them.
Reply


Messages In This Thread
BuildVolumeMesh issue - by tairoark - 10-30-2022, 03:20 AM
RE: BuildVolumeMesh issue - by _Aka_ - 10-30-2022, 12:12 PM
RE: BuildVolumeMesh issue - by tairoark - 10-30-2022, 05:40 PM
RE: BuildVolumeMesh issue - by tairoark - 10-30-2022, 11:15 PM
RE: BuildVolumeMesh issue - by _Aka_ - 10-31-2022, 10:18 PM
RE: BuildVolumeMesh issue - by tairoark - 10-31-2022, 11:08 PM
RE: BuildVolumeMesh issue - by _Aka_ - 11-01-2022, 03:50 PM
RE: BuildVolumeMesh issue - by tairoark - 11-03-2022, 02:59 AM
RE: BuildVolumeMesh issue - by _Aka_ - 11-03-2022, 09:39 AM
RE: BuildVolumeMesh issue - by tairoark - 11-03-2022, 12:49 PM
RE: BuildVolumeMesh issue - by _Aka_ - 10-31-2022, 10:35 PM
RE: BuildVolumeMesh issue - by _Aka_ - 11-01-2022, 09:41 AM
RE: BuildVolumeMesh issue - by tairoark - 11-01-2022, 03:48 PM
RE: BuildVolumeMesh issue - by _Aka_ - 11-01-2022, 03:51 PM
RE: BuildVolumeMesh issue - by _Aka_ - 11-01-2022, 10:38 AM
RE: BuildVolumeMesh issue - by tairoark - 11-11-2022, 09:08 PM
RE: BuildVolumeMesh issue - by _Aka_ - 11-14-2022, 10:06 AM
RE: BuildVolumeMesh issue - by tairoark - 11-15-2022, 04:56 PM
RE: BuildVolumeMesh issue - by _Aka_ - 11-01-2022, 03:39 PM
RE: BuildVolumeMesh issue - by _Aka_ - 11-01-2022, 03:53 PM
RE: BuildVolumeMesh issue - by _Aka_ - 11-03-2022, 04:27 PM
RE: BuildVolumeMesh issue - by tairoark - 11-11-2022, 05:27 PM
RE: BuildVolumeMesh issue - by _Aka_ - 11-14-2022, 10:01 AM
RE: BuildVolumeMesh issue - by tairoark - 11-14-2022, 08:25 PM
RE: BuildVolumeMesh issue - by tairoark - 11-11-2022, 10:00 PM
RE: BuildVolumeMesh issue - by _Aka_ - 11-14-2022, 10:15 AM
RE: BuildVolumeMesh issue - by tairoark - 11-15-2022, 12:21 PM
RE: BuildVolumeMesh issue - by tairoark - 11-16-2022, 03:39 PM
RE: BuildVolumeMesh issue - by _Aka_ - 11-17-2022, 11:16 AM
RE: BuildVolumeMesh issue - by tairoark - 11-17-2022, 01:56 PM
RE: BuildVolumeMesh issue - by _Aka_ - 11-18-2022, 08:15 AM
RE: BuildVolumeMesh issue - by tairoark - 11-18-2022, 06:16 PM
RE: BuildVolumeMesh issue - by _Aka_ - 11-21-2022, 03:21 PM
RE: BuildVolumeMesh issue - by tairoark - 11-24-2022, 07:25 PM
RE: BuildVolumeMesh issue - by _Aka_ - 11-15-2022, 08:44 AM
RE: BuildVolumeMesh issue - by _Aka_ - 11-16-2022, 10:35 AM
RE: BuildVolumeMesh issue - by tairoark - 11-16-2022, 07:00 PM
RE: BuildVolumeMesh issue - by _Aka_ - 11-17-2022, 10:11 AM
RE: BuildVolumeMesh issue - by tairoark - 11-17-2022, 01:22 PM
RE: BuildVolumeMesh issue - by _Aka_ - 11-21-2022, 03:19 PM
RE: BuildVolumeMesh issue - by _Aka_ - 11-25-2022, 07:57 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Rasterized Path Range issue proton 3 14 5 hours ago
Last Post: proton
  Rotation issue with generator nicolaj.h.andersen@gmail.com 1 15 04-14-2023, 11:58 AM
Last Post: _Aka_
Exclamation DuplicateEditorMesh performance issue Guillaume 5 12 01-18-2022, 01:44 PM
Last Post: _Aka_
  Lightmap/Shadow issue Sacryn 4 1,524 11-24-2020, 08:33 AM
Last Post: Sacryn

Forum Jump: