squash commits
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4c955fab84f93aa46be2df889258d93f
|
||||
folderAsset: yes
|
||||
timeCreated: 1486762230
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f7368cc5f139160469567c69f321f670
|
||||
folderAsset: yes
|
||||
timeCreated: 1466187567
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8a1005fa5f68007458d03ea1b75105a9
|
||||
folderAsset: yes
|
||||
timeCreated: 1486762311
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+186
@@ -0,0 +1,186 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace UMA.CharacterSystem
|
||||
{
|
||||
//The following classes are used by the pUMATextRecipe extension but also need to be available in RecipeEditor
|
||||
public enum recipeTypeOpts { Standard, WardrobeItem, DynamicCharacterAvatar, WardrobeCollection }
|
||||
|
||||
[System.Serializable]
|
||||
public class WardrobeRecipeThumb
|
||||
{
|
||||
public string race = "";
|
||||
public string filename = "";
|
||||
public Sprite thumb = null;
|
||||
|
||||
public WardrobeRecipeThumb()
|
||||
{
|
||||
|
||||
}
|
||||
public WardrobeRecipeThumb(string n_race)
|
||||
{
|
||||
race = n_race;
|
||||
}
|
||||
public WardrobeRecipeThumb(string n_race, Sprite n_thumb)
|
||||
{
|
||||
race = n_race;
|
||||
filename = n_thumb.name;
|
||||
thumb = n_thumb;
|
||||
}
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class WardrobeSettings
|
||||
{
|
||||
public string slot;
|
||||
public string recipe;
|
||||
public WardrobeSettings()
|
||||
{
|
||||
|
||||
}
|
||||
public WardrobeSettings(string _slot, string _recipe)
|
||||
{
|
||||
slot = _slot;
|
||||
recipe = _recipe;
|
||||
}
|
||||
}
|
||||
[System.Serializable]
|
||||
public class WardrobeSet
|
||||
{
|
||||
public string targetRace = "";
|
||||
public List<WardrobeSettings> wardrobeSet = new List<WardrobeSettings>();
|
||||
|
||||
public WardrobeSet() { }
|
||||
public WardrobeSet(string race)
|
||||
{
|
||||
targetRace = race;
|
||||
wardrobeSet = new List<WardrobeSettings>();
|
||||
}
|
||||
public WardrobeSet(string race, List<WardrobeSettings> settings)
|
||||
{
|
||||
targetRace = race;
|
||||
wardrobeSet = settings;
|
||||
}
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class WardrobeCollectionList
|
||||
{
|
||||
public List<WardrobeSet> sets = new List<WardrobeSet>();
|
||||
|
||||
public List<WardrobeSettings> this[string key]
|
||||
{
|
||||
get
|
||||
{
|
||||
return GetValue(key);
|
||||
}
|
||||
set
|
||||
{
|
||||
SetValue(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
sets = new List<WardrobeSet>();
|
||||
}
|
||||
|
||||
public bool Contains(string race)
|
||||
{
|
||||
bool contained = false;
|
||||
for (int i = 0; i < sets.Count; i++)
|
||||
{
|
||||
if (sets[i].targetRace == race)
|
||||
{
|
||||
contained = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return contained;
|
||||
}
|
||||
public void Add(string race)
|
||||
{
|
||||
if (!Contains(race))
|
||||
{
|
||||
sets.Add(new WardrobeSet(race));
|
||||
}
|
||||
}
|
||||
public void Add(string race, List<WardrobeSettings> settings)
|
||||
{
|
||||
if (!Contains(race))
|
||||
{
|
||||
sets.Add(new WardrobeSet(race, settings));
|
||||
}
|
||||
}
|
||||
|
||||
public void Remove(string race)
|
||||
{
|
||||
if (Contains(race))
|
||||
{
|
||||
var newSets = new List<WardrobeSet>(sets.Count - 1);
|
||||
for (int i = 0; i < sets.Count; i++)
|
||||
{
|
||||
if (sets[i].targetRace != race)
|
||||
{
|
||||
newSets.Add(new WardrobeSet(sets[i].targetRace, sets[i].wardrobeSet));
|
||||
}
|
||||
}
|
||||
sets = newSets;
|
||||
}
|
||||
}
|
||||
|
||||
public List<string> GetAllRacesInCollection()
|
||||
{
|
||||
List<string> ret = new List<string>();
|
||||
for (int i = 0; i < sets.Count; i++)
|
||||
{
|
||||
ret.Add(sets[i].targetRace);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public List<string> GetAllRecipeNamesInCollection(string forRace = "")
|
||||
{
|
||||
var collectionNames = new List<string>();
|
||||
for (int i = 0; i < sets.Count; i++)
|
||||
{
|
||||
if (forRace != "" && sets[i].targetRace != forRace)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for (int si = 0; si < sets[i].wardrobeSet.Count; si++)
|
||||
{
|
||||
if (sets[i].wardrobeSet[si].recipe != "")
|
||||
{
|
||||
collectionNames.Add(sets[i].wardrobeSet[si].recipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
return collectionNames;
|
||||
}
|
||||
|
||||
protected List<WardrobeSettings> GetValue(string key)
|
||||
{
|
||||
for (int i = 0; i < sets.Count; i++)
|
||||
{
|
||||
if (sets[i].targetRace == key)
|
||||
{
|
||||
return sets[i].wardrobeSet;
|
||||
}
|
||||
}
|
||||
return new List<WardrobeSettings>();
|
||||
}
|
||||
|
||||
protected void SetValue(string key, List<WardrobeSettings> value)
|
||||
{
|
||||
for (int i = 0; i < sets.Count; i++)
|
||||
{
|
||||
if (sets[i].targetRace == key)
|
||||
{
|
||||
sets[i].wardrobeSet = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 587a3fe806c16ba4faf96a3fe0b4b10a
|
||||
timeCreated: 1481748839
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/Extensions/DynamicCharacterSystem/Scripts/DCSStandardTypes.cs
|
||||
uploadId: 679826
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace UMA.CharacterSystem
|
||||
{
|
||||
public class DynamicCharacterSystemBase : MonoBehaviour
|
||||
{
|
||||
//just here really so that there is something that can be assigned in UMAContextBase.
|
||||
//We can make some methods available here tho
|
||||
public virtual void Awake() { }
|
||||
|
||||
public virtual void OnEnable() { }
|
||||
|
||||
public virtual void Start() { }
|
||||
|
||||
public virtual void Refresh(bool forceUpdateRaceLibrary = true, string bundleToGather = "") { }
|
||||
|
||||
public virtual void Update() { }
|
||||
|
||||
public virtual void Init() { }
|
||||
//Unfortunately we cant do anything useful that uses UMATextRecipe because that doesn't exist here
|
||||
//but we can define some methods that can be overidden so they can be used
|
||||
//except we BLOODY CANT because UMATextRecipe doesn't exist at this point
|
||||
public virtual UMARecipeBase GetBaseRecipe(string filename, bool dynamicallyAdd = true) { return null; }
|
||||
|
||||
//Again for RecipeEditor to be able to get usable info
|
||||
public virtual List<string> GetRecipeNamesForRaceSlot(string race, string slot) { return null; }
|
||||
|
||||
//Again for RecipeEditor to be able to get usable info
|
||||
public virtual List<UMARecipeBase> GetRecipesForRaceSlot(string race, string slot) { return null; }
|
||||
|
||||
//Again for RecipeEditor to get info
|
||||
public virtual bool CheckRecipeAvailability(string recipeName) { return true; }
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f4f544908028e7141bd9f915691e5b5a
|
||||
timeCreated: 1472850643
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/Extensions/DynamicCharacterSystem/Scripts/DynamicCharacterSystemBase.cs
|
||||
uploadId: 679826
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
|
||||
namespace UMA.CharacterSystem
|
||||
{
|
||||
public static class EnumExtensions
|
||||
{
|
||||
public static bool HasFlagSet(this Enum self, Enum flag)
|
||||
{
|
||||
if (self.GetType() != flag.GetType())
|
||||
{
|
||||
throw new ArgumentException("HasFlag : Flag is not of the type of Enum");
|
||||
}
|
||||
|
||||
var selfValue = Convert.ToUInt64(self);
|
||||
var flagValue = Convert.ToUInt64(flag);
|
||||
|
||||
return (selfValue & flagValue) == flagValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 784526a99b0fa4d4fa81fa5c96df92f0
|
||||
timeCreated: 1481654922
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/Extensions/DynamicCharacterSystem/Scripts/EnumExtensions.cs
|
||||
uploadId: 679826
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace UMA.CharacterSystem
|
||||
{
|
||||
public class EnumFlagsAttribute : PropertyAttribute
|
||||
{
|
||||
public EnumFlagsAttribute() { }
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 96ef98699e166d4459eeb1b38a5a9c07
|
||||
timeCreated: 1481654940
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/Extensions/DynamicCharacterSystem/Scripts/EnumFlagsAttribute.cs
|
||||
uploadId: 679826
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace UMA.CharacterSystem
|
||||
{
|
||||
public static class UMAExtensions
|
||||
{
|
||||
public static int WordCount(this String str)
|
||||
{
|
||||
return str.Split(new char[] { ' ', '.', '?' },
|
||||
StringSplitOptions.RemoveEmptyEntries).Length;
|
||||
}
|
||||
public static string ToTitleCase(this String str)
|
||||
{
|
||||
char[] sep = { ' ' };
|
||||
|
||||
string[] words = str.Split(sep,StringSplitOptions.RemoveEmptyEntries);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < words.Length; i++)
|
||||
{
|
||||
string word = words[i];
|
||||
if (word.Length > 2)
|
||||
{
|
||||
string s1 = word.Substring(0, 1).ToUpper();
|
||||
string s2 = word.Substring(1, word.Length - 1).ToLower();
|
||||
sb.Append(s1);
|
||||
sb.Append(s2);
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.Append(word.ToUpper());
|
||||
}
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public static string[] SplitCamelCase(this String str)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < str.Length; i++)
|
||||
{
|
||||
char c = str[i];
|
||||
if (i > 0 && char.IsUpper(c))
|
||||
{
|
||||
sb.Append('|');
|
||||
}
|
||||
if (i == 0)
|
||||
{
|
||||
c = char.ToUpper(c);
|
||||
}
|
||||
|
||||
sb.Append(c);
|
||||
}
|
||||
return sb.ToString().Split('|');
|
||||
}
|
||||
|
||||
public static string MenuCamelCase(this String str)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < str.Length; i++)
|
||||
{
|
||||
char c = str[i];
|
||||
if (i > 0 && char.IsUpper(c))
|
||||
{
|
||||
sb.Append('/');
|
||||
}
|
||||
if (i == 0)
|
||||
{
|
||||
c = char.ToUpper(c);
|
||||
}
|
||||
|
||||
sb.Append(c);
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
|
||||
public static string BreakupCamelCase(this String str)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i=0;i<str.Length;i++)
|
||||
{
|
||||
char c = str[i];
|
||||
if (i > 0 && char.IsUpper(c))
|
||||
{
|
||||
sb.Append(' ');
|
||||
}
|
||||
if (i==0)
|
||||
{
|
||||
c = char.ToUpper(c);
|
||||
}
|
||||
|
||||
sb.Append(c);
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 450251df66e2314469043cdcabdd62ca
|
||||
timeCreated: 1457986327
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/Extensions/DynamicCharacterSystem/Scripts/ExtensionMethods.cs
|
||||
uploadId: 679826
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace UMA.CharacterSystem
|
||||
{
|
||||
public class UMAExtendedAvatar : UMADynamicAvatar
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
|
||||
public bool showPlaceholder = true;
|
||||
private Mesh previewMesh;
|
||||
public enum PreviewModel {Male, Female}
|
||||
public PreviewModel previewModel;
|
||||
public Color previewColor = Color.grey;
|
||||
private PreviewModel lastPreviewModel;
|
||||
private Material mat;
|
||||
#endif
|
||||
|
||||
// Draws Placeholder Model
|
||||
#if UNITY_EDITOR
|
||||
|
||||
void OnDrawGizmos()
|
||||
{
|
||||
// Build Shader
|
||||
if (!mat)
|
||||
{
|
||||
Shader shader = Shader.Find ("Hidden/Internal-Colored");
|
||||
mat = new Material (shader);
|
||||
mat.hideFlags = HideFlags.HideAndDontSave;
|
||||
}
|
||||
|
||||
if(showPlaceholder){
|
||||
// Check for mesh Change
|
||||
if(!previewMesh || lastPreviewModel != previewModel)
|
||||
{
|
||||
LoadMesh();
|
||||
}
|
||||
|
||||
mat.color = previewColor;
|
||||
if(!Application.isPlaying && previewMesh != null)
|
||||
{
|
||||
|
||||
mat.SetPass(0);
|
||||
Graphics.DrawMeshNow(previewMesh, Matrix4x4.TRS(transform.position, transform.rotation * Quaternion.Euler(-90,180,0), new Vector3(0.88f,0.88f,0.88f)));
|
||||
}
|
||||
lastPreviewModel = previewModel;
|
||||
}
|
||||
}
|
||||
|
||||
void LoadMesh()
|
||||
{
|
||||
//search string finds both male and female!
|
||||
string[] assets = UnityEditor.AssetDatabase.FindAssets("t:Model Male_Unified");
|
||||
string male = "";
|
||||
string female = "";
|
||||
GameObject model = null;
|
||||
|
||||
for (int i = 0; i < assets.Length; i++)
|
||||
{
|
||||
string guid = assets[i];
|
||||
string thePath = UnityEditor.AssetDatabase.GUIDToAssetPath(guid);
|
||||
if (thePath.ToLower().Contains("female"))
|
||||
{
|
||||
female = thePath;
|
||||
}
|
||||
else
|
||||
{
|
||||
male = thePath;
|
||||
}
|
||||
}
|
||||
|
||||
if (previewModel == PreviewModel.Male)
|
||||
{
|
||||
if(!string.IsNullOrEmpty(male))
|
||||
{
|
||||
model = UnityEditor.AssetDatabase.LoadAssetAtPath<GameObject>(male);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(Debug.isDebugBuild)
|
||||
{
|
||||
Debug.LogWarning("Could not load Male_Unified model for preview!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (previewModel == PreviewModel.Female)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(female))
|
||||
{
|
||||
model = UnityEditor.AssetDatabase.LoadAssetAtPath<GameObject>(female);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Debug.isDebugBuild)
|
||||
{
|
||||
Debug.LogWarning("Could not load Female_Unified model for preview!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (model != null)
|
||||
{
|
||||
previewMesh = model.GetComponentInChildren<SkinnedMeshRenderer>().sharedMesh;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Debug.isDebugBuild)
|
||||
{
|
||||
Debug.LogWarning("Preview Model not found on object " + gameObject.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2775cfae9e4ac344faa2bda63c1a86b0
|
||||
timeCreated: 1484950941
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/Extensions/DynamicCharacterSystem/Scripts/UMAExtendedAvatar.cs
|
||||
uploadId: 679826
|
||||
+569
@@ -0,0 +1,569 @@
|
||||
using UnityEngine;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace UMA
|
||||
{
|
||||
public partial class RaceData
|
||||
{
|
||||
[Tooltip("This should be set to true for Blender FBX models")]
|
||||
public bool FixupRotations = true;
|
||||
|
||||
[Tooltip("UMA Text recipe that holds the slots and overlays that are the default set up for this race.")]
|
||||
public UMARecipeBase baseRaceRecipe;
|
||||
[Tooltip("Wardobe slots that wardrobe recipes can be assigned to.")]
|
||||
public List<string> wardrobeSlots = new List<string>(){
|
||||
"None",
|
||||
"Face",
|
||||
"Hair",
|
||||
"Complexion",
|
||||
"Eyebrows",
|
||||
"Beard",
|
||||
"Ears",
|
||||
"Helmet",
|
||||
"Shoulders",
|
||||
"Chest",
|
||||
"Arms",
|
||||
"Hands",
|
||||
"Waist",
|
||||
"Legs",
|
||||
"Feet"
|
||||
};
|
||||
|
||||
private UMAPackedRecipeBase.UMAPackRecipe packedRecipe;
|
||||
|
||||
private UMAData.UMARecipe unPackedRecipe;
|
||||
private Dictionary<string, float> RaceDNAValues = new Dictionary<string, float>();
|
||||
private List<OverlayColorData> RaceColorValues = new List<OverlayColorData>();
|
||||
|
||||
//UMA26 we want to depricate this- how much do we need to worry about the fact that users could do backwardsCompatibleWith.Add/Remove via scripting before?
|
||||
[Obsolete("[RaceData backwardsCompatibleWith is deprecated and will be removed in a future version. Please use RaceData.CrossCompatibleRaces instead.")]
|
||||
public List<string> backwardsCompatibleWith = new List<string>();
|
||||
|
||||
//CrossCompatibilitySettings allows this race to wear wardrobe slots from another race, if this race has a wardrobe slot that the recipe is set to.
|
||||
//You can further configure the compatibility settings for each compatible race to define 'equivalent' slotdatas in the races' base recipes. For example you could define
|
||||
//that this races 'highpolyMaleChest' slotdata in its base recipe is equivalent to HumanMales 'MaleChest' slot data in its base recipe. This would mean that any recipes which hid or applied an overlay to 'MaleChest'
|
||||
//would hide or apply an overlay to 'highPolyMaleChest' on this race. If 'Overlays Match' is unchecked then overlays in a recipe wont be applied.
|
||||
[SerializeField]
|
||||
private CrossCompatibilitySettingsList _crossCompatibilitySettings = new CrossCompatibilitySettingsList();
|
||||
|
||||
public RaceThumbnails raceThumbnails;
|
||||
|
||||
|
||||
public List<OverlayColorData> GetDefaultColors()
|
||||
{
|
||||
if (RaceColorValues.Count > 0)
|
||||
{
|
||||
return RaceColorValues;
|
||||
}
|
||||
if (GetPackedRecipe() == null)
|
||||
{
|
||||
return RaceColorValues;
|
||||
}
|
||||
|
||||
OverlayColorData[] colors = UMAPackedRecipeBase.UnpackColors(packedRecipe);
|
||||
RaceColorValues.AddRange(colors);
|
||||
return RaceColorValues;
|
||||
}
|
||||
|
||||
public UMAPackedRecipeBase.UMAPackRecipe GetPackedRecipe()
|
||||
{
|
||||
if (packedRecipe != null)
|
||||
{
|
||||
return packedRecipe;
|
||||
}
|
||||
|
||||
packedRecipe = (baseRaceRecipe as UMATextRecipe).PackedLoad(UMAContextBase.Instance);
|
||||
|
||||
return packedRecipe;
|
||||
}
|
||||
|
||||
private Dictionary<string,List<string>> _usedBlendshapeNames = null;
|
||||
|
||||
public Dictionary<string, List<string>> GetDNAToBlendShapes()
|
||||
{
|
||||
if (_usedBlendshapeNames != null)
|
||||
{
|
||||
return _usedBlendshapeNames;
|
||||
}
|
||||
_usedBlendshapeNames = new Dictionary<string, List<string>>();
|
||||
for(int i=0; i< dnaConverterList.Length; i++)
|
||||
{
|
||||
var plugins = dnaConverterList[i].GetPlugins();
|
||||
for (int j=0;j< plugins.Count; j++)
|
||||
{
|
||||
if (plugins[j] is BlendshapeDNAConverterPlugin)
|
||||
{
|
||||
var plugin = plugins[j] as BlendshapeDNAConverterPlugin;
|
||||
plugin.blendshapeDNAConverters.ForEach((converter) =>
|
||||
{
|
||||
converter.UsedDNANames.ForEach((name) =>
|
||||
{
|
||||
if (_usedBlendshapeNames.ContainsKey(name) == false)
|
||||
{
|
||||
_usedBlendshapeNames.Add(name, new List<string>());
|
||||
}
|
||||
_usedBlendshapeNames[name].Add(converter.blendshapeToApply);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return _usedBlendshapeNames;
|
||||
}
|
||||
|
||||
public Dictionary<string, float> GetDefaultDNA()
|
||||
{
|
||||
if (GetPackedRecipe() == null)
|
||||
{
|
||||
return RaceDNAValues;
|
||||
}
|
||||
if (RaceDNAValues.Count == 0)
|
||||
{
|
||||
List<UMADnaBase> dna = UMAPackedRecipeBase.UnPackDNA(packedRecipe.packedDna);
|
||||
for (int i1 = 0; i1 < dna.Count; i1++)
|
||||
{
|
||||
UMADnaBase udb = dna[i1];
|
||||
for (int i=0;i < udb.Names.Length;i++)
|
||||
{
|
||||
if (RaceDNAValues.ContainsKey(udb.Names[i]) == false)
|
||||
{
|
||||
RaceDNAValues.Add(udb.Names[i], udb.Values[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return RaceDNAValues;
|
||||
}
|
||||
|
||||
|
||||
//Not sure if this is needed I think I could just set the wardrobe slots property to be this by default?
|
||||
public void AddDefaultWardrobeSlots(bool forceOverride = false)
|
||||
{
|
||||
if (wardrobeSlots.Count == 0 || forceOverride)
|
||||
{
|
||||
wardrobeSlots = new List<string>() {
|
||||
"None",
|
||||
"Face",
|
||||
"Hair",
|
||||
"Complexion",
|
||||
"Eyebrows",
|
||||
"Beard",
|
||||
"Ears",
|
||||
"Helmet",
|
||||
"Shoulders",
|
||||
"Chest",
|
||||
"Arms",
|
||||
"Hands",
|
||||
"Waist",
|
||||
"Legs",
|
||||
"Feet"
|
||||
};
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Validates the wardrobe slots.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c>, if wardrobe slots was validated, <c>false</c> otherwise.</returns>
|
||||
/// <param name="setToDefault">If set to <c>true</c> wardrobeSlots are set to default (returns true).</param>
|
||||
public bool ValidateWardrobeSlots(bool setToDefault = false)
|
||||
{
|
||||
if (wardrobeSlots.Count == 0)
|
||||
{
|
||||
AddDefaultWardrobeSlots(setToDefault);
|
||||
return setToDefault;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//For backwards compatibility
|
||||
[Obsolete("findBackwardsCompatibleWith has been depricated and will be removed in a future version. Please use 'IsCrossCompatibleWith' instead.")]
|
||||
public bool findBackwardsCompatibleWith(List<string> compatibleStrings)
|
||||
{
|
||||
return IsCrossCompatibleWith(compatibleStrings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Given a raceNames returns whether this race has been set to be 'cross compatible' with that race.
|
||||
/// </summary>
|
||||
public bool IsCrossCompatibleWith(RaceData compatibleRace)
|
||||
{
|
||||
return GetCrossCompatibleRaces().Contains(compatibleRace.raceName);
|
||||
}
|
||||
/// <summary>
|
||||
/// Given a raceNames returns whether this race has been set to be 'cross compatible' with that race.
|
||||
/// </summary>
|
||||
public bool IsCrossCompatibleWith(string compatibleString)
|
||||
{
|
||||
return GetCrossCompatibleRaces().Contains(compatibleString);
|
||||
}
|
||||
/// <summary>
|
||||
/// Given a list of raceNames returns whether this race has been set to be 'cross compatible' with any of those races.
|
||||
/// </summary>
|
||||
public bool IsCrossCompatibleWith(List<string> compatibleStrings)
|
||||
{
|
||||
for (int i = 0; i < compatibleStrings.Count; i++)
|
||||
{
|
||||
string val = compatibleStrings[i];
|
||||
if (GetCrossCompatibleRaces().Contains(val))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// backwards compatibility: Updates any Races from before _crossCompatibilitySettings so their backwards compatible races are added automatically. If the race is being inspected these changes are saved - remove in a future version
|
||||
/// </summary>
|
||||
private void UpdateOldRace()
|
||||
{
|
||||
#pragma warning disable 618
|
||||
if (_crossCompatibilitySettings.settingsData.Count == 0 && backwardsCompatibleWith.Count > 0)
|
||||
{
|
||||
SetCrossCompatibleRaces(backwardsCompatibleWith);
|
||||
//then clear the backwardsCompatibleWith list and save the asset- the user wont be able to use 'backwardsCompatibleWith'
|
||||
//but they will have been shown a warning if their scripts access the field directly
|
||||
#if UNITY_EDITOR
|
||||
if (Debug.isDebugBuild)
|
||||
{
|
||||
Debug.Log("RaceData for " + raceName + " updated its backwardsCompatibleWith value to the new CrossCompatibilitySettings. All good.");
|
||||
}
|
||||
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
//Debug.Log("RaceData for " + raceName + " updated its backwardsCompatibleWith value to the new CrossCompatibilitySettings. All good.");
|
||||
backwardsCompatibleWith.Clear();
|
||||
EditorUtility.SetDirty(this);
|
||||
AssetDatabase.SaveAssets();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#pragma warning restore 618
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the list of raceNames that this race has set to be 'cross compatible' with
|
||||
/// </summary>
|
||||
public List<string> GetCrossCompatibleRaces()
|
||||
{
|
||||
UpdateOldRace();
|
||||
List<string> ccRaces = new List<string>();
|
||||
for (int i = 0; i < _crossCompatibilitySettings.settingsData.Count; i++)
|
||||
{
|
||||
ccRaces.Add(_crossCompatibilitySettings.settingsData[i].ccRace);
|
||||
}
|
||||
|
||||
return ccRaces;
|
||||
}
|
||||
/// <summary>
|
||||
/// Sets the races that this race can be 'cross compatible with.
|
||||
/// </summary>
|
||||
public void SetCrossCompatibleRaces(List<string> ccRaces)
|
||||
{
|
||||
for (int i = 0; i < ccRaces.Count; i++)
|
||||
{
|
||||
_crossCompatibilitySettings.Add(ccRaces[i]);
|
||||
}
|
||||
//then remove any that were not in the list
|
||||
List<string> racesToRemove = new List<string>();
|
||||
for (int i = 0; i < _crossCompatibilitySettings.settingsData.Count; i++)
|
||||
{
|
||||
if (!ccRaces.Contains(_crossCompatibilitySettings.settingsData[i].ccRace))
|
||||
{
|
||||
racesToRemove.Add(_crossCompatibilitySettings.settingsData[i].ccRace);
|
||||
}
|
||||
}
|
||||
_crossCompatibilitySettings.Remove(racesToRemove);
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets the cross compatibility settings that have been defined for this race
|
||||
/// </summary>
|
||||
protected List<CrossCompatibilityData> GetSettingsFor(string crossCompatibleRace)
|
||||
{
|
||||
for (int i = 0; i < _crossCompatibilitySettings.settingsData.Count; i++)
|
||||
{
|
||||
if (_crossCompatibilitySettings.settingsData[i].ccRace == crossCompatibleRace)
|
||||
{
|
||||
return _crossCompatibilitySettings.settingsData[i].ccSettings;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/// <summary>
|
||||
/// If this race has been defined as being 'cross compatible' with any of the given races, this will return the slot in this races base recipe that has been defined as
|
||||
/// equivalent to the given slot in the given races (optionally only returning a value if the overlays have ALSO been defined as matching)
|
||||
/// </summary>
|
||||
/// <param name="races">The cross compatible races to check. i.e. is this race defined as compatible with any of these races</param>
|
||||
/// <param name="crossCompatibleSlot">The slot to check. i.e. if this race IS defined as compatible with one of the above races, does it define that it has a slot that is equivalent to the given slot</param>
|
||||
/// <param name="overlaysMustMatch">If this is true, an equivalent slot will only be returned if it has also been defined as having Overlay scales that match the cross compatible race</param>
|
||||
/// <returns></returns>
|
||||
public string FindEquivalentSlot(List<string> races, string crossCompatibleSlot, bool overlaysMustMatch = true)
|
||||
{
|
||||
for (int i = 0; i < races.Count; i++)
|
||||
{
|
||||
var foundEquivalent = FindEquivalentSlot(races[i], crossCompatibleSlot, overlaysMustMatch);
|
||||
if (foundEquivalent != "")
|
||||
{
|
||||
return foundEquivalent;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
/// <param name="race">The cross compatible race to check. i.e. is this race defined as compatible with the given race</param>
|
||||
public string FindEquivalentSlot(string race, string crossCompatibleSlot, bool overlaysMustMatch = true)
|
||||
{
|
||||
for (int i = 0; i < _crossCompatibilitySettings.settingsData.Count; i++)
|
||||
{
|
||||
if (_crossCompatibilitySettings.settingsData[i].ccRace == race)
|
||||
{
|
||||
return _crossCompatibilitySettings.settingsData[i].GetEquivalentSlot(crossCompatibleSlot, overlaysMustMatch);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
/// <summary>
|
||||
/// Searches this races Cross compatibility settings for the given slot and returns whether its equivalent slot (if defined) has been defined as having compatible overlays
|
||||
/// </summary>
|
||||
public bool GetOverlayCompatibility(string crossCompatibleSlot)
|
||||
{
|
||||
for (int i = 0; i < _crossCompatibilitySettings.settingsData.Count; i++)
|
||||
{
|
||||
var compatibilityForThisRace = _crossCompatibilitySettings.settingsData[i].GetOverlayCompatibility(crossCompatibleSlot);
|
||||
if (compatibilityForThisRace != -1)
|
||||
{
|
||||
return compatibilityForThisRace == 1 ? true : false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/// <summary>
|
||||
/// Searches this races Cross compatibility settings for the given race to find the given slot and returns whether its equivalent slot (if defined) has been defined as having compatible overlays
|
||||
/// </summary>
|
||||
public bool GetOverlayCompatibility(string race, string crossCompatibleSlot)
|
||||
{
|
||||
for (int i = 0; i < _crossCompatibilitySettings.settingsData.Count; i++)
|
||||
{
|
||||
if (_crossCompatibilitySettings.settingsData[i].ccRace == race)
|
||||
{
|
||||
return _crossCompatibilitySettings.settingsData[i].GetOverlayCompatibility(crossCompatibleSlot) == 1 ? true : false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#region SpecialTypes
|
||||
|
||||
//new classes for CrossCompatibilitySettings
|
||||
//allows the user to define that a given slot in this races base recipe is equal to the named slot in the backwards compatible races base recipe
|
||||
[System.Serializable]
|
||||
protected class CrossCompatibilityData
|
||||
{
|
||||
//the slot in this race's baseRaceRecipe
|
||||
public string raceSlot = "";
|
||||
//the slot in the other races baseRaceRecipe that should be considered equivalent
|
||||
public string compatibleRaceSlot = "";
|
||||
//are the overlay resolutions the same, if not overlays in recipes on the compatible race will not be copied over
|
||||
public bool overlaysMatch;
|
||||
|
||||
public CrossCompatibilityData() { }
|
||||
|
||||
public CrossCompatibilityData(string _raceSlot, string _compatibleRaceSlot)
|
||||
{
|
||||
raceSlot = _raceSlot;
|
||||
compatibleRaceSlot = _compatibleRaceSlot;
|
||||
}
|
||||
|
||||
public CrossCompatibilityData(string _raceSlot, string _compatibleRaceSlot, bool _overlaysMatch)
|
||||
{
|
||||
raceSlot = _raceSlot;
|
||||
compatibleRaceSlot = _compatibleRaceSlot;
|
||||
overlaysMatch = _overlaysMatch;
|
||||
}
|
||||
}
|
||||
[System.Serializable]
|
||||
protected class CrossCompatibilitySettings
|
||||
{
|
||||
public string ccRace = "";
|
||||
public List<CrossCompatibilityData> ccSettings = new List<CrossCompatibilityData>();
|
||||
|
||||
public CrossCompatibilitySettings() { }
|
||||
|
||||
public CrossCompatibilitySettings(string race)
|
||||
{
|
||||
ccRace = race;
|
||||
}
|
||||
public CrossCompatibilitySettings(string race, List<CrossCompatibilityData> settings)
|
||||
{
|
||||
ccRace = race;
|
||||
ccSettings = settings;
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns the slot in the COMPATIBLE race that has been defined as equivalent to the given slot from THIS race
|
||||
/// </summary>
|
||||
public string GetCompatibleRacesSlot(string thisRacesSlot)
|
||||
{
|
||||
for (int i = 0; i < ccSettings.Count; i++)
|
||||
{
|
||||
if (ccSettings[i].raceSlot == thisRacesSlot)
|
||||
{
|
||||
return ccSettings[i].compatibleRaceSlot;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns the slot in THIS race that has been defined as equivalent to the given slot from the COMPATIBLE race
|
||||
/// </summary>
|
||||
public string GetEquivalentSlot(string compatibleSlot, bool overlaysMustMatch = true)
|
||||
{
|
||||
for (int i = 0; i < ccSettings.Count; i++)
|
||||
{
|
||||
if (ccSettings[i].compatibleRaceSlot == compatibleSlot)
|
||||
{
|
||||
if ((overlaysMustMatch == true && ccSettings[i].overlaysMatch == true) || overlaysMustMatch == false)
|
||||
{
|
||||
return ccSettings[i].raceSlot;
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns whether the given slot in THIS race has been defined as having compatible overlays with the given slot from the COMPATIBLE race
|
||||
/// </summary>
|
||||
public int GetOverlayCompatibility(string compatibleRaceSlot)
|
||||
{
|
||||
for (int i = 0; i < ccSettings.Count; i++)
|
||||
{
|
||||
if (ccSettings[i].compatibleRaceSlot == compatibleRaceSlot)
|
||||
{
|
||||
return ccSettings[i].overlaysMatch ? 1 : 0;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
/// <summary>
|
||||
/// Defines that a slot in THIS race is compatible with the given slot from the COMPATIBLE race (optionally defining overlay compatibility as false)
|
||||
/// </summary>
|
||||
public void SetEquivalentSlot(string thisRacesSlot, string compatibleRacesSlot = "", bool overlayCompatibility = true)
|
||||
{
|
||||
bool found = false;
|
||||
for (int i = 0; i < ccSettings.Count; i++)
|
||||
{
|
||||
if (ccSettings[i].raceSlot == thisRacesSlot)
|
||||
{
|
||||
ccSettings[i].compatibleRaceSlot = compatibleRacesSlot;
|
||||
ccSettings[i].overlaysMatch = overlayCompatibility;
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
ccSettings.Add(new CrossCompatibilityData(thisRacesSlot, compatibleRacesSlot, overlayCompatibility));
|
||||
}
|
||||
}
|
||||
}
|
||||
[System.Serializable]
|
||||
protected class CrossCompatibilitySettingsList
|
||||
{
|
||||
|
||||
public List<CrossCompatibilitySettings> settingsData = new List<CrossCompatibilitySettings>();
|
||||
|
||||
public bool Contains(string crossCompatibleRace)
|
||||
{
|
||||
for (int i = 0; i < settingsData.Count; i++)
|
||||
{
|
||||
if (settingsData[i].ccRace == crossCompatibleRace)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Add(string crossCompatibleRace)
|
||||
{
|
||||
if (!Contains(crossCompatibleRace))
|
||||
{
|
||||
settingsData.Add(new CrossCompatibilitySettings(crossCompatibleRace));
|
||||
}
|
||||
}
|
||||
|
||||
public void Remove(List<string> races)
|
||||
{
|
||||
for (int i = 0; i < races.Count; i++)
|
||||
{
|
||||
Remove(races[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public void Remove(string crossCompatibleRace)
|
||||
{
|
||||
int removeAt = -1;
|
||||
for (int i = 0; i < settingsData.Count; i++)
|
||||
{
|
||||
if (settingsData[i].ccRace == crossCompatibleRace)
|
||||
{
|
||||
removeAt = i;
|
||||
}
|
||||
}
|
||||
if (removeAt > -1)
|
||||
{
|
||||
settingsData.RemoveAt(removeAt);
|
||||
}
|
||||
}
|
||||
}
|
||||
//Race Thumbnails used in the GUI to give a visual representation of the race
|
||||
[System.Serializable]
|
||||
public class RaceThumbnails
|
||||
{
|
||||
[System.Serializable]
|
||||
public class WardrobeSlotThumb
|
||||
{
|
||||
[Tooltip("A comma separated list of wardrobe slots this is the base thumbnail for (no spaces)")]
|
||||
public string thumbIsFor = "";
|
||||
public Sprite thumb = null;
|
||||
}
|
||||
public Sprite fullThumb = null;
|
||||
public Sprite faceThumb = null;
|
||||
[SerializeField]
|
||||
List<WardrobeSlotThumb> wardrobeSlotThumbs = new List<WardrobeSlotThumb>();
|
||||
|
||||
public Sprite GetThumbFor(string thumbToGet = "")
|
||||
{
|
||||
Sprite foundSprite = fullThumb != null ? fullThumb : null;
|
||||
for (int i = 0; i < wardrobeSlotThumbs.Count; i++)
|
||||
{
|
||||
WardrobeSlotThumb wardrobeThumb = wardrobeSlotThumbs[i];
|
||||
string[] thumbIsForArray = null;
|
||||
wardrobeThumb.thumbIsFor.Replace(" ,", ",").Replace(", ", ",");
|
||||
if (wardrobeThumb.thumbIsFor.IndexOf(",") == -1)
|
||||
{
|
||||
thumbIsForArray = new string[1] { wardrobeThumb.thumbIsFor };
|
||||
}
|
||||
else
|
||||
{
|
||||
thumbIsForArray = wardrobeThumb.thumbIsFor.Split(new string[1] { "," }, StringSplitOptions.RemoveEmptyEntries);
|
||||
}
|
||||
for (int i1 = 0; i1 < thumbIsForArray.Length; i1++)
|
||||
{
|
||||
string thumbFor = thumbIsForArray[i1];
|
||||
if (thumbFor == thumbToGet)
|
||||
{
|
||||
foundSprite = wardrobeThumb.thumb;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return foundSprite;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 693273374619be643933f926eeea3408
|
||||
timeCreated: 1457203635
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/Extensions/DynamicCharacterSystem/Scripts/pRaceData.cs
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 69a1efbd37244ba4db05c8edf891f9fd
|
||||
folderAsset: yes
|
||||
timeCreated: 1489775616
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,26 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace UMA.Dynamics
|
||||
{
|
||||
[System.Serializable]
|
||||
public class ColliderDefinition
|
||||
{
|
||||
[System.Serializable]
|
||||
public enum ColliderType {Box, Sphere, Capsule}
|
||||
public ColliderType colliderType;
|
||||
public Vector3 colliderCentre;
|
||||
|
||||
//Box Collider Only
|
||||
[Tooltip("The size of the box collider")]
|
||||
public Vector3 boxDimensions;
|
||||
|
||||
//Sphere Collider Only
|
||||
public float sphereRadius;
|
||||
|
||||
//Capsule Collider Only
|
||||
public float capsuleRadius;
|
||||
public float capsuleHeight;
|
||||
public enum Direction {X,Y,Z}
|
||||
public Direction capsuleAlignment;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f923c94faf4f62e4e8f3d644a887182d
|
||||
timeCreated: 1489783251
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/Extensions/UMAPhysics/ColliderDefinition.cs
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,543 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UMA.PoseTools;
|
||||
using UMA.CharacterSystem;
|
||||
|
||||
namespace UMA.Dynamics
|
||||
{
|
||||
public class UMAPhysicsAvatar : MonoBehaviour
|
||||
{
|
||||
// property to activate/deactivate ragdoll mode (exposed in editor by script "UMAPhysicsAvatarEditor.cs")
|
||||
public bool ragdolled
|
||||
{
|
||||
get { return _ragdolled; }
|
||||
set { SetRagdolled (value); }
|
||||
}
|
||||
// Variable to store ragdoll state
|
||||
private bool _ragdolled = false;
|
||||
|
||||
[Tooltip("Set this to true if you know the player will use a capsule collider and rigidbody")]
|
||||
public bool simplePlayerCollider = true;
|
||||
[Tooltip("Set this to have your body collider act as triggers when not ragdolled")]
|
||||
public bool enableColliderTriggers = false;
|
||||
|
||||
[Tooltip("Experimental, for blending animations with physics")]
|
||||
[HideInInspector]
|
||||
[Range(0,1f)]
|
||||
public float ragdollBlendAmount;
|
||||
|
||||
[Tooltip("Set this to snap the Avatar to the position of it's hip after ragdoll is finished")]
|
||||
public bool UpdateTransformAfterRagdoll = true;
|
||||
[Tooltip("Check this to set the player layer to the current layer, and read the 'ragdoll' layer from the settings")]
|
||||
public bool AutoSetLayers = false;
|
||||
[Tooltip("Layer to set the ragdoll colliders on. See layer based collision")]
|
||||
public int ragdollLayer = 8;
|
||||
[Tooltip("Layer to set the player collider on. See layer based collision")]
|
||||
public int playerLayer = 9;
|
||||
|
||||
[Tooltip("List of Physics Elements, see UMAPhysicsElement class")]
|
||||
public List<UMAPhysicsElement> elements = new List<UMAPhysicsElement>();
|
||||
|
||||
public UnityEvent onRagdollStarted;
|
||||
public UnityEvent onRagdollEnded;
|
||||
|
||||
private DynamicCharacterAvatar _avatar;
|
||||
private UMAData _umaData;
|
||||
private GameObject _rootBone;
|
||||
private List<Rigidbody> _rigidbodies = new List<Rigidbody> ();
|
||||
private bool[] SaveRagdollStates = new bool[0];
|
||||
|
||||
|
||||
public List<BoxCollider> BoxColliders { get { return _BoxColliders; } }
|
||||
private List<BoxCollider> _BoxColliders = new List<BoxCollider> ();
|
||||
|
||||
public List<ClothSphereColliderPair> SphereColliders { get { return _SphereColliders; }}
|
||||
private List<ClothSphereColliderPair> _SphereColliders = new List<ClothSphereColliderPair>();
|
||||
|
||||
public List<CapsuleCollider> CapsuleColliders { get { return _CapsuleColliders; }}
|
||||
private List<CapsuleCollider> _CapsuleColliders = new List<CapsuleCollider>();
|
||||
|
||||
|
||||
private CapsuleCollider _playerCollider;
|
||||
private Rigidbody _playerRigidbody;
|
||||
|
||||
struct CachedBone
|
||||
{
|
||||
public Transform boneTransform;
|
||||
public Vector3 localPosition;
|
||||
public Quaternion localRotation;
|
||||
public Vector3 localScale;
|
||||
|
||||
public CachedBone(Transform transform)
|
||||
{
|
||||
boneTransform = transform;
|
||||
localPosition = transform.localPosition;
|
||||
localRotation = transform.localRotation;
|
||||
localScale = transform.localScale;
|
||||
}
|
||||
}
|
||||
private List<CachedBone> cachedBones = new List<CachedBone>();
|
||||
|
||||
// Use this for initialization
|
||||
void Start ()
|
||||
{
|
||||
if (AutoSetLayers)
|
||||
{
|
||||
playerLayer = gameObject.layer;
|
||||
ragdollLayer = LayerMask.NameToLayer("Ragdoll");
|
||||
}
|
||||
else
|
||||
{
|
||||
gameObject.layer = playerLayer;
|
||||
}
|
||||
|
||||
_avatar = GetComponent<DynamicCharacterAvatar>();
|
||||
//Using DCS
|
||||
if (_avatar != null)
|
||||
{
|
||||
_avatar.CharacterCreated.AddListener(OnCharacterCreatedCallback);
|
||||
_avatar.CharacterBegun.AddListener(OnCharacterBegunCallback);
|
||||
_avatar.CharacterUpdated.AddListener(OnCharacterUpdatedCallback);
|
||||
}
|
||||
else
|
||||
{
|
||||
//if we're not using the DCS then this will be created through a recipe
|
||||
_umaData = gameObject.GetComponent<UMAData>();
|
||||
|
||||
if (_umaData != null)
|
||||
{
|
||||
_umaData.CharacterCreated.AddListener(OnCharacterCreatedCallback);
|
||||
_umaData.CharacterBegun.AddListener(OnCharacterBegunCallback);
|
||||
_umaData.CharacterUpdated.AddListener(OnCharacterUpdatedCallback);
|
||||
}
|
||||
}
|
||||
|
||||
if (!Physics.GetIgnoreLayerCollision(ragdollLayer, playerLayer))
|
||||
{
|
||||
if (Debug.isDebugBuild)
|
||||
{
|
||||
Debug.LogWarning("RagdollLayer and PlayerLayer are not ignoring each other! This will cause collision issues. Please update the collision matrix or 'Add Default Layers' in the Physics Slot Definition");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
if (_avatar != null)
|
||||
{
|
||||
_avatar.CharacterCreated.RemoveListener(OnCharacterCreatedCallback);
|
||||
_avatar.CharacterBegun.RemoveListener(OnCharacterBegunCallback);
|
||||
_avatar.CharacterUpdated.RemoveListener(OnCharacterUpdatedCallback);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_umaData != null)
|
||||
{
|
||||
_umaData.CharacterCreated.RemoveListener(OnCharacterCreatedCallback);
|
||||
_umaData.CharacterBegun.RemoveListener(OnCharacterBegunCallback);
|
||||
_umaData.CharacterUpdated.RemoveListener(OnCharacterUpdatedCallback);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FixedUpdate()
|
||||
{
|
||||
if (ragdollBlendAmount > 0)
|
||||
{
|
||||
for (int i = 0; i < _rigidbodies.Count; i++)
|
||||
{
|
||||
Rigidbody rigidbody = _rigidbodies[i];
|
||||
if (_rootBone && rigidbody.gameObject.name != _rootBone.name)
|
||||
{ //this if is to prevent us from modifying the root of the character, only the actual body parts
|
||||
//rotation is interpolated for all body parts
|
||||
rigidbody.transform.rotation = Quaternion.Slerp (rigidbody.transform.rotation, Quaternion.identity, ragdollBlendAmount);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void OnCharacterCreatedCallback(UMAData umaData)
|
||||
{
|
||||
CreatePhysicsObjects();
|
||||
}
|
||||
|
||||
public void OnCharacterBegunCallback(UMAData umaData)
|
||||
{
|
||||
if (_ragdolled)
|
||||
{
|
||||
cachedBones.Clear();
|
||||
foreach (int hash in umaData.skeleton.BoneHashes)
|
||||
{
|
||||
Transform boneTransform = umaData.skeleton.GetBoneTransform(hash);
|
||||
if(boneTransform != null)
|
||||
{
|
||||
CachedBone cachedBone = new CachedBone(boneTransform);
|
||||
cachedBones.Add(cachedBone);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void OnCharacterUpdatedCallback(UMAData umaData)
|
||||
{
|
||||
if (_ragdolled)
|
||||
{
|
||||
for (int i = 0; i < cachedBones.Count; i++)
|
||||
{
|
||||
CachedBone cachedbone = cachedBones[i];
|
||||
cachedbone.boneTransform.localPosition = cachedbone.localPosition;
|
||||
cachedbone.boneTransform.localRotation = cachedbone.localRotation;
|
||||
cachedbone.boneTransform.localScale = cachedbone.localScale;
|
||||
}
|
||||
cachedBones.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public void CreatePhysicsObjects()
|
||||
{
|
||||
if( _umaData == null )
|
||||
{
|
||||
_umaData = gameObject.GetComponent<UMAData> ();
|
||||
}
|
||||
|
||||
if (_umaData == null)
|
||||
{
|
||||
if (Debug.isDebugBuild)
|
||||
{
|
||||
Debug.LogError ("CreatePhysicsObjects: umaData is null!");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
SetRendereroffscreenStates();
|
||||
|
||||
//Don't update if we already have a rigidbody on the root bone?
|
||||
if ( _rootBone && _rootBone.GetComponent<Rigidbody> () )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (simplePlayerCollider)
|
||||
{
|
||||
_playerCollider = gameObject.GetComponent<CapsuleCollider> ();
|
||||
_playerRigidbody = gameObject.GetComponent<Rigidbody> ();
|
||||
if (_playerCollider == null || _playerRigidbody == null)
|
||||
{
|
||||
if (Debug.isDebugBuild)
|
||||
{
|
||||
Debug.LogWarning("PlayerCollider or PlayerRigidBody is null, try putting the collider recipe before the PhysicsRecipe, or turn off SimplePlayerCollider.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < elements.Count; i++)
|
||||
{
|
||||
UMAPhysicsElement element = elements[i];
|
||||
if (element != null)
|
||||
{
|
||||
// add Generic Info
|
||||
GameObject bone = _umaData.GetBoneGameObject (element.boneName);
|
||||
|
||||
if (bone == null)
|
||||
{
|
||||
if (Debug.isDebugBuild)
|
||||
{
|
||||
Debug.LogWarning("UMAPhysics: " + element.boneName + " not found!");
|
||||
}
|
||||
|
||||
continue; //if we don't find the bone then go to the next iteration
|
||||
}
|
||||
|
||||
if (!bone.GetComponent<Rigidbody>())
|
||||
{
|
||||
Rigidbody rigidBody = bone.AddComponent<Rigidbody>();
|
||||
rigidBody.isKinematic = true;
|
||||
rigidBody.mass = element.mass;
|
||||
_rigidbodies.Add(rigidBody);
|
||||
}
|
||||
|
||||
bone.layer = ragdollLayer;
|
||||
|
||||
for (int i1 = 0; i1 < element.colliders.Length; i1++)
|
||||
{
|
||||
ColliderDefinition collider = element.colliders[i1];
|
||||
// Add Appropriate Collider
|
||||
if (collider.colliderType == ColliderDefinition.ColliderType.Box)
|
||||
{
|
||||
BoxCollider boxCollider = bone.AddComponent<BoxCollider>();
|
||||
boxCollider.center = collider.colliderCentre;
|
||||
boxCollider.size = collider.boxDimensions;
|
||||
boxCollider.isTrigger = false; //Set initially to false;
|
||||
_BoxColliders.Add(boxCollider);
|
||||
}
|
||||
else if (collider.colliderType == ColliderDefinition.ColliderType.Sphere)
|
||||
{
|
||||
SphereCollider sphereCollider = bone.AddComponent<SphereCollider>();
|
||||
sphereCollider.center = collider.colliderCentre;
|
||||
sphereCollider.radius = collider.sphereRadius;
|
||||
sphereCollider.isTrigger = false; //Set initially to false;
|
||||
|
||||
_SphereColliders.Add(new ClothSphereColliderPair(sphereCollider));
|
||||
}
|
||||
else if (collider.colliderType == ColliderDefinition.ColliderType.Capsule)
|
||||
{
|
||||
CapsuleCollider capsuleCollider = bone.AddComponent<CapsuleCollider>();
|
||||
capsuleCollider.center = collider.colliderCentre;
|
||||
capsuleCollider.radius = collider.capsuleRadius;
|
||||
capsuleCollider.height = collider.capsuleHeight;
|
||||
capsuleCollider.isTrigger = false; //Set initially to false;
|
||||
switch (collider.capsuleAlignment)
|
||||
{
|
||||
case(ColliderDefinition.Direction.X):
|
||||
capsuleCollider.direction = 0;
|
||||
break;
|
||||
case(ColliderDefinition.Direction.Y):
|
||||
capsuleCollider.direction = 1;
|
||||
break;
|
||||
case(ColliderDefinition.Direction.Z):
|
||||
capsuleCollider.direction = 2;
|
||||
break;
|
||||
default:
|
||||
capsuleCollider.direction = 0;
|
||||
break;
|
||||
}
|
||||
_CapsuleColliders.Add(capsuleCollider);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Second pass to make sure Rigidbodies are all created
|
||||
for (int i = 0; i < elements.Count; i++)
|
||||
{
|
||||
UMAPhysicsElement element = elements[i];
|
||||
if (element != null)
|
||||
{
|
||||
// Make Temp SoftJoint
|
||||
SoftJointLimit tempLimit = new SoftJointLimit ();
|
||||
|
||||
GameObject bone = _umaData.GetBoneGameObject (element.boneName);
|
||||
|
||||
if (bone == null)
|
||||
{
|
||||
continue; //if we don't find the bone then go to the next iteration
|
||||
}
|
||||
|
||||
// Add Character Joint
|
||||
if (!element.isRoot) {
|
||||
CharacterJoint joint = bone.AddComponent<CharacterJoint> ();
|
||||
_rootBone = bone;
|
||||
joint.connectedBody = _umaData.GetBoneGameObject(element.parentBone).GetComponent<Rigidbody> (); // possible error if parent not yet created.
|
||||
joint.axis = element.axis;
|
||||
joint.swingAxis = element.swingAxis;
|
||||
tempLimit.limit = element.lowTwistLimit;
|
||||
joint.lowTwistLimit = tempLimit;
|
||||
tempLimit.limit = element.highTwistLimit;
|
||||
joint.highTwistLimit = tempLimit;
|
||||
tempLimit.limit = element.swing1Limit;
|
||||
joint.swing1Limit = tempLimit;
|
||||
tempLimit.limit = element.swing2Limit;
|
||||
joint.swing2Limit = tempLimit;
|
||||
joint.enablePreprocessing = element.enablePreprocessing;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UpdateClothColliders ();
|
||||
SetRagdolled (_ragdolled);
|
||||
}
|
||||
|
||||
//Update all cloth components
|
||||
public void UpdateClothColliders()
|
||||
{
|
||||
if (_umaData)
|
||||
{
|
||||
SkinnedMeshRenderer[] array = _umaData.GetRenderers();
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
Renderer renderer = array[i];
|
||||
Cloth cloth = renderer.GetComponent<Cloth> ();
|
||||
if (cloth)
|
||||
{
|
||||
cloth.sphereColliders = SphereColliders.ToArray();
|
||||
cloth.capsuleColliders = CapsuleColliders.ToArray();
|
||||
if ((cloth.capsuleColliders.Length + cloth.sphereColliders.Length) > 10)
|
||||
{
|
||||
if (Debug.isDebugBuild)
|
||||
{
|
||||
Debug.LogWarning("Cloth Collider count is high. You might experience strange behavior with the cloth simulation.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetRagdolled(bool ragdollState)
|
||||
{
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
_ragdolled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
//Player Collider stuff
|
||||
//Call Player Collider enable/disable event here
|
||||
if (ragdollState)
|
||||
{
|
||||
if (onRagdollStarted != null )
|
||||
{
|
||||
onRagdollStarted.Invoke ();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( onRagdollEnded != null )
|
||||
{
|
||||
onRagdollEnded.Invoke ();
|
||||
}
|
||||
}
|
||||
|
||||
if (simplePlayerCollider)
|
||||
{
|
||||
if( _playerRigidbody )
|
||||
{
|
||||
_playerRigidbody.isKinematic = ragdollState;
|
||||
}
|
||||
|
||||
if ( _playerCollider )
|
||||
{
|
||||
_playerCollider.enabled = !ragdollState;
|
||||
}
|
||||
}
|
||||
|
||||
// iterate through all rigidbodies and switch kinematic mode on/off
|
||||
//Set all rigidbodies.isKinematic to opposite of ragdolled state
|
||||
SetAllKinematic( !ragdollState );
|
||||
|
||||
if( enableColliderTriggers ) //Change the trigger state on collider if we enable this flag.
|
||||
{
|
||||
SetBodyColliders( !ragdollState );
|
||||
}
|
||||
|
||||
// switch animator on/off
|
||||
Animator animator = GetComponent<Animator>();
|
||||
if( animator != null )
|
||||
{
|
||||
animator.enabled = !ragdollState;
|
||||
}
|
||||
// switch expression player (locks head if left on)
|
||||
ExpressionPlayer expressionPlayer = GetComponent<ExpressionPlayer>();
|
||||
if( expressionPlayer != null )
|
||||
{
|
||||
expressionPlayer.enabled = !ragdollState;
|
||||
}
|
||||
|
||||
// Prevent Mismatched Culling
|
||||
// Skinned mesh renderers cull based on their origonal position before ragdolling.
|
||||
// We use this property to prevent ragdolled meshes from popping in and out unexpectedly.
|
||||
SetUpdateWhenOffscreen( ragdollState );
|
||||
|
||||
if (_ragdolled && !ragdollState)
|
||||
{
|
||||
//We were ragdolled and now we're not
|
||||
if (UpdateTransformAfterRagdoll)
|
||||
{
|
||||
gameObject.transform.position = _rootBone.transform.position;
|
||||
}
|
||||
}
|
||||
|
||||
_ragdolled = ragdollState;
|
||||
}
|
||||
|
||||
private void SetAllKinematic(bool flag)
|
||||
{
|
||||
for (int i = 0; i < _rigidbodies.Count; i++)
|
||||
{
|
||||
Rigidbody rigidbody = _rigidbodies[i];
|
||||
if (rigidbody != null)
|
||||
{
|
||||
rigidbody.isKinematic = flag;
|
||||
}
|
||||
//rigidbody.detectCollisions = !flag;
|
||||
}
|
||||
}
|
||||
|
||||
private void SetBodyColliders(bool flag)
|
||||
{
|
||||
for (int i = 0; i < _BoxColliders.Count; i++)
|
||||
{
|
||||
BoxCollider collider = _BoxColliders[i];
|
||||
collider.isTrigger = flag;
|
||||
//collider.enabled = flag;
|
||||
}
|
||||
|
||||
for (int i = 0; i < _SphereColliders.Count; i++)
|
||||
{
|
||||
ClothSphereColliderPair collider = _SphereColliders[i];
|
||||
collider.first.isTrigger = flag;
|
||||
//collider.second.isTrigger = flag;
|
||||
//collider.first.enabled = flag;
|
||||
//collider.second.enabled = flag;
|
||||
}
|
||||
|
||||
for (int i = 0; i < _CapsuleColliders.Count; i++)
|
||||
{
|
||||
CapsuleCollider collider = _CapsuleColliders[i];
|
||||
collider.isTrigger = flag;
|
||||
//collider.enabled = flag;
|
||||
}
|
||||
}
|
||||
|
||||
private void SetRendereroffscreenStates()
|
||||
{
|
||||
if (_umaData != null)
|
||||
{
|
||||
SkinnedMeshRenderer[] renderers = _umaData.GetRenderers();
|
||||
if (renderers != null)
|
||||
{
|
||||
if (SaveRagdollStates.Length != renderers.Length)
|
||||
{
|
||||
SaveRagdollStates = new bool[renderers.Length];
|
||||
}
|
||||
|
||||
for(int i = 0; i < renderers.Length; i++)
|
||||
{
|
||||
SkinnedMeshRenderer smr = renderers[i];
|
||||
SaveRagdollStates[i] = smr.updateWhenOffscreen;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetUpdateWhenOffscreen(bool flag)
|
||||
{
|
||||
if (_umaData != null)
|
||||
{
|
||||
SkinnedMeshRenderer[] renderers = _umaData.GetRenderers ();
|
||||
if (renderers != null)
|
||||
{
|
||||
// if we've saved the states, we can't just turn it off. might be on by default.
|
||||
if (SaveRagdollStates.Length == renderers.Length && !flag)
|
||||
{
|
||||
for (int i = 0; i < renderers.Length; i++)
|
||||
{
|
||||
SkinnedMeshRenderer smr = renderers[i];
|
||||
smr.updateWhenOffscreen = SaveRagdollStates[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < renderers.Length; i++)
|
||||
{
|
||||
SkinnedMeshRenderer renderer = renderers[i];
|
||||
renderer.updateWhenOffscreen = flag;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f8a093c691abd240af4df2e78d67f0e
|
||||
timeCreated: 1489775641
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/Extensions/UMAPhysics/UMAPhysicsAvatar.cs
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,37 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace UMA.Dynamics
|
||||
{
|
||||
[System.Serializable]
|
||||
public class UMAPhysicsElement : ScriptableObject
|
||||
{
|
||||
[Tooltip("Set to true for root hip definition only")]
|
||||
public bool isRoot = false;
|
||||
[Tooltip("Name of the bone to add physics")]
|
||||
public string boneName;
|
||||
[Tooltip("The mass of the bone in kilograms")]
|
||||
public float mass;
|
||||
|
||||
[Header("Collider Settings")]
|
||||
public ColliderDefinition[] colliders;
|
||||
|
||||
//Joint Definition
|
||||
[Header("Joint Settings")]
|
||||
public string parentBone;
|
||||
public Vector3 axis;
|
||||
public Vector3 swingAxis;
|
||||
public float lowTwistLimit;
|
||||
public float highTwistLimit;
|
||||
public float swing1Limit;
|
||||
public float swing2Limit;
|
||||
public bool enablePreprocessing;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[UnityEditor.MenuItem("Assets/Create/UMA/Misc/Physics Element")]
|
||||
public static void CreatePhysicsElementAsset()
|
||||
{
|
||||
UMA.CustomAssetUtility.CreateAsset<UMAPhysicsElement>();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d7148fed8e84254e8597f83852f2e34
|
||||
timeCreated: 1489781421
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/Extensions/UMAPhysics/UMAPhysicsElement.cs
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,42 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UMA.Dynamics;
|
||||
|
||||
namespace UMA
|
||||
{
|
||||
public class UMAPhysicsSlotDefinition : MonoBehaviour
|
||||
{
|
||||
//See UMAPhysicsSlotDefinitionEditor for how these are displayed
|
||||
[HideInInspector]
|
||||
public int ragdollLayer = 8;
|
||||
[HideInInspector]
|
||||
public int playerLayer = 9;
|
||||
|
||||
[Tooltip("Set this to true if you know the player will use a capsule collider and rigidbody")]
|
||||
public bool simplePlayerCollider = true;
|
||||
|
||||
[Tooltip("Set this to have your body collider act as triggers when not ragdolled")]
|
||||
public bool enableColliderTriggers = false;
|
||||
|
||||
[Tooltip("Set this to snap the Avatar to the position of it's hip after ragdoll is finished")]
|
||||
public bool UpdateTransformAfterRagdoll = true;
|
||||
|
||||
[Tooltip("List of Physics Elements, see UMAPhysicsElement class")]
|
||||
public List<UMAPhysicsElement> PhysicsElements;
|
||||
|
||||
public void OnSkeletonAvailable(UMAData umaData)
|
||||
{
|
||||
if (!umaData.gameObject.GetComponent<UMAPhysicsAvatar> ())
|
||||
{
|
||||
UMAPhysicsAvatar physicsAvatar = umaData.gameObject.AddComponent<UMAPhysicsAvatar>();
|
||||
physicsAvatar.simplePlayerCollider = simplePlayerCollider;
|
||||
physicsAvatar.enableColliderTriggers = enableColliderTriggers;
|
||||
physicsAvatar.UpdateTransformAfterRagdoll = UpdateTransformAfterRagdoll;
|
||||
physicsAvatar.ragdollLayer = ragdollLayer;
|
||||
physicsAvatar.playerLayer = playerLayer;
|
||||
physicsAvatar.elements = PhysicsElements;
|
||||
physicsAvatar.CreatePhysicsObjects ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b79b22c90bc7dd441899ab6522cfd2b9
|
||||
timeCreated: 1489780362
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/Extensions/UMAPhysics/UMAPhysicsSlotDefinition.cs
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d9753850ec7cb464fb57572d1fef0080
|
||||
folderAsset: yes
|
||||
timeCreated: 1425834285
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e0c0a1eb905e91d4d9d5885b9bd49c13
|
||||
folderAsset: yes
|
||||
timeCreated: 1488506368
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,57 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/AtlasCutoutShader" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
BlendOp Add, RevSub
|
||||
Blend Zero One, One One
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
sampler2D _MainTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
return half4(0, 0, 0, 1 - tex2D(_MainTex, i.uv).r);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6ec55823d603ee4478b56d3f0d7ce6bb
|
||||
timeCreated: 1467918749
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/AtlasCutoutShader.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,15 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9d798d4649ed1494e9924a7df38fea89, type: 3}
|
||||
m_Name: AtlasDetailNormalPostProcess
|
||||
m_EditorClassIdentifier:
|
||||
shader: {fileID: 4800000, guid: 1cd76f272fa3efe4a802da9a48f7688f, type: 3}
|
||||
@@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6723c87feec7dbc49914728f5b571b02
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/AtlasDetailNormalPostProcess.asset
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,60 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasDetailNormalPostShader
|
||||
// Author: Umut Ozkan
|
||||
// This works in conjunction with the AtlasDetailNormalShader.
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/AtlasDetailNormalPostShader" {
|
||||
Properties{
|
||||
_MainTex("Normalmap", 2D) = "bump" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Pass
|
||||
{
|
||||
Tags{ "LightMode" = "Vertex" }
|
||||
Fog{ Mode Off }
|
||||
Blend off
|
||||
Lighting Off
|
||||
Cull Off
|
||||
ZWrite Off
|
||||
ZTest Always
|
||||
CGPROGRAM
|
||||
#pragma vertex vert_img
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
uniform sampler2D _MainTex;
|
||||
|
||||
inline float4 PACK_INTERNAL(half3 unpacked) {
|
||||
#if defined(UNITY_NO_DXT5nm)
|
||||
half4 packednormal;
|
||||
packednormal.xyz = (unpacked.xyz + 1) / 2;
|
||||
packednormal.w = 1;
|
||||
return packednormal;
|
||||
#else
|
||||
half4 packednormal;
|
||||
packednormal.wy = (unpacked.xy + 1) / 2;
|
||||
packednormal.x = 1;
|
||||
packednormal.z = 1;
|
||||
return packednormal;
|
||||
#endif
|
||||
}
|
||||
|
||||
half4 frag(v2f_img i) : COLOR
|
||||
{
|
||||
half4 normal = tex2D(_MainTex, i.uv);
|
||||
normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy)));
|
||||
half3 normalized = normalize(normal.xyz);
|
||||
return PACK_INTERNAL(normalized);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1cd76f272fa3efe4a802da9a48f7688f
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/AtlasDetailNormalPostShader.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,81 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Umut Ozkan
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/AtlasDetailShaderNormal" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Normalmap", 2D) = "bump" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags{ "LightMode" = "Vertex" }
|
||||
Fog{ Mode Off }
|
||||
Blend One One
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "UnityStandardUtils.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert(appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos(v.vertex);
|
||||
o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half2 UNPACK_WITH_WEIGHT_INTERNAL(half4 packednormal, half bumpScale)
|
||||
{
|
||||
#if defined(UNITY_NO_DXT5nm)
|
||||
half2 normal = half2(packednormal.xy * 2 - 1);
|
||||
normal.xy *= bumpScale;
|
||||
return normal;
|
||||
#else
|
||||
half2 result = half2(packednormal.wy * 2 - 1);
|
||||
result.xy *= bumpScale;
|
||||
return result;
|
||||
#endif
|
||||
}
|
||||
|
||||
// This atlas shader has Blend mode add
|
||||
// It adds adds unpacked values of normal textures. The post process normalize and packs them
|
||||
half4 frag(v2f i) : COLOR
|
||||
{
|
||||
half4 current = tex2D(_MainTex, i.uv);
|
||||
half4 extra = tex2D(_ExtraTex, i.uv);
|
||||
half2 n = UNPACK_WITH_WEIGHT_INTERNAL(current, min(extra.a, _Color.a));
|
||||
// We only need 2 values to calculate normal. Post process will calculate the 3rd vector component
|
||||
return half4(n.x, n.y, 0, 0);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e5ba71eed666aef459dbb1dce2bc3d2f
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/AtlasDetailNormalShader.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,55 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 3
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_Name: AtlasModule
|
||||
m_Shader: {fileID: 4800000, guid: 8179a5383e28f6840a80314368b93979, type: 3}
|
||||
m_ShaderKeywords: []
|
||||
m_CustomRenderQueue: -1
|
||||
m_SavedProperties:
|
||||
serializedVersion: 2
|
||||
m_TexEnvs:
|
||||
data:
|
||||
first:
|
||||
name: _MainTex
|
||||
second:
|
||||
m_Texture: {fileID: 2800000, guid: 7dd3e7d857ad36e478b8352c6c54d739, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
data:
|
||||
first:
|
||||
name: _ExtraTex
|
||||
second:
|
||||
m_Texture: {fileID: 2800000, guid: 7dd3e7d857ad36e478b8352c6c54d739, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
data:
|
||||
first:
|
||||
name: _ScrollX
|
||||
second: 1
|
||||
data:
|
||||
first:
|
||||
name: _ScrollY
|
||||
second: 0
|
||||
m_Colors:
|
||||
data:
|
||||
first:
|
||||
name: _Color
|
||||
second: {r: 1, g: 1, b: 1, a: 1}
|
||||
data:
|
||||
first:
|
||||
name: _AdditiveColor
|
||||
second: {r: 0, g: 0, b: 0, a: 0}
|
||||
data:
|
||||
first:
|
||||
name: _Clip
|
||||
second: {r: 0, g: 0, b: 1, a: 1}
|
||||
data:
|
||||
first:
|
||||
name: _UVAdjust
|
||||
second: {r: 0, g: 0, b: 1, a: 1}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9dcf0ea2079905b4eabed17a904b047c
|
||||
NativeFormatImporter:
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/AtlasModule.mat
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5b4c325b50714134596b72ab388f5b10
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,102 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasShaderNew" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend Zero SrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
float value = 1 - maskcol.a;
|
||||
return half4(value, value, value, value);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend One One
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 texcol = tex2D (_MainTex, i.uv) * _Color + _AdditiveColor;
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
return texcol * maskcol.a;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8179a5383e28f6840a80314368b93979
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Data/AtlasShader.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,126 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasShaderNew_ColorBurn" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Base Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend Zero SrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
float value = 1 - maskcol.a;
|
||||
return half4(value, value, value, value);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend One One
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float BlendMode_ColorBurn(float base, float blend)
|
||||
{
|
||||
if (base >= 1.0)
|
||||
return 1.0;
|
||||
else if (blend <= 0.0)
|
||||
return 0.0;
|
||||
else
|
||||
return 1.0 - min(1.0, (1.0-base) / blend);
|
||||
}
|
||||
|
||||
float3 BlendMode_ColorBurn(float3 base, float3 blend)
|
||||
{
|
||||
return float3( BlendMode_ColorBurn(base.r, blend.r),
|
||||
BlendMode_ColorBurn(base.g, blend.g),
|
||||
BlendMode_ColorBurn(base.b, blend.b) );
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 texcol = tex2D(_MainTex, i.uv);
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
half4 basecol = tex2D(_BaseTex, i.uv);
|
||||
|
||||
texcol.rgb = BlendMode_ColorBurn(basecol.rgb, texcol.rgb);
|
||||
return (texcol * _Color + _AdditiveColor) * maskcol.a;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 59c382ffc8bc32f4d92e53948d3431e0
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Data/AtlasShader_ColorBurn.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,121 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasShaderNew_ColorDodge" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Base Texture", 2D) = "white" {}
|
||||
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend Zero SrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
float value = 1 - maskcol.a;
|
||||
return half4(value, value, value, value);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend One One
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float BlendMode_ColorDodge(float base, float blend)
|
||||
{
|
||||
if (base <= 0.0)
|
||||
return 0.0;
|
||||
if (blend >= 1.0)
|
||||
return 1.0;
|
||||
else
|
||||
return min(1.0, base / (1.0-blend));
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 texcol = tex2D(_MainTex, i.uv);
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
half4 basecol = tex2D(_BaseTex, i.uv);
|
||||
|
||||
texcol.rgb = BlendMode_ColorDodge(basecol.rgb, texcol.rgb);
|
||||
return (texcol * _Color + _AdditiveColor) * maskcol.a;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 353bcb59bc293294399a855b2881b1f7
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Data/AtlasShader_ColorDodge.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,116 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasShaderNew_Darken" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Base Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend Zero SrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
float value = 1 - maskcol.a;
|
||||
return half4(value, value, value, value);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend One One
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float3 BlendMode_Darken(float3 base, float3 blend)
|
||||
{
|
||||
return min(base, blend);
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 texcol = tex2D(_MainTex, i.uv);
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
half4 basecol = tex2D(_BaseTex, i.uv);
|
||||
|
||||
texcol.rgb = BlendMode_Darken(basecol.rgb, texcol.rgb);
|
||||
return (texcol * _Color + _AdditiveColor) * maskcol.a;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e5c5b4cf426f2ea48a7cce0214a0bdb4
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Data/AtlasShader_Darken.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,117 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasShaderNew_HardLight" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Base Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend Zero SrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
float value = 1 - maskcol.a;
|
||||
return half4(value, value, value, value);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend One One
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float BlendMode_HardLight(float base, float blend)
|
||||
{
|
||||
return (blend <= 0.5) ? 2*base*blend : 1 - 2*(1-base)*(1-blend);
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 texcol = tex2D(_MainTex, i.uv);
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
half4 basecol = tex2D(_BaseTex, i.uv);
|
||||
|
||||
texcol.rgb = BlendMode_HardLight(basecol.rgb, texcol.rgb);
|
||||
return (texcol * _Color + _AdditiveColor) * maskcol.a;
|
||||
}
|
||||
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: da31722262eeee64f936b9ee3e310d37
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Data/AtlasShader_HardLight.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,114 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasShaderNew_Lighten" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Blendbase Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend Zero SrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
float value = 1 - maskcol.a;
|
||||
return half4(value, value, value, value);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend One One
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float3 BlendMode_Lighten(float3 base, float3 blend)
|
||||
{
|
||||
return max(base, blend);
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 texcol = tex2D(_MainTex, i.uv);
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
half4 basecol = tex2D(_BaseTex, i.uv);
|
||||
|
||||
texcol.rgb = BlendMode_Lighten(basecol.rgb, texcol.rgb);
|
||||
return (texcol * _Color + _AdditiveColor) * maskcol.a;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 45f4712c260a06e4f9d269efa51b5ce8
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Data/AtlasShader_Lighten.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,112 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasShaderNew_Multiply" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Base Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend Zero SrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
float value = 1 - maskcol.a;
|
||||
return half4(value, value, value, value);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend One One
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float3 BlendMode_Multiply(float3 base, float3 blend)
|
||||
{
|
||||
return base*blend;
|
||||
}
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 texcol = tex2D(_MainTex, i.uv);
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
half4 basecol = tex2D(_BaseTex, i.uv);
|
||||
|
||||
texcol.rgb = BlendMode_Multiply(basecol.rgb, texcol.rgb);
|
||||
return (texcol * _Color + _AdditiveColor) * maskcol.a;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9ffddd6feae61314c847684c042c3125
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Data/AtlasShader_Multiply.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,114 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasShaderNew_Overlay" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Base Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend Zero SrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
float value = 1 - maskcol.a;
|
||||
return half4(value, value, value, value);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend One One
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float BlendMode_Overlay(float base, float blend)
|
||||
{
|
||||
return (base <= 0.5) ? 2*base*blend : 1 - 2*(1-base)*(1-blend);
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 texcol = tex2D(_MainTex, i.uv);
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
half4 basecol = tex2D(_BaseTex, i.uv);
|
||||
|
||||
texcol.rgb = BlendMode_Overlay(basecol.rgb, texcol.rgb);
|
||||
return (texcol * _Color + _AdditiveColor) * maskcol.a;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9931f25706937944ca44b618185a03f0
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Data/AtlasShader_Overlay.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,113 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasShaderNew_Screen" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Blendbase Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend Zero SrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
float value = 1 - maskcol.a;
|
||||
return half4(value, value, value, value);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend One One
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float3 BlendMode_Screen(float3 base, float3 blend)
|
||||
{
|
||||
return base + blend - base*blend;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 texcol = tex2D(_MainTex, i.uv);
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
half4 basecol = tex2D(_BaseTex, i.uv);
|
||||
|
||||
texcol.rgb = BlendMode_Screen(basecol.rgb, texcol.rgb);
|
||||
return (texcol * _Color + _AdditiveColor) * maskcol.a;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eff2e81e510ad8348b120d56d22fddf3
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Data/AtlasShader_Screen.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,128 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasShaderNew_SoftLight" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Base Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend Zero SrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
float value = 1 - maskcol.a;
|
||||
return half4(value, value, value, value);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend One One
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float BlendMode_SoftLight(float base, float blend)
|
||||
{
|
||||
if (blend <= 0.5)
|
||||
{
|
||||
return base - (1-2*blend)*base*(1-base);
|
||||
}
|
||||
else
|
||||
{
|
||||
float d = (base <= 0.25) ? ((16*base-12)*base+4)*base : sqrt(base);
|
||||
return base + (2*blend-1)*(d-base);
|
||||
}
|
||||
}
|
||||
|
||||
float3 BlendMode_SoftLight(float3 base, float3 blend)
|
||||
{
|
||||
return float3( BlendMode_SoftLight(base.r, blend.r),
|
||||
BlendMode_SoftLight(base.g, blend.g),
|
||||
BlendMode_SoftLight(base.b, blend.b) );
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 texcol = tex2D(_MainTex, i.uv);
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
half4 basecol = tex2D(_BaseTex, i.uv);
|
||||
|
||||
texcol.rgb = BlendMode_SoftLight(basecol.rgb, texcol.rgb);
|
||||
return (texcol * _Color + _AdditiveColor) * maskcol.a;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c21f293c9e1e3a6408c5f2f8feceaa00
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Data/AtlasShader_SoftLight.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,121 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasShaderNew_Subtract" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Blendbase Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend Zero SrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float3 BlendMode_Subtract(float3 base, float3 blend)
|
||||
{
|
||||
return max(0, base - blend);
|
||||
}
|
||||
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
float value = 1 - maskcol.a;
|
||||
return half4(value, value, value, value);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend One One
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float3 BlendMode_Subtract(float3 base, float3 blend)
|
||||
{
|
||||
return max(0, base - blend);
|
||||
}
|
||||
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 texcol = tex2D(_MainTex, i.uv);
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
half4 basecol = tex2D(_BaseTex, i.uv);
|
||||
|
||||
texcol.rgb = BlendMode_Subtract(basecol.rgb, texcol.rgb);
|
||||
return (texcol * _Color + _AdditiveColor) * maskcol.a;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b5d2bd7dde5a3164282c0b655f391fbd
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Data/AtlasShader_Subtract.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c8fbaa2db3bb38641b51985da29ec9df
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,63 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasDiffuseShader" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
BlendOp Add, Add
|
||||
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 texcol = tex2D(_MainTex, i.uv);
|
||||
half4 mask = tex2D(_ExtraTex, i.uv);
|
||||
return half4(texcol.xyz, mask.w)*_Color+_AdditiveColor;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ae83be5246f311646b3043ed012d9d64
|
||||
timeCreated: 1467924405
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Diffuse/AtlasDiffuseShader.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,84 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasDiffuseShader_ColorBurn" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Base Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
BlendOp Add, Add
|
||||
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float BlendMode_ColorBurn(float base, float blend)
|
||||
{
|
||||
if (base >= 1.0)
|
||||
return 1.0;
|
||||
else if (blend <= 0.0)
|
||||
return 0.0;
|
||||
else
|
||||
return 1.0 - min(1.0, (1.0-base) / blend);
|
||||
}
|
||||
|
||||
float3 BlendMode_ColorBurn(float3 base, float3 blend)
|
||||
{
|
||||
return float3( BlendMode_ColorBurn(base.r, blend.r),
|
||||
BlendMode_ColorBurn(base.g, blend.g),
|
||||
BlendMode_ColorBurn(base.b, blend.b) );
|
||||
}
|
||||
|
||||
float4 frag (v2f i) : COLOR
|
||||
{
|
||||
float4 texcol = tex2D(_MainTex, i.uv); // get the color from the overlay
|
||||
float4 basecol = tex2D(_BaseTex, i.uv); // get the color from the previous pass
|
||||
texcol.rgb = BlendMode_ColorBurn(basecol.rgb, texcol.rgb); // subtract the overlay from the previous pass
|
||||
half4 mask = tex2D(_ExtraTex, i.uv);
|
||||
return float4(texcol.rgb, mask.a)*_Color+_AdditiveColor;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f9f9211b52af6604885380483f5968fd
|
||||
timeCreated: 1467924405
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Diffuse/AtlasDiffuseShader_ColorBurn.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,84 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasDiffuseShader_ColorDodge" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Base Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
BlendOp Add, Add
|
||||
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float BlendMode_ColorDodge(float base, float blend)
|
||||
{
|
||||
if (base <= 0.0)
|
||||
return 0.0;
|
||||
if (blend >= 1.0)
|
||||
return 1.0;
|
||||
else
|
||||
return min(1.0, base / (1.0-blend));
|
||||
}
|
||||
|
||||
float3 BlendMode_ColorDodge(float3 base, float3 blend)
|
||||
{
|
||||
return float3( BlendMode_ColorDodge(base.r, blend.r),
|
||||
BlendMode_ColorDodge(base.g, blend.g),
|
||||
BlendMode_ColorDodge(base.b, blend.b) );
|
||||
}
|
||||
|
||||
float4 frag (v2f i) : COLOR
|
||||
{
|
||||
float4 texcol = tex2D(_MainTex, i.uv); // get the color from the overlay
|
||||
float4 basecol = tex2D(_BaseTex, i.uv); // get the color from the previous pass
|
||||
texcol.rgb = BlendMode_ColorDodge(basecol.rgb, texcol.rgb); // subtract the overlay from the previous pass
|
||||
half4 mask = tex2D(_ExtraTex, i.uv);
|
||||
return float4(texcol.rgb, mask.a)*_Color+_AdditiveColor;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7b90e2d2fd21de84ea1e1895046ac3e7
|
||||
timeCreated: 1467924405
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Diffuse/AtlasDiffuseShader_ColorDodge.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,72 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasDiffuseShader_Darken" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Base Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
BlendOp Add, Add
|
||||
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float3 BlendMode_Darken(float3 base, float3 blend)
|
||||
{
|
||||
return min(base, blend);
|
||||
}
|
||||
|
||||
float4 frag (v2f i) : COLOR
|
||||
{
|
||||
float4 texcol = tex2D(_MainTex, i.uv); // get the color from the overlay
|
||||
float4 basecol = tex2D(_BaseTex, i.uv); // get the color from the previous pass
|
||||
texcol.rgb = BlendMode_Darken(basecol.rgb, texcol.rgb); // subtract the overlay from the previous pass
|
||||
half4 mask = tex2D(_ExtraTex, i.uv);
|
||||
return float4(texcol.rgb, mask.a)*_Color+_AdditiveColor;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 744ac0ef59fda2f4db65e637e41f65f8
|
||||
timeCreated: 1467924405
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Diffuse/AtlasDiffuseShader_Darken.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,80 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasDiffuseShader_HardLight" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Base Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
BlendOp Add, Add
|
||||
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float BlendMode_HardLight(float base, float blend)
|
||||
{
|
||||
return (blend <= 0.5) ? 2*base*blend : 1 - 2*(1-base)*(1-blend);
|
||||
}
|
||||
|
||||
float3 BlendMode_HardLight(float3 base, float3 blend)
|
||||
{
|
||||
return float3( BlendMode_HardLight(base.r, blend.r),
|
||||
BlendMode_HardLight(base.g, blend.g),
|
||||
BlendMode_HardLight(base.b, blend.b) );
|
||||
}
|
||||
|
||||
float4 frag (v2f i) : COLOR
|
||||
{
|
||||
float4 texcol = tex2D(_MainTex, i.uv); // get the color from the overlay
|
||||
float4 basecol = tex2D(_BaseTex, i.uv); // get the color from the previous pass
|
||||
texcol.rgb = BlendMode_HardLight(basecol.rgb, texcol.rgb); // subtract the overlay from the previous pass
|
||||
half4 mask = tex2D(_ExtraTex, i.uv);
|
||||
return float4(texcol.rgb, mask.a)*_Color+_AdditiveColor;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b2a1284fa6f898e4898d45fefe12fee1
|
||||
timeCreated: 1467924405
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Diffuse/AtlasDiffuseShader_HardLight.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,72 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasDiffuseShader_Lighten" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Base Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
BlendOp Add, Add
|
||||
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float3 BlendMode_Lighten(float3 base, float3 blend)
|
||||
{
|
||||
return max(base, blend);
|
||||
}
|
||||
|
||||
float4 frag (v2f i) : COLOR
|
||||
{
|
||||
float4 texcol = tex2D(_MainTex, i.uv); // get the color from the overlay
|
||||
float4 basecol = tex2D(_BaseTex, i.uv); // get the color from the previous pass
|
||||
texcol.rgb = BlendMode_Lighten(basecol.rgb, texcol.rgb); // subtract the overlay from the previous pass
|
||||
half4 mask = tex2D(_ExtraTex, i.uv);
|
||||
return float4(texcol.rgb, mask.a)*_Color+_AdditiveColor;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3254ca564125ccd448b4533e4dc6a54a
|
||||
timeCreated: 1467924405
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Diffuse/AtlasDiffuseShader_Lighten.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,72 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasDiffuseShader_Multiply" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Base Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
BlendOp Add, Add
|
||||
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float3 BlendMode_Multiply(float3 base, float3 blend)
|
||||
{
|
||||
return base*blend;
|
||||
}
|
||||
|
||||
float4 frag (v2f i) : COLOR
|
||||
{
|
||||
float4 texcol = tex2D(_MainTex, i.uv); // get the color from the overlay
|
||||
float4 basecol = tex2D(_BaseTex, i.uv); // get the color from the previous pass
|
||||
texcol.rgb = BlendMode_Multiply(basecol.rgb, texcol.rgb); // subtract the overlay from the previous pass
|
||||
half4 mask = tex2D(_ExtraTex, i.uv);
|
||||
return float4(texcol.rgb, mask.a)*_Color+_AdditiveColor;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b2242db2c314abc49b2ff484123ea161
|
||||
timeCreated: 1467924405
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Diffuse/AtlasDiffuseShader_Multiply.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,71 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasDiffuseShader_Overlay" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Base Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
BlendOp Add, Add
|
||||
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
float BlendMode_Overlay(float base, float blend)
|
||||
{
|
||||
return (base <= 0.5) ? 2*base*blend : 1 - 2*(1-base)*(1-blend);
|
||||
}
|
||||
|
||||
float4 frag (v2f i) : COLOR
|
||||
{
|
||||
float4 texcol = tex2D(_MainTex, i.uv); // get the color from the overlay
|
||||
float4 basecol = tex2D(_BaseTex, i.uv); // get the color from the previous pass
|
||||
texcol.rgb = BlendMode_Overlay(basecol.rgb, texcol.rgb); // subtract the overlay from the previous pass
|
||||
half4 mask = tex2D(_ExtraTex, i.uv);
|
||||
return float4(texcol.rgb, mask.a)*_Color+_AdditiveColor;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ebfa7a5903b17e34494d3c74eb7fc305
|
||||
timeCreated: 1467924405
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Diffuse/AtlasDiffuseShader_Overlay.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,72 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasDiffuseShader_Screen" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Base Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
BlendOp Add, Add
|
||||
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float3 BlendMode_Screen(float3 base, float3 blend)
|
||||
{
|
||||
return base + blend - base*blend;
|
||||
}
|
||||
|
||||
float4 frag (v2f i) : COLOR
|
||||
{
|
||||
float4 texcol = tex2D(_MainTex, i.uv); // get the color from the overlay
|
||||
float4 basecol = tex2D(_BaseTex, i.uv); // get the color from the previous pass
|
||||
texcol.rgb = BlendMode_Screen(basecol.rgb, texcol.rgb); // subtract the overlay from the previous pass
|
||||
half4 mask = tex2D(_ExtraTex, i.uv);
|
||||
return float4(texcol.rgb, mask.a)*_Color+_AdditiveColor;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6059699f235f2824296f29d2abe77d5a
|
||||
timeCreated: 1467924405
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Diffuse/AtlasDiffuseShader_Screen.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,88 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasDiffuseShader_SoftLight" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Base Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
BlendOp Add, Add
|
||||
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float BlendMode_SoftLight(float base, float blend)
|
||||
{
|
||||
if (blend <= 0.5)
|
||||
{
|
||||
return base - (1-2*blend)*base*(1-base);
|
||||
}
|
||||
else
|
||||
{
|
||||
float d = (base <= 0.25) ? ((16*base-12)*base+4)*base : sqrt(base);
|
||||
return base + (2*blend-1)*(d-base);
|
||||
}
|
||||
}
|
||||
|
||||
float3 BlendMode_SoftLight(float3 base, float3 blend)
|
||||
{
|
||||
return float3( BlendMode_SoftLight(base.r, blend.r),
|
||||
BlendMode_SoftLight(base.g, blend.g),
|
||||
BlendMode_SoftLight(base.b, blend.b) );
|
||||
}
|
||||
|
||||
float4 frag (v2f i) : COLOR
|
||||
{
|
||||
float4 texcol = tex2D(_MainTex, i.uv); // get the color from the overlay
|
||||
float4 basecol = tex2D(_BaseTex, i.uv); // get the color from the previous pass
|
||||
texcol.rgb = BlendMode_SoftLight(basecol.rgb, texcol.rgb); // subtract the overlay from the previous pass
|
||||
half4 mask = tex2D(_ExtraTex, i.uv);
|
||||
return float4(texcol.rgb, mask.a)*_Color+_AdditiveColor;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e929ee9992023f74c9c670807abae009
|
||||
timeCreated: 1467924405
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Diffuse/AtlasDiffuseShader_SoftLight.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,76 @@
|
||||
Shader "UMA/Atlas/AtlasDiffuseShader_Subtract" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
// _MainTex contains the texture from the overlay
|
||||
_MainTex ("Base Texture", 2D) = "white" {}
|
||||
// _ExtraTex is the alpha mask from the overlay.
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
// _BaseTex is the image from the previous layer. We use Graphics.Blit
|
||||
// to copy the result of the previous layer into this texture.
|
||||
_BaseTex ("Blendbase Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
BlendOp Add, Add
|
||||
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
|
||||
Lighting Off
|
||||
Cull Off
|
||||
ZWrite Off
|
||||
ZTest Always
|
||||
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float3 BlendMode_Subtract(float3 base, float3 blend)
|
||||
{
|
||||
return max(0, base - blend);
|
||||
}
|
||||
|
||||
float4 frag (v2f i) : COLOR
|
||||
{
|
||||
float4 texcol = tex2D(_MainTex, i.uv); // get the color from the overlay
|
||||
float4 basecol = tex2D(_BaseTex, i.uv); // get the color from the previous pass
|
||||
texcol.rgb = BlendMode_Subtract(basecol.rgb, texcol.rgb); // subtract the overlay from the previous pass
|
||||
half4 mask = tex2D(_ExtraTex, i.uv);
|
||||
return float4(texcol.rgb, mask.a)*_Color+_AdditiveColor;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
//Fallback "Transparent/VertexLit"
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5319104211becc640a93c5310f80c8e3
|
||||
timeCreated: 1467924405
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Diffuse/AtlasDiffuseShader_Subtract.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce7c89a6011421648a75238af443e2ea
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,71 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasShaderNormal" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Normalmap", 2D) = "bump" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags{ "LightMode" = "Vertex" }
|
||||
Fog{ Mode Off }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "UnityStandardUtils.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert(appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos(v.vertex);
|
||||
o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag(v2f i) : COLOR
|
||||
{
|
||||
half4 n = tex2D(_MainTex, i.uv);
|
||||
half4 extra = tex2D(_ExtraTex, i.uv);
|
||||
|
||||
#if !defined(UNITY_NO_DXT5nm)
|
||||
//swizzle the alpha and red channel, we will swizzle back in the post process SwizzleShader
|
||||
n.r = n.a;
|
||||
#endif
|
||||
n.a = min(extra.a, _Color.a);
|
||||
return n;
|
||||
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0c7937a991ef0764fb16577ebf24911e
|
||||
timeCreated: 1426630728
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Normal/AtlasNormalShader.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,102 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasShaderNormal32" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Normalmap", 2D) = "bump" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend Zero SrcAlpha
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
float value = 1 - maskcol.a;
|
||||
return half4(value, value, value, value);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
Pass
|
||||
{
|
||||
Tags { "LightMode" = "Vertex" }
|
||||
Fog { Mode Off }
|
||||
Blend One One
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
half4 texcol = tex2D (_MainTex, i.uv) * _Color + _AdditiveColor;
|
||||
half4 maskcol = tex2D (_ExtraTex, i.uv);
|
||||
return texcol * maskcol.a;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f001376c60e187e48ba6139415f60d3a
|
||||
timeCreated: 1536937299
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Normal/AtlasNormalShader32.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,92 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasShaderNormal_ColorBurn" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Normalmap", 2D) = "bump" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Blendbase Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags{ "LightMode" = "Vertex" }
|
||||
Fog{ Mode Off }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "UnityStandardUtils.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert(appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos(v.vertex);
|
||||
o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float BlendMode_ColorBurn(float base, float blend)
|
||||
{
|
||||
if (base >= 1.0)
|
||||
return 1.0;
|
||||
else if (blend <= 0.0)
|
||||
return 0.0;
|
||||
else
|
||||
return 1.0 - min(1.0, (1.0-base) / blend);
|
||||
}
|
||||
|
||||
float3 BlendMode_ColorBurn(float3 base, float3 blend)
|
||||
{
|
||||
return float3( BlendMode_ColorBurn(base.r, blend.r),
|
||||
BlendMode_ColorBurn(base.g, blend.g),
|
||||
BlendMode_ColorBurn(base.b, blend.b) );
|
||||
}
|
||||
|
||||
half4 frag(v2f i) : COLOR
|
||||
{
|
||||
half4 n = tex2D(_MainTex, i.uv);
|
||||
half4 extra = tex2D(_ExtraTex, i.uv);
|
||||
float4 basecol = tex2D(_BaseTex, i.uv);
|
||||
|
||||
#if !defined(UNITY_NO_DXT5nm)
|
||||
//swizzle the alpha and red channel, we will swizzle back in the post process SwizzleShader
|
||||
n.r = n.a;
|
||||
#endif
|
||||
n.rgb = BlendMode_ColorBurn(basecol.rgb, n.rgb); // subtract the overlay from the previous pass
|
||||
n.a = min(extra.a, _Color.a);
|
||||
return n * _Color + _AdditiveColor;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1b36f82cfa28c484fbdf7a39407c9a5a
|
||||
timeCreated: 1426630728
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Normal/AtlasNormalShader_ColorBurn.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,85 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasShaderNormal_ColorDodge" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Normalmap", 2D) = "bump" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Blendbase Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags{ "LightMode" = "Vertex" }
|
||||
Fog{ Mode Off }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "UnityStandardUtils.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert(appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos(v.vertex);
|
||||
o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float BlendMode_ColorDodge(float base, float blend)
|
||||
{
|
||||
if (base <= 0.0)
|
||||
return 0.0;
|
||||
if (blend >= 1.0)
|
||||
return 1.0;
|
||||
else
|
||||
return min(1.0, base / (1.0-blend));
|
||||
}
|
||||
|
||||
half4 frag(v2f i) : COLOR
|
||||
{
|
||||
half4 n = tex2D(_MainTex, i.uv);
|
||||
half4 extra = tex2D(_ExtraTex, i.uv);
|
||||
float4 basecol = tex2D(_BaseTex, i.uv);
|
||||
|
||||
#if !defined(UNITY_NO_DXT5nm)
|
||||
//swizzle the alpha and red channel, we will swizzle back in the post process SwizzleShader
|
||||
n.r = n.a;
|
||||
#endif
|
||||
n.rgb = BlendMode_ColorDodge(basecol.rgb, n.rgb); // subtract the overlay from the previous pass
|
||||
n.a = min(extra.a, _Color.a);
|
||||
return n * _Color + _AdditiveColor;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: da2c212080bb6784f83c40fc31d9d095
|
||||
timeCreated: 1426630728
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Normal/AtlasNormalShader_ColorDodge.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,80 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasShaderNormal_Darken" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Normalmap", 2D) = "bump" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Blendbase Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags{ "LightMode" = "Vertex" }
|
||||
Fog{ Mode Off }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "UnityStandardUtils.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert(appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos(v.vertex);
|
||||
o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float3 BlendMode_Darken(float3 base, float3 blend)
|
||||
{
|
||||
return min(base, blend);
|
||||
}
|
||||
|
||||
half4 frag(v2f i) : COLOR
|
||||
{
|
||||
half4 n = tex2D(_MainTex, i.uv);
|
||||
half4 extra = tex2D(_ExtraTex, i.uv);
|
||||
float4 basecol = tex2D(_BaseTex, i.uv);
|
||||
|
||||
#if !defined(UNITY_NO_DXT5nm)
|
||||
//swizzle the alpha and red channel, we will swizzle back in the post process SwizzleShader
|
||||
n.r = n.a;
|
||||
#endif
|
||||
n.rgb = BlendMode_Darken(basecol.rgb, n.rgb); // subtract the overlay from the previous pass
|
||||
n.a = min(extra.a, _Color.a);
|
||||
return n * _Color + _AdditiveColor;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 40384cfbf71c88144af1caadaf9a3c9d
|
||||
timeCreated: 1426630728
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Normal/AtlasNormalShader_Darken.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,80 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasShaderNormal_HardLight" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Normalmap", 2D) = "bump" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Blendbase Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags{ "LightMode" = "Vertex" }
|
||||
Fog{ Mode Off }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "UnityStandardUtils.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert(appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos(v.vertex);
|
||||
o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float BlendMode_HardLight(float base, float blend)
|
||||
{
|
||||
return (blend <= 0.5) ? 2*base*blend : 1 - 2*(1-base)*(1-blend);
|
||||
}
|
||||
|
||||
half4 frag(v2f i) : COLOR
|
||||
{
|
||||
half4 n = tex2D(_MainTex, i.uv);
|
||||
half4 extra = tex2D(_ExtraTex, i.uv);
|
||||
float4 basecol = tex2D(_BaseTex, i.uv);
|
||||
|
||||
#if !defined(UNITY_NO_DXT5nm)
|
||||
//swizzle the alpha and red channel, we will swizzle back in the post process SwizzleShader
|
||||
n.r = n.a;
|
||||
#endif
|
||||
n.rgb = BlendMode_HardLight(basecol.rgb, n.rgb); // subtract the overlay from the previous pass
|
||||
n.a = min(extra.a, _Color.a);
|
||||
return n * _Color + _AdditiveColor;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0e9d5d4b53916164e833537fa5111f40
|
||||
timeCreated: 1426630728
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Normal/AtlasNormalShader_HardLight.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,80 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasShaderNormal_Lighten" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Normalmap", 2D) = "bump" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Blendbase Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags{ "LightMode" = "Vertex" }
|
||||
Fog{ Mode Off }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "UnityStandardUtils.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert(appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos(v.vertex);
|
||||
o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float3 BlendMode_Lighten(float3 base, float3 blend)
|
||||
{
|
||||
return max(base, blend);
|
||||
}
|
||||
|
||||
half4 frag(v2f i) : COLOR
|
||||
{
|
||||
half4 n = tex2D(_MainTex, i.uv);
|
||||
half4 extra = tex2D(_ExtraTex, i.uv);
|
||||
float4 basecol = tex2D(_BaseTex, i.uv);
|
||||
|
||||
#if !defined(UNITY_NO_DXT5nm)
|
||||
//swizzle the alpha and red channel, we will swizzle back in the post process SwizzleShader
|
||||
n.r = n.a;
|
||||
#endif
|
||||
n.rgb = BlendMode_Lighten(basecol.rgb, n.rgb); // subtract the overlay from the previous pass
|
||||
n.a = min(extra.a, _Color.a);
|
||||
return n * _Color + _AdditiveColor;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 31a8c68ab6ab7a9488173d478b6e55bc
|
||||
timeCreated: 1426630728
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 35611
|
||||
packageName: UMA 2
|
||||
packageVersion: 2.13
|
||||
assetPath: Assets/UMA/Core/StandardAssets/UMA/Atlas/Normal/AtlasNormalShader_Lighten.shader
|
||||
uploadId: 679826
|
||||
@@ -0,0 +1,80 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// ============================================================
|
||||
// Name: AtlasShader
|
||||
// Author: Joen Joensen (@UnLogick)
|
||||
// ============================================================
|
||||
|
||||
Shader "UMA/Atlas/AtlasShaderNormal_Multiply" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_AdditiveColor ("Additive Color", Color) = (0,0,0,0)
|
||||
_MainTex ("Normalmap", 2D) = "bump" {}
|
||||
_ExtraTex ("mask", 2D) = "white" {}
|
||||
_BaseTex ("Blendbase Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags{ "LightMode" = "Vertex" }
|
||||
Fog{ Mode Off }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
Lighting Off
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "UnityStandardUtils.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _AdditiveColor;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ExtraTex;
|
||||
sampler2D _BaseTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert(appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos(v.vertex);
|
||||
o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
float3 BlendMode_Multiply(float3 base, float3 blend)
|
||||
{
|
||||
return base*blend;
|
||||
}
|
||||
|
||||
half4 frag(v2f i) : COLOR
|
||||
{
|
||||
half4 n = tex2D(_MainTex, i.uv);
|
||||
half4 extra = tex2D(_ExtraTex, i.uv);
|
||||
float4 basecol = tex2D(_BaseTex, i.uv);
|
||||
|
||||
#if !defined(UNITY_NO_DXT5nm)
|
||||
//swizzle the alpha and red channel, we will swizzle back in the post process SwizzleShader
|
||||
n.r = n.a;
|
||||
#endif
|
||||
n.rgb = BlendMode_Multiply(basecol.rgb, n.rgb); // subtract the overlay from the previous pass
|
||||
n.a = min(extra.a, _Color.a);
|
||||
return n * _Color + _AdditiveColor;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Transparent/VertexLit"
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user