You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the v4.1.0, there is a serious bug in the wind calculation. In fact, the wind does not work currently. The bug and its fix method are as follows.
1: In the sample, where the wind magnitude is not set at all, m_windMagnitude is only be set to 0.0f during initialization, however m_clampPositionDelta is not used at all, but it can be configured in the ImGUI.
ImGui::SliderFloat("Clamp Position Delta", &simulationSettings->m_clampPositionDelta, 0.0f, 20.0f);
So we can modify the above code to these.
2: When calculating the displacement caused by wind, the effect is a vector with magnitude. The shader directly calculates the cross product of the unnormalized v and w, where v is the hair strand vector (with magnitude and direction), and w is wind vector (with magnitude and direction).
The vector cross product result is the displacement direction, but the value of each component in the vector has no practical significance. So we need to split into two parts to calculate separately in here, as shown below.
After modifying the code as shown above, the wind calculation will be correct and affect the hair strands.
3: The wind calculation and length constraints use the same pass, the length constraints will be iteratively calculated(dispatch multiple times), but the wind calculation does not need iterate, so we need to separate this pass to the wind calculation pass and the length constraints pass.
The text was updated successfully, but these errors were encountered:
Hi there,
In the v4.1.0, there is a serious bug in the wind calculation. In fact, the wind does not work currently. The bug and its fix method are as follows.
1: In the sample, where the wind magnitude is not set at all, m_windMagnitude is only be set to 0.0f during initialization, however m_clampPositionDelta is not used at all, but it can be configured in the ImGUI.
TressFX/src/TressFX/TressFXSettings.h
Lines 82 to 86 in ba0bdac
TressFX/src/TressFX/TressFXSettings.h
Line 49 in ba0bdac
TressFX/src/TressFXSample.cpp
Line 596 in ba0bdac
So we can modify the above code to these.
2: When calculating the displacement caused by wind, the effect is a vector with magnitude. The shader directly calculates the cross product of the unnormalized v and w, where v is the hair strand vector (with magnitude and direction), and w is wind vector (with magnitude and direction).
TressFX/src/Shaders/TressFXSimulation.hlsl
Lines 904 to 911 in ba0bdac
The vector cross product result is the displacement direction, but the value of each component in the vector has no practical significance. So we need to split into two parts to calculate separately in here, as shown below.
After modifying the code as shown above, the wind calculation will be correct and affect the hair strands.
3: The wind calculation and length constraints use the same pass, the length constraints will be iteratively calculated(dispatch multiple times), but the wind calculation does not need iterate, so we need to separate this pass to the wind calculation pass and the length constraints pass.
The text was updated successfully, but these errors were encountered: