07-24-2023, 02:56 PM
Hello.
I have always used your wonderful assets.
I am using Curvy Generator to generate the following mesh.
I am dynamically changing the parameters related to this mesh with a script I created, and I Refresh() the Generator to reflect the changes in the Curvy Splines.
The reason for separating Shape A and Shape B is because Variable Mix Shapes are used.
And now, we were doing performance testing and observed an event where the frame rate dropped when the CPs position was changed by processing Step.1.
We used Deep Profiling to check and found that the BuildShapeExtrusion class was the cause of the slowdown.
I was wondering about the second image, the load caused by ModifierVariableMixShapes.
Indeed, I am using Variable Mix Shapes.
But at this time, I did not change the parameters in Step.2 and Step.3 (they have not changed from the previous values) and the CP positions and TCB values for Shape A and Shape B were exactly the same.
If we comment out the process in Step.2 and Step.3, we still have this load as well.
I feel that if Shape A and Shape B in Variable Mix Shapes have the same parameters, there is no need to run ModifierVariableMixShapes.OnSlotDataRequest().
Hopefully, I can try to improve the frame rate by not executing this.
In transitioning from the first to the second image result, I am unclear as to how this came to be done and would like to investigate more deeply or improve it.
Do you have any suggestions?
I have always used your wonderful assets.
I am using Curvy Generator to generate the following mesh.
I am dynamically changing the parameters related to this mesh with a script I created, and I Refresh() the Generator to reflect the changes in the Curvy Splines.
Code:
public static void RefreshPathAndShape()
{
// Step.1: Change the position of the CPs on the path
ReadOnlyCollection<CurvySplineSegment> cpList = s_splinePath.ControlPointsList;
int cpCount = cpList.Count;
for (int i = 0; i < cpCount; i++)
{
cpList[i].SetLocalPosition(s_positionBuffer[i]);
}
// Step.2: Change the position of CPs on the shape (in A and B)
ReadOnlyCollection<CurvySplineSegment> aCpList = s_splineShapeA.ControlPointsList;
ReadOnlyCollection<CurvySplineSegment> bCpList = s_splineShapeB.ControlPointsList;
for (int i = 0; i < s_splineShapeACpPositionBufferList.Length; i++)
{
aCpList[i].SetLocalPosition(s_splineShapeACpPositionBufferList[i]);
bCpList[i].SetLocalPosition(s_splineShapeBCpPositionBufferList[i]);
}
// Step.3: Change TCB (in A and B)
s_splineShapeA.Tension = s_aTension;
s_splineShapeA.Continuity = s_aContinuity;
s_splineShapeA.Bias = s_aBias;
s_splineShapeB.Tension = s_bTension;
s_splineShapeB.Continuity = s_bContinuity;
s_splineShapeB.Bias = s_bBias;
// Step.4: Update Generator (Manual)
s_generator.Refresh();
}
The reason for separating Shape A and Shape B is because Variable Mix Shapes are used.
And now, we were doing performance testing and observed an event where the frame rate dropped when the CPs position was changed by processing Step.1.
We used Deep Profiling to check and found that the BuildShapeExtrusion class was the cause of the slowdown.
I was wondering about the second image, the load caused by ModifierVariableMixShapes.
Indeed, I am using Variable Mix Shapes.
But at this time, I did not change the parameters in Step.2 and Step.3 (they have not changed from the previous values) and the CP positions and TCB values for Shape A and Shape B were exactly the same.
If we comment out the process in Step.2 and Step.3, we still have this load as well.
I feel that if Shape A and Shape B in Variable Mix Shapes have the same parameters, there is no need to run ModifierVariableMixShapes.OnSlotDataRequest().
Hopefully, I can try to improve the frame rate by not executing this.
In transitioning from the first to the second image result, I am unclear as to how this came to be done and would like to investigate more deeply or improve it.
Do you have any suggestions?