This commit is contained in:
Lasse Jon Fuglsang Pedersen 2020-11-12 17:09:55 +01:00
Родитель bfde2a4352
Коммит 504209b9dd
14 изменённых файлов: 719 добавлений и 530 удалений

Просмотреть файл

@ -14,10 +14,9 @@ namespace Unity.DemoTeam.Hair
MaterialPropertyBlock previewUtilMPB;
Quaternion previewRotation;
SerializedProperty _type;
SerializedProperty _material;
SerializedProperty _settingsBasic;
SerializedProperty _settingsBasic_type;
SerializedProperty _settingsBasic_material;
SerializedProperty _settingsAlembic;
SerializedProperty _settingsProcedural;
@ -49,12 +48,11 @@ namespace Unity.DemoTeam.Hair
}
_settingsBasic = serializedObject.FindProperty("settingsBasic");
_settingsBasic_type = _settingsBasic.FindPropertyRelative("type");
_settingsBasic_material = _settingsBasic.FindPropertyRelative("material");
_settingsAlembic = serializedObject.FindProperty("settingsAlembic");
_settingsProcedural = serializedObject.FindProperty("settingsProcedural");
_type = _settingsBasic.FindPropertyRelative("type");
_material = _settingsBasic.FindPropertyRelative("material");
_strandGroups = serializedObject.FindProperty("strandGroups");
_strandGroupsAutoBuild = serializedObject.FindProperty("strandGroupsAutoBuild");
}
@ -99,12 +97,12 @@ namespace Unity.DemoTeam.Hair
{
StructPropertyFieldsWithHeader(_settingsBasic);
if (_material.objectReferenceValue == null)
_material.objectReferenceValue = groom.defaultMaterial;
if (_settingsBasic_material.objectReferenceValue == null)
_settingsBasic_material.objectReferenceValue = groom.defaultMaterial;
EditorGUILayout.Space();
switch ((GroomAsset.Type)_type.enumValueIndex)
switch ((GroomAsset.Type)_settingsBasic_type.enumValueIndex)
{
case GroomAsset.Type.Alembic:
StructPropertyFieldsWithHeader(_settingsAlembic);
@ -204,7 +202,7 @@ namespace Unity.DemoTeam.Hair
var matrix = Matrix4x4.TRS(meshOffset * Vector3.forward, previewRotation, Vector3.one) * Matrix4x4.Translate(-meshCenter);
var material = _material.objectReferenceValue as Material;
var material = _settingsBasic_material.objectReferenceValue as Material;
if (material == null)
material = groom.defaultMaterial;

Просмотреть файл

@ -13,15 +13,15 @@ namespace Unity.DemoTeam.Hair
SerializedProperty _groomAsset;
SerializedProperty _groomAssetQuickEdit;
SerializedProperty _settingsRoots;
SerializedProperty _settingsRoots_rootsAttached;
SerializedProperty _settingsStrands;
SerializedProperty _settingsSolver;
SerializedProperty _settingsVolume;
SerializedProperty _settingsDebug;
SerializedProperty _boundaries;//replace with overlapbox
SerializedProperty _settingsRoots;
SerializedProperty _settingsRoots_rootsAttached;
SerializedProperty _settingsStrands;
void OnEnable()
{
_groomAsset = serializedObject.FindProperty("groomAsset");

Просмотреть файл

@ -5,11 +5,201 @@ using UnityEngine.Rendering;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Mathematics;
using Unity.DemoTeam.Attributes;
#if UNITY_EDITOR
using UnityEditor;
using System.Reflection;
#endif
namespace Unity.DemoTeam.Hair
{
[ExecuteAlways]
[SelectionBase]
public class LineHeaderAttribute : PropertyAttribute { }
[CustomPropertyDrawer(typeof(LineHeaderAttribute))]
public class LineHeaderAttributeDrawer : DecoratorDrawer
{
public override float GetHeight() => 6.0f;
public override void OnGUI(Rect position)
{
position.yMin += 3.0f;
position.yMax -= 2.0f;
EditorGUI.LabelField(position, "", GUI.skin.button);
}
}
public class ToggleGroupItemAttribute : PropertyAttribute
{
public bool withLabel;
public ToggleGroupItemAttribute(bool withLabel = false)
{
this.withLabel = withLabel;
}
}
public class ToggleGroupAttribute : PropertyAttribute { }
#if UNITY_EDITOR
[CustomPropertyDrawer(typeof(ToggleGroupItemAttribute))]
public class ToggleGroupItemAttributeDrawer : PropertyDrawer
{
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) => -EditorGUIUtility.standardVerticalSpacing;
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { }
}
[CustomPropertyDrawer(typeof(ToggleGroupAttribute))]
public class ToggleGroupAttributeDrawer : PropertyDrawer
{
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) => -EditorGUIUtility.standardVerticalSpacing;
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
EditorGUI.BeginProperty(position, label, property);
EditorGUILayout.BeginHorizontal();
if (TryGetTooltipAttribute(fieldInfo, out var tooltip))
{
label.tooltip = tooltip;
}
property.boolValue = EditorGUILayout.Toggle(label, property.boolValue);
using (new EditorGUI.DisabledGroupScope(!property.boolValue))
{
while (property.Next(false))
{
var target = property.serializedObject.targetObject;
if (target == null)
continue;
var field = GetFieldByPropertyPath(target.GetType(), property.propertyPath);
if (field == null)
continue;
var groupItem = field.GetCustomAttribute<ToggleGroupItemAttribute>();
if (groupItem == null)
break;
if (groupItem.withLabel)
{
var fieldLabelText = property.displayName;
if (fieldLabelText.StartsWith(label.text))
fieldLabelText = fieldLabelText.Substring(label.text.Length);
TryGetTooltipAttribute(field, out var fieldLabelTooltip);
var fieldLabel = new GUIContent(fieldLabelText, fieldLabelTooltip);
var fieldLabelPad = 18.0f;// ...
var fieldLabelWidth = EditorStyles.label.CalcSize(fieldLabel).x + fieldLabelPad;
EditorGUILayout.LabelField(fieldLabel, GUILayout.Width(fieldLabelWidth));
}
switch (property.propertyType)
{
case SerializedPropertyType.Enum:
{
var enumValue = (Enum)Enum.GetValues(field.FieldType).GetValue(property.enumValueIndex);
var enumValueSelected = EditorGUILayout.EnumPopup(enumValue);
property.enumValueIndex = Convert.ToInt32(enumValueSelected);
}
break;
case SerializedPropertyType.Float:
{
if (TryGetRangeAttribute(field, out var min, out var max))
property.floatValue = EditorGUILayout.Slider(property.floatValue, min, max);
else
property.floatValue = EditorGUILayout.FloatField(property.floatValue);
}
break;
case SerializedPropertyType.Integer:
{
if (TryGetRangeAttribute(field, out var min, out var max))
property.intValue = EditorGUILayout.IntSlider(property.intValue, (int)min, (int)max);
else
property.intValue = EditorGUILayout.IntField(property.intValue);
}
break;
case SerializedPropertyType.Boolean:
{
property.boolValue = EditorGUILayout.ToggleLeft(property.displayName, property.boolValue);
}
break;
}
if (!groupItem.withLabel)
{
if (TryGetTooltipAttribute(field, out var fieldTooltip))
{
GUI.Label(GUILayoutUtility.GetLastRect(), new GUIContent(string.Empty, fieldTooltip));
}
}
}
}
EditorGUILayout.EndHorizontal();
EditorGUI.EndProperty();
}
static FieldInfo GetFieldByPropertyPath(Type type, string path)
{
var start = 0;
var delim = path.IndexOf('.', start);
while (delim != -1)
{
var field = type.GetField(path.Substring(start, delim - start));
if (field != null)
{
type = field.FieldType;
start = delim + 1;
delim = path.IndexOf('.', start);
}
else
{
return null;
}
}
return type.GetField(path.Substring(start));
}
static bool TryGetRangeAttribute(FieldInfo field, out float min, out float max)
{
var a = field.GetCustomAttribute<RangeAttribute>();
if (a != null)
{
min = a.min;
max = a.max;
return true;
}
else
{
min = 0.0f;
max = 0.0f;
return false;
}
}
static bool TryGetTooltipAttribute(FieldInfo field, out string tooltip)
{
var a = field.GetCustomAttribute<TooltipAttribute>();
if (a != null)
{
tooltip = a.tooltip;
return true;
}
else
{
tooltip = string.Empty;
return false;
}
}
}
#endif
[ExecuteAlways, SelectionBase]
public class Groom : MonoBehaviour
{
public static HashSet<Groom> s_instances = new HashSet<Groom>();
@ -40,17 +230,20 @@ namespace Unity.DemoTeam.Hair
public enum Renderer
{
PrimitiveLines,
VFXGraph,
}
public enum Scaling
public enum Scale
{
PreserveScale,
ApplyUniformScale,
Fixed,
UniformFromHierarchy,
}
public Scale strandScale;
public Renderer strandRenderer;
public Scaling strandScaling;
public bool simulate;
[VisibleIf(nameof(strandRenderer), Renderer.VFXGraph)]
public GameObject strandOutputGraph;
public Material strandMaterial;
}
public GroomAsset groomAsset;
@ -65,7 +258,6 @@ namespace Unity.DemoTeam.Hair
public HairSim.SolverSettings solverSettings = HairSim.SolverSettings.defaults;
public HairSim.VolumeSettings volumeSettings = HairSim.VolumeSettings.defaults;
public HairSim.DebugSettings debugSettings = HairSim.DebugSettings.defaults;
[NonReorderable]
public List<HairSimBoundary> boundaries = new List<HairSimBoundary>(HairSim.MAX_BOUNDARIES);
@ -131,13 +323,14 @@ namespace Unity.DemoTeam.Hair
Debug.Assert(groomAsset != null);
Debug.Assert(groomAsset.strandGroups != null);
var scaleFactor = GetSimulationStrandScale();
var worldBounds = GetRootBounds(groomContainers[0].rootFilter);
var worldMargin = groomAsset.strandGroups[0].strandLengthMax;
var worldMargin = groomAsset.strandGroups[0].strandLengthMax * scaleFactor;
for (int i = 1; i != groomContainers.Length; i++)
{
worldBounds.Encapsulate(GetRootBounds(groomContainers[i].rootFilter));
worldMargin = Mathf.Max(groomAsset.strandGroups[i].strandLengthMax, worldMargin);
worldMargin = Mathf.Max(groomAsset.strandGroups[i].strandLengthMax * scaleFactor, worldMargin);
}
worldMargin *= 1.5f;
@ -156,14 +349,14 @@ namespace Unity.DemoTeam.Hair
public float GetSimulationStrandScale()
{
switch (settingsStrands.strandScaling)
switch (settingsStrands.strandScale)
{
default:
case SettingsStrands.Scaling.PreserveScale:
case SettingsStrands.Scale.Fixed:
return 1.0f;
case SettingsStrands.Scaling.ApplyUniformScale:
return math.cmin(this.transform.localScale);
case SettingsStrands.Scale.UniformFromHierarchy:
return math.cmin(this.transform.lossyScale);
}
}

Просмотреть файл

@ -8,7 +8,6 @@ using UnityEngine.Experimental.Rendering;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Profiling;
using Unity.DemoTeam.Attributes;
namespace Unity.DemoTeam.Hair
{
@ -142,20 +141,6 @@ namespace Unity.DemoTeam.Hair
public T VOLUME_SUPPORT_CONTRACTION;
}
//TODO split these from SolverSettings?
//[Serializable] public struct StrandSettings
//{
// [Range(0.070f, 100.0f), Tooltip("Strand diameter in millimeters")]
// public float strandDiameter;
// [Range(0.0f, 9.0f)]
// public float strandParticleContrib;
// public static readonly StrandSettings defaults = new StrandSettings()
// {
// strandDiameter = 1.0f,
// strandParticleContrib = 1.0f,
// };
//}
[Serializable] public struct SolverSettings
{
public enum Method
@ -168,8 +153,8 @@ namespace Unity.DemoTeam.Hair
public enum Compare
{
Equals,
EqualsOrLessThan,
EqualsOrGreaterThan,
LessThan,
GreaterThan,
}
[Range(0.070f, 100.0f), Tooltip("Strand diameter in millimeters")]
@ -177,20 +162,18 @@ namespace Unity.DemoTeam.Hair
[Range(0.0f, 9.0f)]
public float strandParticleContrib;// TODO move elsewhere
[Space]
[Space]
[LineHeader]
[Tooltip("Constraint solver")]
public Method method;
[Range(1, 100)]
[Range(1, 100), Tooltip("Constraint iterations")]
public int iterations;
[Range(0.0f, 1.0f)]
[Range(0.0f, 1.0f), Tooltip("Constraint stiffness")]
public float stiffness;
[Range(1.0f, 2.0f)]
[Range(1.0f, 2.0f), Tooltip("Successive-over-relaxation factor")]
public float kSOR;
[Space]
[LineHeader]
[Range(0.0f, 1.0f), Tooltip("Scaling factor for volume pressure impulse")]
public float cellPressure;
@ -201,26 +184,28 @@ namespace Unity.DemoTeam.Hair
[Range(-1.0f, 1.0f), Tooltip("Scaling factor for gravity (Physics.gravity)")]
public float gravity;
[Space]
[LineHeader]
[Tooltip("Particle-particle distance constraint")]
[Tooltip("Enable particle-particle distance constraint")]
public bool distance;
[Tooltip("Maximum particle-root distance constraint")]
[Tooltip("Enable max root-particle distance constraint")]
public bool distanceLRA;
[Tooltip("Follow the leader (hard particle-particle distance constraint, non-physical)")]
[ToggleGroup, Tooltip("Enable 'Follow the leader' constraint (hard particle-particle distance, non-physical)")]
public bool distanceFTL;
[Range(0.0f, 1.0f), Tooltip("Follow the leader damping factor")]
[ToggleGroupItem(withLabel = true), Range(0.0f, 1.0f), Tooltip("FTL correction / damping factor")]
public float distanceFTLDamping;
[Tooltip("Boundary collision constraint")]
public bool boundary;
[Range(0.0f, 1.0f), Tooltip("Boundary friction")]
public float boundaryFriction;
[Tooltip("Curvature constraint")]
[ToggleGroup, Tooltip("Enable boundary shape collision constraint")]
public bool boundaryCollision;
[ToggleGroupItem(withLabel = true), Range(0.0f, 1.0f), Tooltip("Boundary shape friction")]
public float boundaryCollisionFriction;
[ToggleGroup, Tooltip("Enable curvature constraint")]
public bool curvature;
[Tooltip("Curvature constraint mode (=, <, >)")]
[ToggleGroupItem, Tooltip("Curvature constraint mode (=, <, >)")]
public Compare curvatureCompare;
[Range(0.0f, 1.0f)]
public float curvatureCompareTo;
[ToggleGroupItem, Range(0.0f, 1.0f), Tooltip("Scales to [0 .. 90] degrees")]
public float curvatureCompareValue;
public static readonly SolverSettings defaults = new SolverSettings()
{
@ -241,11 +226,11 @@ namespace Unity.DemoTeam.Hair
distanceLRA = true,
distanceFTL = false,
distanceFTLDamping = 0.8f,
boundary = true,
boundaryFriction = 0.5f,
boundaryCollision = true,
boundaryCollisionFriction = 0.5f,
curvature = false,
curvatureCompare = Compare.EqualsOrLessThan,
curvatureCompareTo = 0.1f,
curvatureCompare = Compare.LessThan,
curvatureCompareValue = 0.1f,
};
}
[Serializable] public struct VolumeSettings
@ -259,15 +244,16 @@ namespace Unity.DemoTeam.Hair
RasterizationNoGS,
}
//public enum PressureMode
//{
// Repulsion,
// RepulsionAndAttraction,
//}
public enum PressureSolution
{
RepelAndAttract,
Repel,
}
public enum TargetDensity
{
Uniform,
//TODO below
//InitialPose,
//InitialPoseInParticles,
}
@ -278,15 +264,20 @@ namespace Unity.DemoTeam.Hair
public SplatMethod volumeSplatMethod;
[Range(8, 160)]
public int volumeGridResolution;
[Tooltip("Increases precision of derivative quantities at the cost of volume splatting performance")]
[HideInInspector]//TODO
public bool volumeGridStaggered;
[Space]
public PressureSolution pressureSolution;
[Range(0, 100), Tooltip("0 = EOS, [1 .. *] = Jacobi iteration")]
public int pressureIterations;
[Space]
[Range(0, 100)]
public int pressureIterations;
[Tooltip("Enable this to support attraction of strands")]
public bool pressureAllowsAttraction;
public TargetDensity targetDensity;
[Range(0.0f, 2.0f)]
[Range(0.0f, 1.0f)]
public float targetDensityFactor;
[Space]
@ -295,12 +286,16 @@ namespace Unity.DemoTeam.Hair
public static readonly VolumeSettings defaults = new VolumeSettings()
{
volumeGridResolution = 48,
volumeSplatMethod = SplatMethod.Compute,
pressureIterations = 10,
pressureAllowsAttraction = true,
volumeGridResolution = 32,
volumeGridStaggered = false,
pressureSolution = PressureSolution.RepelAndAttract,
pressureIterations = 3,
targetDensity = TargetDensity.Uniform,
targetDensityFactor = 1.0f,
boundariesFromPhysics = false,
};
}
@ -308,28 +303,29 @@ namespace Unity.DemoTeam.Hair
{
public bool drawParticles;
public bool drawStrands;
public bool drawDensity;
public bool drawGradient;
public bool drawSliceX;
public bool drawSliceY;
public bool drawSliceZ;
public bool drawCellDensity;
public bool drawCellGradient;
[ToggleGroup] public bool drawSliceX;
[ToggleGroupItem, Range(0.0f, 1.0f), Tooltip("Position of slice along X")] public float drawSliceXOffset;
[ToggleGroup] public bool drawSliceY;
[ToggleGroupItem, Range(0.0f, 1.0f), Tooltip("Position of slice along Y")] public float drawSliceYOffset;
[ToggleGroup] public bool drawSliceZ;
[ToggleGroupItem, Range(0.0f, 1.0f), Tooltip("Position of slice along Z")] public float drawSliceZOffset;
[Range(0.0f, 1.0f)] public float drawSliceOffsetX;
[Range(0.0f, 1.0f)] public float drawSliceOffsetY;
[Range(0.0f, 1.0f)] public float drawSliceOffsetZ;
[Range(0.0f, 4.0f)] public float drawSliceDivider;
[Range(0.0f, 4.0f), Tooltip("Scrubs between different layers")] public float drawSliceDivider;
public static readonly DebugSettings defaults = new DebugSettings()
{
drawParticles = false,
drawStrands = false,
drawDensity = false,
drawCellDensity = false,
drawCellGradient = false,
drawSliceX = false,
drawSliceXOffset = 0.4f,
drawSliceY = false,
drawSliceYOffset = 0.4f,
drawSliceZ = false,
drawSliceOffsetX = 0.4f,
drawSliceOffsetY = 0.4f,
drawSliceOffsetZ = 0.4f,
drawSliceZOffset = 0.4f,
drawSliceDivider = 0.0f,
};
}
@ -524,15 +520,15 @@ namespace Unity.DemoTeam.Hair
cbuffer._DT = dt;
cbuffer._Iterations = (uint)solverSettings.iterations;
cbuffer._Stiffness = solverSettings.stiffness;
cbuffer._SOR = solverSettings.kSOR;
cbuffer._CellPressure = solverSettings.cellPressure;
cbuffer._CellVelocity = solverSettings.cellVelocity;
cbuffer._Damping = solverSettings.damping;
cbuffer._Relaxation = solverSettings.kSOR;
cbuffer._Gravity = solverSettings.gravity * -Vector3.Magnitude(Physics.gravity);
cbuffer._VolumePressureScale = solverSettings.cellPressure;
cbuffer._VolumeFrictionScale = solverSettings.cellVelocity;
cbuffer._BoundaryFriction = solverSettings.boundaryFriction;
cbuffer._BendingCurvature = solverSettings.curvatureCompareTo * 0.5f * cbuffer._StrandParticleInterval;
cbuffer._BoundaryFriction = solverSettings.boundaryCollisionFriction;
cbuffer._BendingCurvature = solverSettings.curvatureCompareValue * 0.5f * cbuffer._StrandParticleInterval;
cbuffer._DampingFTL = solverSettings.distanceFTLDamping;
// update keywords
@ -540,11 +536,11 @@ namespace Unity.DemoTeam.Hair
keywords.ENABLE_DISTANCE = solverSettings.distance;
keywords.ENABLE_DISTANCE_LRA = solverSettings.distanceLRA;
keywords.ENABLE_DISTANCE_FTL = solverSettings.distanceFTL;
keywords.ENABLE_BOUNDARY = (solverSettings.boundary && solverSettings.boundaryFriction == 0.0f);
keywords.ENABLE_BOUNDARY_FRICTION = (solverSettings.boundary && solverSettings.boundaryFriction != 0.0f);
keywords.ENABLE_BOUNDARY = (solverSettings.boundaryCollision && solverSettings.boundaryCollisionFriction == 0.0f);
keywords.ENABLE_BOUNDARY_FRICTION = (solverSettings.boundaryCollision && solverSettings.boundaryCollisionFriction != 0.0f);
keywords.ENABLE_CURVATURE_EQ = (solverSettings.curvature && solverSettings.curvatureCompare == SolverSettings.Compare.Equals);
keywords.ENABLE_CURVATURE_GEQ = (solverSettings.curvature && solverSettings.curvatureCompare == SolverSettings.Compare.EqualsOrGreaterThan);
keywords.ENABLE_CURVATURE_LEQ = (solverSettings.curvature && solverSettings.curvatureCompare == SolverSettings.Compare.EqualsOrLessThan);
keywords.ENABLE_CURVATURE_GEQ = (solverSettings.curvature && solverSettings.curvatureCompare == SolverSettings.Compare.GreaterThan);
keywords.ENABLE_CURVATURE_LEQ = (solverSettings.curvature && solverSettings.curvatureCompare == SolverSettings.Compare.LessThan);
}
public static void UpdateVolumeData(ref VolumeData volumeData, in VolumeSettings volumeSettings, List<HairSimBoundary> boundaries)
@ -653,7 +649,7 @@ namespace Unity.DemoTeam.Hair
}
// update keywords
keywords.VOLUME_SUPPORT_CONTRACTION = volumeSettings.pressureAllowsAttraction;
keywords.VOLUME_SUPPORT_CONTRACTION = (volumeSettings.pressureSolution == VolumeSettings.PressureSolution.RepelAndAttract);
}
public static void PushSolverData(CommandBuffer cmd, ComputeShader cs, int kernel, in SolverData solverData)
@ -1027,8 +1023,8 @@ namespace Unity.DemoTeam.Hair
{
using (new ProfilingScope(cmd, MarkersGPU.DrawVolumeData))
{
if (!debugSettings.drawDensity &&
!debugSettings.drawGradient &&
if (!debugSettings.drawCellDensity &&
!debugSettings.drawCellGradient &&
!debugSettings.drawSliceX &&
!debugSettings.drawSliceY &&
!debugSettings.drawSliceZ)
@ -1039,13 +1035,13 @@ namespace Unity.DemoTeam.Hair
PushVolumeData(cmd, s_debugDrawMat, s_debugDrawMPB, volumeData);
// volume density
if (debugSettings.drawDensity)
if (debugSettings.drawCellDensity)
{
cmd.DrawProcedural(Matrix4x4.identity, s_debugDrawMat, 2, MeshTopology.Points, GetCellCount(volumeData.cbuffer), 1, s_debugDrawMPB);
}
// volume gradient
if (debugSettings.drawGradient)
if (debugSettings.drawCellGradient)
{
cmd.DrawProcedural(Matrix4x4.identity, s_debugDrawMat, 3, MeshTopology.Lines, 2 * GetCellCount(volumeData.cbuffer), 1, s_debugDrawMPB);
}
@ -1058,7 +1054,7 @@ namespace Unity.DemoTeam.Hair
if (debugSettings.drawSliceX)
{
s_debugDrawMPB.SetInt(UniformIDs._DebugSliceAxis, 0);
s_debugDrawMPB.SetFloat(UniformIDs._DebugSliceOffset, debugSettings.drawSliceOffsetX);
s_debugDrawMPB.SetFloat(UniformIDs._DebugSliceOffset, debugSettings.drawSliceXOffset);
s_debugDrawMPB.SetFloat(UniformIDs._DebugSliceOpacity, 0.8f);
cmd.DrawProcedural(Matrix4x4.identity, s_debugDrawMat, 4, MeshTopology.Quads, 4, 1, s_debugDrawMPB);
@ -1068,7 +1064,7 @@ namespace Unity.DemoTeam.Hair
if (debugSettings.drawSliceY)
{
s_debugDrawMPB.SetInt(UniformIDs._DebugSliceAxis, 1);
s_debugDrawMPB.SetFloat(UniformIDs._DebugSliceOffset, debugSettings.drawSliceOffsetY);
s_debugDrawMPB.SetFloat(UniformIDs._DebugSliceOffset, debugSettings.drawSliceYOffset);
s_debugDrawMPB.SetFloat(UniformIDs._DebugSliceOpacity, 0.8f);
cmd.DrawProcedural(Matrix4x4.identity, s_debugDrawMat, 4, MeshTopology.Quads, 4, 1, s_debugDrawMPB);
@ -1078,7 +1074,7 @@ namespace Unity.DemoTeam.Hair
if (debugSettings.drawSliceZ)
{
s_debugDrawMPB.SetInt(UniformIDs._DebugSliceAxis, 2);
s_debugDrawMPB.SetFloat(UniformIDs._DebugSliceOffset, debugSettings.drawSliceOffsetZ);
s_debugDrawMPB.SetFloat(UniformIDs._DebugSliceOffset, debugSettings.drawSliceZOffset);
s_debugDrawMPB.SetFloat(UniformIDs._DebugSliceOpacity, 0.8f);
cmd.DrawProcedural(Matrix4x4.identity, s_debugDrawMat, 4, MeshTopology.Quads, 4, 1, s_debugDrawMPB);

Просмотреть файл

@ -127,14 +127,14 @@ float3 ParticleVolumeImpulse(uint i, float3 velocity)
#else
float3 volumeVelocity = VolumeSampleVector(_VolumeVelocity, volumeUVW, _Volume_point_clamp);
#endif
float3 volumeFrictionImpulse = (volumeVelocity - velocity);
float3 volumeVelocityImpulse = (volumeVelocity - velocity);
#else
float3 volumeFrictionImpulse = 0.0;
float3 volumeVelocityImpulse = 0.0;
#endif
return (
volumePressureImpulse * _VolumePressureScale +
volumeFrictionImpulse * _VolumeFrictionScale
volumePressureImpulse * _CellPressure +
volumeVelocityImpulse * _CellVelocity
);
}
@ -659,7 +659,7 @@ void KSolveConstraints_Jacobi(
}
// apply SOR
d *= _Relaxation;
d *= _SOR;
// solve hard distance constraints along strand (FTL)
if (ENABLE_DISTANCE_FTL)
@ -826,13 +826,13 @@ void KSolveConstraints_Jacobi(
float3 d_pre_ftl = d;
SolveDistanceFTLConstraint(GetParticleInterval(strandIndex), gs_x[threadIdx - 1], gs_x[threadIdx], d); n++;
float inv_n = _Relaxation / n;
float inv_n = _SOR / n;
gs_x[threadIdx] = gs_x[threadIdx] + d * inv_n;
gs_d[threadIdx - 1] += (d - d_pre_ftl) * inv_n;
}
else
{
float inv_n = _Relaxation / n;
float inv_n = _SOR / n;
gs_x[threadIdx] = gs_x[threadIdx] + d * inv_n;
}
}

Просмотреть файл

@ -69,12 +69,12 @@ namespace Unity.DemoTeam.Hair
public float _DT;
public uint _Iterations;
public float _Stiffness;
public float _Relaxation;
public float _SOR;
public float _Gravity;
public float _CellPressure;
public float _CellVelocity;
public float _Damping;
public float _VolumePressureScale;
public float _VolumeFrictionScale;
public float _Gravity;
public float _DampingFTL;
public float _BoundaryFriction;

Просмотреть файл

@ -17,11 +17,11 @@ CBUFFER_START(SolverCBuffer)
float _DT;
uint _Iterations;
float _Stiffness;
float _Relaxation;
float _Gravity;
float _SOR;
float _CellPressure;
float _CellVelocity;
float _Damping;
float _VolumePressureScale;
float _VolumeFrictionScale;
float _Gravity;
float _DampingFTL;
float _BoundaryFriction;
float _BendingCurvature;

Двоичные данные
Samples/HairSim_Demo/HairStyles/Groom.asset

Двоичный файл не отображается.

Просмотреть файл

@ -553,6 +553,45 @@ MonoBehaviour:
blendDistance: 0
weight: 1
sharedProfile: {fileID: 11400000, guid: a4a8e754c7d994940a91f588a736b4c4, type: 2}
--- !u!1 &108184980
GameObject:
m_ObjectHideFlags: 8
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 108184981}
- component: {fileID: 108184982}
m_Layer: 0
m_Name: Roots:0
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &108184981
Transform:
m_ObjectHideFlags: 8
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 108184980}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1844952517}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &108184982
MeshFilter:
m_ObjectHideFlags: 8
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 108184980}
m_Mesh: {fileID: -4824970150861338194, guid: 9f5ccb00d17171a49ab287219e676523, type: 2}
--- !u!1 &118650125
GameObject:
m_ObjectHideFlags: 0
@ -1038,6 +1077,288 @@ MonoBehaviour:
position: 65.778755
extent: {x: 0, y: 0, z: 0.2}
period: 1.5707963
--- !u!21 &393434549
Material:
serializedVersion: 6
m_ObjectHideFlags: 8
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: HairMaterial
m_Shader: {fileID: -6465566751694194690, guid: 2fa8c2da3a58a3b49be5441117c20876, type: 3}
m_ShaderKeywords: ENABLE_DISTANCE HAIRSIMVERTEX_ENABLE_POSITION LAYOUT_INTERLEAVED
_DISABLE_SSR_TRANSPARENT
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2225
stringTagMap:
MotionVector: User
disabledShaderPasses:
- DistortionVectors
- RayTracingPrepass
- TransparentDepthPrepass
- TransparentDepthPostpass
- TransparentBackface
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _CoatMaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _IridescenceMaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _IridescenceThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceMaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TransmittanceColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- BOOLEAN_58B50922201C4296ADCD3604F1135012: 1
- BOOLEAN_69B014B20E2848539F679A29B317D5BD: 0
- Boolean_f904f09dbf504d518c3d225aff57a5df: 1
- Vector1_20a47d405fd34354a347258fdfeff805: 0
- Vector1_2e12ccf506a14853b660778272a7d4f1: 0
- Vector1_3c480a7375e14916a17cfbcc2326c547: 0
- Vector1_4fc16fc45ab340f28a9dc98fc33b1c20: 0.666
- Vector1_89223a4ebb3c4ef4a2f9ad915e0c716e: 1
- Vector1_918d42749deb40f889304b01221663a8: 0.666
- Vector1_db946e576f5a49df85d4ab11669cc45a: -0.234
- Vector1_fa9e7a8f18104e3b8d84eda52db629c8: 0.5
- _AORemapMax: 1
- _AORemapMin: 0
- _ATDistance: 1
- _AddPrecomputedVelocity: 0
- _AlbedoAffectEmissive: 0
- _AlphaCutoff: 0.453
- _AlphaCutoffEnable: 0
- _AlphaCutoffPostpass: 0.5
- _AlphaCutoffPrepass: 0.5
- _AlphaCutoffShadow: 0.5
- _AlphaDstBlend: 0
- _AlphaSrcBlend: 1
- _AlphaToMask: 0
- _AlphaToMaskInspectorValue: 0
- _Anisotropy: 0
- _BlendMode: 0
- _CoatMask: 0
- _CullMode: 2
- _CullModeForward: 2
- _Cutoff: 0.453
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DiffusionProfile: 0
- _DiffusionProfileHash: 2.969268
- _DisplacementLockObjectScale: 1
- _DisplacementLockTilingScale: 1
- _DisplacementMode: 0
- _DistortionBlendMode: 0
- _DistortionBlurBlendMode: 0
- _DistortionBlurDstBlend: 1
- _DistortionBlurRemapMax: 1
- _DistortionBlurRemapMin: 0
- _DistortionBlurScale: 1
- _DistortionBlurSrcBlend: 1
- _DistortionDepthTest: 1
- _DistortionDstBlend: 1
- _DistortionEnable: 0
- _DistortionScale: 1
- _DistortionSrcBlend: 1
- _DistortionVectorBias: -1
- _DistortionVectorScale: 2
- _DoubleSidedEnable: 0
- _DoubleSidedNormalMode: 2
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveExposureWeight: 1
- _EmissiveIntensity: 1
- _EmissiveIntensityUnit: 0
- _EnableBlendModePreserveSpecularLighting: 1
- _EnableFogOnTransparent: 1
- _EnableGeometricSpecularAA: 0
- _EnergyConservingSpecularColor: 1
- _HeightAmplitude: 0.02
- _HeightCenter: 0.5
- _HeightMapParametrization: 0
- _HeightMax: 1
- _HeightMin: -1
- _HeightOffset: 0
- _HeightPoMAmplitude: 2
- _HeightTessAmplitude: 2
- _HeightTessCenter: 0.5
- _InvTilingScale: 1
- _Ior: 1.5
- _IridescenceMask: 1
- _IridescenceThickness: 1
- _LinkDetailsWithBase: 1
- _MaterialID: 1
- _Metallic: 0.227
- _NormalMapSpace: 0
- _NormalScale: 2.64
- _OpaqueCullMode: 2
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _PPDPrimitiveLength: 1
- _PPDPrimitiveWidth: 1
- _RayTracing: 0
- _ReceivesSSR: 1
- _ReceivesSSRTransparent: 0
- _RefractionModel: 0
- _RenderQueueType: 1
- _RequireSplitLighting: 0
- _SSRefractionProjectionModel: 0
- _Smoothness: 0.329
- _SmoothnessRemapMax: 1
- _SmoothnessRemapMin: 0
- _SpecularAAScreenSpaceVariance: 0.1
- _SpecularAAThreshold: 0.2
- _SpecularOcclusionMode: 1
- _SrcBlend: 1
- _StencilRef: 0
- _StencilRefDepth: 8
- _StencilRefDistortionVec: 4
- _StencilRefGBuffer: 10
- _StencilRefMV: 40
- _StencilWriteMask: 6
- _StencilWriteMaskDepth: 8
- _StencilWriteMaskDistortionVec: 4
- _StencilWriteMaskGBuffer: 14
- _StencilWriteMaskMV: 40
- _SubsurfaceMask: 1
- _SupportDecals: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _TexWorldScaleEmissive: 1
- _Thickness: 1
- _TransmissionEnable: 1
- _TransparentBackfaceEnable: 0
- _TransparentCullMode: 2
- _TransparentDepthPostpassEnable: 0
- _TransparentDepthPrepassEnable: 0
- _TransparentSortPriority: 0
- _TransparentWritingMotionVec: 0
- _TransparentZWrite: 0
- _UVBase: 0
- _UVDetail: 0
- _UVEmissive: 0
- _UseEmissiveIntensity: 0
- _UseShadowThreshold: 0
- _ZTestDepthEqualForOpaque: 3
- _ZTestGBuffer: 4
- _ZTestModeDistortion: 4
- _ZTestTransparent: 4
- _ZWrite: 1
m_Colors:
- Color_176191224d9a4233962725cd1ff09079: {r: 1, g: 0.70980394, b: 0.40000004, a: 0}
- Color_62c64135deeb4c0f8f8dd2dd4d258618: {r: 0.5254902, g: 0.34509805, b: 0.33333334, a: 1}
- Color_808fa7985ea04aae8fd9e29e269a6cbe: {r: 1, g: 0.71, b: 0.39999998, a: 0}
- Color_ef1f857a65f143afae0a6362fd9a650e: {r: 1, g: 0.70980394, b: 0.40000004, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _BaseColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DiffusionProfileAsset: {r: 0.001549049, g: 6.537953e-17, b: 78.9151, a: 0.00037284626}
- _DoubleSidedConstants: {r: 1, g: 1, b: 1, a: 0}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColorLDR: {r: 0, g: 0, b: 0, a: 1}
- _InvPrimScale: {r: 1, g: 1, b: 0, a: 0}
- _IridescenceThicknessRemap: {r: 0, g: 1, b: 0, a: 0}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _ThicknessRemap: {r: 0, g: 1, b: 0, a: 0}
- _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMaskEmissive: {r: 1, g: 0, b: 0, a: 0}
m_BuildTextureStacks: []
--- !u!1 &412194662
GameObject:
m_ObjectHideFlags: 0
@ -1874,288 +2195,6 @@ MonoBehaviour:
m_EditorClassIdentifier:
type: 1
outerRadius: 0
--- !u!21 &965861407
Material:
serializedVersion: 6
m_ObjectHideFlags: 8
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: HairMaterial
m_Shader: {fileID: -6465566751694194690, guid: 2fa8c2da3a58a3b49be5441117c20876, type: 3}
m_ShaderKeywords: ENABLE_DISTANCE ENABLE_DISTANCE_LRA HAIRSIMVERTEX_ENABLE_POSITION
LAYOUT_INTERLEAVED _DISABLE_SSR_TRANSPARENT
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2225
stringTagMap:
MotionVector: User
disabledShaderPasses:
- DistortionVectors
- RayTracingPrepass
- TransparentDepthPrepass
- TransparentDepthPostpass
- TransparentBackface
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AnisotropyMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BentNormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _CoatMaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DistortionVectorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _HeightMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _IridescenceMaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _IridescenceThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecularColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SubsurfaceMaskMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TangentMapOS:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ThicknessMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _TransmittanceColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- BOOLEAN_58B50922201C4296ADCD3604F1135012: 1
- BOOLEAN_69B014B20E2848539F679A29B317D5BD: 0
- Boolean_f904f09dbf504d518c3d225aff57a5df: 1
- Vector1_20a47d405fd34354a347258fdfeff805: 0
- Vector1_2e12ccf506a14853b660778272a7d4f1: 0
- Vector1_3c480a7375e14916a17cfbcc2326c547: 0
- Vector1_4fc16fc45ab340f28a9dc98fc33b1c20: 0.666
- Vector1_89223a4ebb3c4ef4a2f9ad915e0c716e: 1
- Vector1_918d42749deb40f889304b01221663a8: 0.666
- Vector1_db946e576f5a49df85d4ab11669cc45a: -0.234
- Vector1_fa9e7a8f18104e3b8d84eda52db629c8: 0.5
- _AORemapMax: 1
- _AORemapMin: 0
- _ATDistance: 1
- _AddPrecomputedVelocity: 0
- _AlbedoAffectEmissive: 0
- _AlphaCutoff: 0.453
- _AlphaCutoffEnable: 0
- _AlphaCutoffPostpass: 0.5
- _AlphaCutoffPrepass: 0.5
- _AlphaCutoffShadow: 0.5
- _AlphaDstBlend: 0
- _AlphaSrcBlend: 1
- _AlphaToMask: 0
- _AlphaToMaskInspectorValue: 0
- _Anisotropy: 0
- _BlendMode: 0
- _CoatMask: 0
- _CullMode: 2
- _CullModeForward: 2
- _Cutoff: 0.453
- _DepthOffsetEnable: 0
- _DetailAlbedoScale: 1
- _DetailNormalScale: 1
- _DetailSmoothnessScale: 1
- _DiffusionProfile: 0
- _DiffusionProfileHash: 2.969268
- _DisplacementLockObjectScale: 1
- _DisplacementLockTilingScale: 1
- _DisplacementMode: 0
- _DistortionBlendMode: 0
- _DistortionBlurBlendMode: 0
- _DistortionBlurDstBlend: 1
- _DistortionBlurRemapMax: 1
- _DistortionBlurRemapMin: 0
- _DistortionBlurScale: 1
- _DistortionBlurSrcBlend: 1
- _DistortionDepthTest: 1
- _DistortionDstBlend: 1
- _DistortionEnable: 0
- _DistortionScale: 1
- _DistortionSrcBlend: 1
- _DistortionVectorBias: -1
- _DistortionVectorScale: 2
- _DoubleSidedEnable: 0
- _DoubleSidedNormalMode: 2
- _DstBlend: 0
- _EmissiveColorMode: 1
- _EmissiveExposureWeight: 1
- _EmissiveIntensity: 1
- _EmissiveIntensityUnit: 0
- _EnableBlendModePreserveSpecularLighting: 1
- _EnableFogOnTransparent: 1
- _EnableGeometricSpecularAA: 0
- _EnergyConservingSpecularColor: 1
- _HeightAmplitude: 0.02
- _HeightCenter: 0.5
- _HeightMapParametrization: 0
- _HeightMax: 1
- _HeightMin: -1
- _HeightOffset: 0
- _HeightPoMAmplitude: 2
- _HeightTessAmplitude: 2
- _HeightTessCenter: 0.5
- _InvTilingScale: 1
- _Ior: 1.5
- _IridescenceMask: 1
- _IridescenceThickness: 1
- _LinkDetailsWithBase: 1
- _MaterialID: 1
- _Metallic: 0.227
- _NormalMapSpace: 0
- _NormalScale: 2.64
- _OpaqueCullMode: 2
- _PPDLodThreshold: 5
- _PPDMaxSamples: 15
- _PPDMinSamples: 5
- _PPDPrimitiveLength: 1
- _PPDPrimitiveWidth: 1
- _RayTracing: 0
- _ReceivesSSR: 1
- _ReceivesSSRTransparent: 0
- _RefractionModel: 0
- _RenderQueueType: 1
- _RequireSplitLighting: 0
- _SSRefractionProjectionModel: 0
- _Smoothness: 0.329
- _SmoothnessRemapMax: 1
- _SmoothnessRemapMin: 0
- _SpecularAAScreenSpaceVariance: 0.1
- _SpecularAAThreshold: 0.2
- _SpecularOcclusionMode: 1
- _SrcBlend: 1
- _StencilRef: 0
- _StencilRefDepth: 8
- _StencilRefDistortionVec: 4
- _StencilRefGBuffer: 10
- _StencilRefMV: 40
- _StencilWriteMask: 6
- _StencilWriteMaskDepth: 8
- _StencilWriteMaskDistortionVec: 4
- _StencilWriteMaskGBuffer: 14
- _StencilWriteMaskMV: 40
- _SubsurfaceMask: 1
- _SupportDecals: 1
- _SurfaceType: 0
- _TexWorldScale: 1
- _TexWorldScaleEmissive: 1
- _Thickness: 1
- _TransmissionEnable: 1
- _TransparentBackfaceEnable: 0
- _TransparentCullMode: 2
- _TransparentDepthPostpassEnable: 0
- _TransparentDepthPrepassEnable: 0
- _TransparentSortPriority: 0
- _TransparentWritingMotionVec: 0
- _TransparentZWrite: 0
- _UVBase: 0
- _UVDetail: 0
- _UVEmissive: 0
- _UseEmissiveIntensity: 0
- _UseShadowThreshold: 0
- _ZTestDepthEqualForOpaque: 3
- _ZTestGBuffer: 4
- _ZTestModeDistortion: 4
- _ZTestTransparent: 4
- _ZWrite: 1
m_Colors:
- Color_176191224d9a4233962725cd1ff09079: {r: 1, g: 0.70980394, b: 0.40000004, a: 0}
- Color_62c64135deeb4c0f8f8dd2dd4d258618: {r: 0.5254902, g: 0.34509805, b: 0.33333334, a: 1}
- Color_808fa7985ea04aae8fd9e29e269a6cbe: {r: 1, g: 0.71, b: 0.39999998, a: 0}
- Color_ef1f857a65f143afae0a6362fd9a650e: {r: 1, g: 0.70980394, b: 0.40000004, a: 1}
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _BaseColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DiffusionProfileAsset: {r: 0.001549049, g: 6.537953e-17, b: 78.9151, a: 0.00037284626}
- _DoubleSidedConstants: {r: 1, g: 1, b: 1, a: 0}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColorLDR: {r: 0, g: 0, b: 0, a: 1}
- _InvPrimScale: {r: 1, g: 1, b: 0, a: 0}
- _IridescenceThicknessRemap: {r: 0, g: 1, b: 0, a: 0}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _ThicknessRemap: {r: 0, g: 1, b: 0, a: 0}
- _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1}
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}
- _UVMappingMaskEmissive: {r: 1, g: 0, b: 0, a: 0}
m_BuildTextureStacks: []
--- !u!1 &1011175219
GameObject:
m_ObjectHideFlags: 0
@ -2641,7 +2680,7 @@ Transform:
m_Father: {fileID: 693103309}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: -488.577, z: 0}
--- !u!1 &1426011974
--- !u!1 &1547547952
GameObject:
m_ObjectHideFlags: 8
m_CorrespondingSourceObject: {fileID: 0}
@ -2649,80 +2688,9 @@ GameObject:
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1426011975}
- component: {fileID: 1426011976}
m_Layer: 0
m_Name: Roots:0
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1426011975
Transform:
m_ObjectHideFlags: 8
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1426011974}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1478803479}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &1426011976
MeshFilter:
m_ObjectHideFlags: 8
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1426011974}
m_Mesh: {fileID: -7005794540788253560, guid: 1926e250fa4207b458e46ea322aa682e, type: 2}
--- !u!1 &1478803478
GameObject:
m_ObjectHideFlags: 8
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1478803479}
m_Layer: 0
m_Name: Group:0
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1478803479
Transform:
m_ObjectHideFlags: 8
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1478803478}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1593862055}
- {fileID: 1426011975}
m_Father: {fileID: 2037350749}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1593862053
GameObject:
m_ObjectHideFlags: 8
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1593862055}
- component: {fileID: 1593862056}
- component: {fileID: 1593862054}
- component: {fileID: 1547547954}
- component: {fileID: 1547547955}
- component: {fileID: 1547547953}
m_Layer: 0
m_Name: Lines:0
m_TagString: Untagged
@ -2730,13 +2698,13 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!23 &1593862054
--- !u!23 &1547547953
MeshRenderer:
m_ObjectHideFlags: 8
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1593862053}
m_GameObject: {fileID: 1547547952}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
@ -2749,7 +2717,7 @@ MeshRenderer:
m_RenderingLayerMask: 257
m_RendererPriority: 0
m_Materials:
- {fileID: 965861407}
- {fileID: 393434549}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@ -2771,28 +2739,60 @@ MeshRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!4 &1593862055
--- !u!4 &1547547954
Transform:
m_ObjectHideFlags: 8
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1593862053}
m_GameObject: {fileID: 1547547952}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1478803479}
m_Father: {fileID: 1844952517}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &1593862056
--- !u!33 &1547547955
MeshFilter:
m_ObjectHideFlags: 8
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1593862053}
m_Mesh: {fileID: -9484199191433736, guid: 1926e250fa4207b458e46ea322aa682e, type: 2}
m_GameObject: {fileID: 1547547952}
m_Mesh: {fileID: 852544666785363413, guid: 9f5ccb00d17171a49ab287219e676523, type: 2}
--- !u!1 &1844952516
GameObject:
m_ObjectHideFlags: 8
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1844952517}
m_Layer: 0
m_Name: Group:0
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1844952517
Transform:
m_ObjectHideFlags: 8
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1844952516}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1547547954}
- {fileID: 108184981}
m_Father: {fileID: 2037350749}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1851342448
GameObject:
m_ObjectHideFlags: 0
@ -3076,63 +3076,65 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5e3c4c7574c547e4685bfb8817fbe6f3, type: 3}
m_Name:
m_EditorClassIdentifier:
groomAsset: {fileID: 11400000, guid: 1926e250fa4207b458e46ea322aa682e, type: 2}
groomAsset: {fileID: 11400000, guid: 9f5ccb00d17171a49ab287219e676523, type: 2}
groomAssetQuickEdit: 0
groomContainers:
- group: {fileID: 1478803478}
rootFilter: {fileID: 1426011976}
lineFilter: {fileID: 1593862056}
lineRenderer: {fileID: 1593862054}
groomContainersChecksum: c0feb65c1c1e14cd277f410c90cdc406
- group: {fileID: 1844952516}
rootFilter: {fileID: 108184982}
lineFilter: {fileID: 1547547955}
lineRenderer: {fileID: 1547547953}
groomContainersChecksum: af7652526c1beb9cadd439cccdfa1f0c
settingsRoots:
rootsTarget: {fileID: 0}
rootsAttached: 0
settingsStrands:
strandScale: 0
strandRenderer: 0
strandScaling: 1
simulate: 0
strandOutputGraph: {fileID: 0}
strandMaterial: {fileID: 0}
solverSettings:
strandDiameter: 0.1
strandDiameter: 43.2
strandParticleContrib: 0
method: 1
iterations: 15
iterations: 10
stiffness: 1
kSOR: 1
cellPressure: 1
cellVelocity: 0.05
damping: 0
gravity: 0.716
gravity: 1
distance: 1
distanceLRA: 1
distanceLRA: 0
distanceFTL: 0
distanceFTLDamping: 0.8
boundary: 0
boundaryFriction: 0.5
distanceFTLDamping: 0.491
boundaryCollision: 0
boundaryCollisionFriction: 0.5
curvature: 0
curvatureCompare: 0
curvatureCompareTo: 0.626
curvatureCompareValue: 0.1
volumeSettings:
volumeWorldCenter: {x: 0.28298324, y: 0.577, z: -0.116787575}
volumeWorldExtent: {x: 1.3685832, y: 1.3685832, z: 1.3685832}
volumeWorldCenter: {x: -0.08888318, y: 0.687, z: -0.3518643}
volumeWorldExtent: {x: 1.249063, y: 1.249063, z: 1.249063}
volumeSplatMethod: 1
volumeGridResolution: 48
pressureIterations: 42
pressureAllowsAttraction: 1
volumeGridResolution: 32
volumeGridStaggered: 0
pressureSolution: 0
pressureIterations: 0
targetDensity: 0
targetDensityFactor: 1
boundariesFromPhysics: 1
debugSettings:
drawParticles: 0
drawStrands: 0
drawDensity: 0
drawGradient: 0
drawCellDensity: 0
drawCellGradient: 0
drawSliceX: 0
drawSliceY: 1
drawSliceXOffset: 0.4
drawSliceY: 0
drawSliceYOffset: 0.4
drawSliceZ: 0
drawSliceOffsetX: 0.843
drawSliceOffsetY: 0.254
drawSliceOffsetZ: 0.496
drawSliceDivider: 0
drawSliceZOffset: 0.4
drawSliceDivider: 1.88
boundaries: []
--- !u!4 &2037350749
Transform:
@ -3141,14 +3143,14 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2037350747}
m_LocalRotation: {x: -0, y: -0.59954786, z: -0, w: 0.8003389}
m_LocalPosition: {x: 0.285, y: 0.577, z: -0.1175}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.089, y: 0.687, z: -0.354}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1478803479}
- {fileID: 1844952517}
m_Father: {fileID: 0}
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: -73.675, z: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2046897697
GameObject:
m_ObjectHideFlags: 0

Просмотреть файл

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: a674ff598d0815f42af3b0f7898514d3
guid: 915613c1eb3d9bc4c8e74a104b992432
folderAsset: yes
DefaultImporter:
externalObjects: {}

Двоичные данные
Samples/HairSim_Demo/Styles/Groom.asset Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 1926e250fa4207b458e46ea322aa682e
guid: 9f5ccb00d17171a49ab287219e676523
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0

Просмотреть файл

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: c03efa7e312016e4a9739e31edbfcb0b
guid: bf0f89dec8e9af44886bf941f9dd3df1
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}