public override void DrawFeatureGUI(Material mat) { detailNoise = EditorGUILayout.Toggle(CDetailNoise, detailNoise); distanceNoise = EditorGUILayout.Toggle(CDistanceNoise, distanceNoise); noiseChannelCount = (NormalNoiseChannels)EditorGUILayout.EnumPopup(CNormalNoise, noiseChannelCount); #if __MICROSPLAT_TRIPLANAR__ if (detailNoise || distanceNoise || noiseChannelCount != NormalNoiseChannels.Off) { EditorGUI.indentLevel++; antiTileTriplanar = EditorGUILayout.Toggle(CTriplanarControls, antiTileTriplanar); EditorGUI.indentLevel--; } #endif distanceResample = (DistanceResampleMode)EditorGUILayout.EnumPopup(CDistanceResample, distanceResample); #if __MICROSPLAT_TEXTURECLUSTERS__ if (distanceResample != DistanceResampleMode.None) { EditorGUI.indentLevel++; resampleClusters = EditorGUILayout.Toggle(CResampleClusters, resampleClusters); EditorGUI.indentLevel--; } #endif if (distanceResample != DistanceResampleMode.None) { EditorGUI.indentLevel++; distanceResampleHeightBlend = EditorGUILayout.Toggle(CDistanceResampleHeightBlend, distanceResampleHeightBlend); distanceResampleFade = (DistanceResampleFade)EditorGUILayout.EnumPopup(CDistanceResampleFade, distanceResampleFade); EditorGUI.indentLevel--; } #if UNITY_2017_3_OR_NEWER antiTileOptions = (AntiTileOptions)EditorGUILayout.EnumFlagsField(CAntiTileOptions, antiTileOptions); #else antiTileOptions = (AntiTileOptions)EditorGUILayout.EnumMaskPopup(CAntiTileOptions, antiTileOptions); #endif }
public override void Unpack(string[] keywords) { detailNoise = HasFeature(keywords, DefineFeature._DETAILNOISE); distanceNoise = HasFeature(keywords, DefineFeature._DISTANCENOISE); distanceResample = DistanceResampleMode.None; if (HasFeature(keywords, DefineFeature._DISTANCERESAMPLE)) { distanceResample = DistanceResampleMode.Fast; if (HasFeature(keywords, DefineFeature._DISTANCERESAMPLENORMAL)) { distanceResample = DistanceResampleMode.Full; } distanceResampleHeightBlend = HasFeature(keywords, DefineFeature._DISTANCERESAMPLEHEIGHTBLEND); distanceResampleFade = DistanceResampleFade.CrossFade; if (HasFeature(keywords, DefineFeature._DISTANCERESAMPLENOFADE)) { distanceResampleFade = DistanceResampleFade.Constant; } else if (HasFeature(keywords, DefineFeature._DISTANCERESAMPLENOISE)) { distanceResampleFade = DistanceResampleFade.Noise; } } noiseChannelCount = NormalNoiseChannels.Off; if (HasFeature(keywords, DefineFeature._NORMALNOISE)) { noiseChannelCount = NormalNoiseChannels.One; } if (HasFeature(keywords, DefineFeature._NORMALNOISE2)) { noiseChannelCount = NormalNoiseChannels.Two; } if (HasFeature(keywords, DefineFeature._NORMALNOISE3)) { noiseChannelCount = NormalNoiseChannels.Three; } perTexDetailNoiseStrength = HasFeature(keywords, DefineFeature._PERTEXDETAILNOISESTRENGTH); perTexDistanceNoiseStrength = HasFeature(keywords, DefineFeature._PERTEXDISTANCENOISESTRENGTH); perTexDistanceResampleStrength = HasFeature(keywords, DefineFeature._PERTEXDISTANCERESAMPLESTRENGTH); perTexNormalNoiseStrength = HasFeature(keywords, DefineFeature._PERTEXNORMALNOISESTRENGTH); perTexAntiTile = HasFeature(keywords, DefineFeature._ANTITILEPERTEX); #if __MICROSPLAT_TEXTURECLUSTERS__ resampleClusters = HasFeature(keywords, DefineFeature._RESAMPLECLUSTERS); #endif antiTileOptions = 0; if (HasFeature(keywords, DefineFeature._ANTITILEARRAYNORMAL)) { antiTileOptions = (AntiTileOptions)((int)antiTileOptions | ((int)AntiTileOptions.NoiseNormal)); } if (HasFeature(keywords, DefineFeature._ANTITILEARRAYDETAIL)) { antiTileOptions = (AntiTileOptions)((int)antiTileOptions | ((int)AntiTileOptions.DetailNoise)); } if (HasFeature(keywords, DefineFeature._ANTITILEARRAYDISTANCE)) { antiTileOptions = (AntiTileOptions)((int)antiTileOptions | ((int)AntiTileOptions.DistanceNoise)); } if (antiTileOptions == 0) { perTexAntiTile = false; } #if __MICROSPLAT_TRIPLANAR__ if (detailNoise || distanceNoise || noiseChannelCount != NormalNoiseChannels.Off) { antiTileTriplanar = HasFeature(keywords, DefineFeature._ANTITILETRIPLANAR); } #endif }