diff --git a/playable/Assets/Editor.meta b/playable/Assets/Editor.meta new file mode 100644 index 0000000..a8ea0fd --- /dev/null +++ b/playable/Assets/Editor.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: da3ccee8576aaae438180c440466b71b +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Editor/Water (Pro Only).meta b/playable/Assets/Editor/Water (Pro Only).meta new file mode 100644 index 0000000..cab8500 --- /dev/null +++ b/playable/Assets/Editor/Water (Pro Only).meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 91571d1d2601647498e27c944d9c6852 +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Editor/Water (Pro Only)/Water4.meta b/playable/Assets/Editor/Water (Pro Only)/Water4.meta new file mode 100644 index 0000000..1e9ce9a --- /dev/null +++ b/playable/Assets/Editor/Water (Pro Only)/Water4.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 66207ff69de6b4d73a445036c3a195f6 +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Editor/Water (Pro Only)/Water4/GerstnerDisplaceEditor.cs b/playable/Assets/Editor/Water (Pro Only)/Water4/GerstnerDisplaceEditor.cs new file mode 100644 index 0000000..7a5f89f --- /dev/null +++ b/playable/Assets/Editor/Water (Pro Only)/Water4/GerstnerDisplaceEditor.cs @@ -0,0 +1,103 @@ +using UnityEngine; +using System; +using UnityEditor; + +[CustomEditor(typeof(GerstnerDisplace))] +public class GerstnerDisplaceEditor : Editor +{ + private SerializedObject serObj; + + public void OnEnable () + { + serObj = new SerializedObject (target); + } + + public override void OnInspectorGUI () + { + serObj.Update(); + + GameObject go = ((GerstnerDisplace)serObj.targetObject).gameObject; + WaterBase wb = (WaterBase)go.GetComponent(typeof(WaterBase)); + Material sharedWaterMaterial = wb.sharedMaterial; + + GUILayout.Label ("Animates vertices using up 4 generated waves", EditorStyles.miniBoldLabel); + + if(sharedWaterMaterial) + { + Vector4 amplitude = WaterEditorUtility.GetMaterialVector("_GAmplitude", sharedWaterMaterial); + Vector4 frequency = WaterEditorUtility.GetMaterialVector("_GFrequency", sharedWaterMaterial); + Vector4 steepness = WaterEditorUtility.GetMaterialVector("_GSteepness", sharedWaterMaterial); + Vector4 speed = WaterEditorUtility.GetMaterialVector("_GSpeed", sharedWaterMaterial); + Vector4 directionAB = WaterEditorUtility.GetMaterialVector("_GDirectionAB", sharedWaterMaterial); + Vector4 directionCD = WaterEditorUtility.GetMaterialVector("_GDirectionCD", sharedWaterMaterial); + + amplitude = EditorGUILayout.Vector4Field("Amplitude (Height offset)", amplitude); + frequency = EditorGUILayout.Vector4Field("Frequency (Tiling)", frequency); + steepness = EditorGUILayout.Vector4Field("Steepness", steepness); + speed = EditorGUILayout.Vector4Field("Speed", speed); + directionAB = EditorGUILayout.Vector4Field("Direction scale (Wave 1 (X,Y) and 2 (Z,W))", directionAB); + directionCD = EditorGUILayout.Vector4Field("Direction scale (Wave 3 (X,Y) and 4 (Z,W))", directionCD); + + if (GUI.changed) { + WaterEditorUtility.SetMaterialVector("_GAmplitude", amplitude, sharedWaterMaterial); + WaterEditorUtility.SetMaterialVector("_GFrequency", frequency, sharedWaterMaterial); + WaterEditorUtility.SetMaterialVector("_GSteepness", steepness, sharedWaterMaterial); + WaterEditorUtility.SetMaterialVector("_GSpeed", speed, sharedWaterMaterial); + WaterEditorUtility.SetMaterialVector("_GDirectionAB", directionAB, sharedWaterMaterial); + WaterEditorUtility.SetMaterialVector("_GDirectionCD", directionCD, sharedWaterMaterial); + } + + /* + + Vector4 animationTiling = WaterEditorUtility.GetMaterialVector("_AnimationTiling", sharedWaterMaterial); + Vector4 animationDirection = WaterEditorUtility.GetMaterialVector("_AnimationDirection", sharedWaterMaterial); + + float firstTilingU = animationTiling.x*100.0F; + float firstTilingV = animationTiling.y*100.0F; + float firstDirectionU = animationDirection.x; + float firstDirectionV = animationDirection.y; + + float secondTilingU = animationTiling.z*100.0F; + float secondTilingV = animationTiling.w*100.0F; + float secondDirectionU = animationDirection.z; + float secondDirectionV = animationDirection.w; + + + EditorGUILayout.BeginHorizontal (); + firstTilingU = EditorGUILayout.FloatField("First Tiling U", firstTilingU); + firstTilingV = EditorGUILayout.FloatField("First Tiling V", firstTilingV); + EditorGUILayout.EndHorizontal (); + EditorGUILayout.BeginHorizontal (); + secondTilingU = EditorGUILayout.FloatField("Second Tiling U", secondTilingU); + secondTilingV = EditorGUILayout.FloatField("Second Tiling V", secondTilingV); + EditorGUILayout.EndHorizontal (); + + EditorGUILayout.BeginHorizontal (); + firstDirectionU = EditorGUILayout.FloatField("1st Animation U", firstDirectionU); + firstDirectionV = EditorGUILayout.FloatField("1st Animation V", firstDirectionV); + EditorGUILayout.EndHorizontal (); + EditorGUILayout.BeginHorizontal (); + secondDirectionU = EditorGUILayout.FloatField("2nd Animation U", secondDirectionU); + secondDirectionV = EditorGUILayout.FloatField("2nd Animation V", secondDirectionV); + EditorGUILayout.EndHorizontal (); + + animationDirection = new Vector4(firstDirectionU,firstDirectionV, secondDirectionU,secondDirectionV); + animationTiling = new Vector4(firstTilingU/100.0F,firstTilingV/100.0F, secondTilingU/100.0F,secondTilingV/100.0F); + + WaterEditorUtility.SetMaterialVector("_AnimationTiling", animationTiling, sharedWaterMaterial); + WaterEditorUtility.SetMaterialVector("_AnimationDirection", animationDirection, sharedWaterMaterial); + + EditorGUILayout.Separator (); + + GUILayout.Label ("Displacement Strength", EditorStyles.boldLabel); + + float heightDisplacement = WaterEditorUtility.GetMaterialFloat("_HeightDisplacement", sharedWaterMaterial); + + heightDisplacement = EditorGUILayout.Slider("Height", heightDisplacement, 0.0F, 5.0F); + WaterEditorUtility.SetMaterialFloat("_HeightDisplacement", heightDisplacement, sharedWaterMaterial); + */ + } + + serObj.ApplyModifiedProperties(); + } +} \ No newline at end of file diff --git a/playable/Assets/Editor/Water (Pro Only)/Water4/GerstnerDisplaceEditor.cs.meta b/playable/Assets/Editor/Water (Pro Only)/Water4/GerstnerDisplaceEditor.cs.meta new file mode 100644 index 0000000..e4c23bf --- /dev/null +++ b/playable/Assets/Editor/Water (Pro Only)/Water4/GerstnerDisplaceEditor.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1dfa22e5547fb4a4585ba225887d89dd +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/playable/Assets/Editor/Water (Pro Only)/Water4/PlanarReflectionEditor.cs b/playable/Assets/Editor/Water (Pro Only)/Water4/PlanarReflectionEditor.cs new file mode 100644 index 0000000..c374700 --- /dev/null +++ b/playable/Assets/Editor/Water (Pro Only)/Water4/PlanarReflectionEditor.cs @@ -0,0 +1,60 @@ +using UnityEngine; +using UnityEditor; + +[CustomEditor(typeof(PlanarReflection))] +public class PlanarReflectionEditor : Editor +{ + private SerializedObject serObj; + + //private SerializedProperty wavesFrequency; + + // reflection + private SerializedProperty reflectionMask; + private SerializedProperty reflectSkybox; + private SerializedProperty clearColor; + + bool showKidsWithReflectionHint = false; + + public void OnEnable () { + serObj = new SerializedObject (target); + + reflectionMask = serObj.FindProperty("reflectionMask"); + reflectSkybox = serObj.FindProperty("reflectSkybox"); + clearColor = serObj.FindProperty("clearColor"); + } + + public override void OnInspectorGUI () + { + GUILayout.Label ("Render planar reflections and use GrabPass for refractions", EditorStyles.miniBoldLabel); + + if(!SystemInfo.supportsRenderTextures) + EditorGUILayout.HelpBox("Realtime reflections not supported", MessageType.Warning); + + serObj.Update(); + + EditorGUILayout.PropertyField(reflectionMask, new GUIContent("Reflection layers")); + EditorGUILayout.PropertyField(reflectSkybox, new GUIContent("Use skybox")); + EditorGUILayout.PropertyField(clearColor, new GUIContent("Clear color")); + + showKidsWithReflectionHint = EditorGUILayout.BeginToggleGroup("Show all tiles", showKidsWithReflectionHint); + if (showKidsWithReflectionHint) { + int i = 0; + foreach(Transform t in ((PlanarReflection)target).transform) { + if (t.GetComponent()) { + if(i%2==0) + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.ObjectField(t, typeof(Transform), true); + if(i%2==1) + EditorGUILayout.EndHorizontal(); + i = (i+1)%2; + } + } + if(i>0) + EditorGUILayout.EndHorizontal(); + } + EditorGUILayout.EndToggleGroup(); + + serObj.ApplyModifiedProperties(); + } + +} \ No newline at end of file diff --git a/playable/Assets/Editor/Water (Pro Only)/Water4/PlanarReflectionEditor.cs.meta b/playable/Assets/Editor/Water (Pro Only)/Water4/PlanarReflectionEditor.cs.meta new file mode 100644 index 0000000..a980baa --- /dev/null +++ b/playable/Assets/Editor/Water (Pro Only)/Water4/PlanarReflectionEditor.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ff3b0e14a61014f50be83e1a18c6d43e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/playable/Assets/Editor/Water (Pro Only)/Water4/SpecularLightingEditor.cs b/playable/Assets/Editor/Water (Pro Only)/Water4/SpecularLightingEditor.cs new file mode 100644 index 0000000..57fae31 --- /dev/null +++ b/playable/Assets/Editor/Water (Pro Only)/Water4/SpecularLightingEditor.cs @@ -0,0 +1,47 @@ +using UnityEngine; +using UnityEditor; + +[CustomEditor(typeof(SpecularLighting))] +public class SpecularLightingEditor : Editor +{ + private SerializedObject serObj; + private SerializedProperty specularLight; + + public void OnEnable () { + serObj = new SerializedObject (target); + specularLight = serObj.FindProperty("specularLight"); + } + + public override void OnInspectorGUI () + { + serObj.Update(); + + GameObject go = ((SpecularLighting)serObj.targetObject).gameObject; + WaterBase wb = (WaterBase)go.GetComponent(typeof(WaterBase)); + + if(!wb.sharedMaterial) + return; + + if(wb.sharedMaterial.HasProperty("_WorldLightDir")) { + GUILayout.Label ("Transform casting specular highlights", EditorStyles.miniBoldLabel); + EditorGUILayout.PropertyField(specularLight, new GUIContent("Specular light")); + + if(wb.sharedMaterial.HasProperty("_SpecularColor")) + WaterEditorUtility.SetMaterialColor( + "_SpecularColor", + EditorGUILayout.ColorField("Specular", + WaterEditorUtility.GetMaterialColor("_SpecularColor", wb.sharedMaterial)), + wb.sharedMaterial); + if(wb.sharedMaterial.HasProperty("_Shininess")) + WaterEditorUtility.SetMaterialFloat("_Shininess", EditorGUILayout.Slider( + "Specular power", + WaterEditorUtility.GetMaterialFloat("_Shininess", wb.sharedMaterial), + 0.0F, 500.0F), wb.sharedMaterial); + } + else + GUILayout.Label ("The shader doesn't have the needed _WorldLightDir property.", EditorStyles.miniBoldLabel); + + serObj.ApplyModifiedProperties(); + } + +} \ No newline at end of file diff --git a/playable/Assets/Editor/Water (Pro Only)/Water4/SpecularLightingEditor.cs.meta b/playable/Assets/Editor/Water (Pro Only)/Water4/SpecularLightingEditor.cs.meta new file mode 100644 index 0000000..f92cbae --- /dev/null +++ b/playable/Assets/Editor/Water (Pro Only)/Water4/SpecularLightingEditor.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 33f51eb21122c4ca6a199d561065ae30 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/playable/Assets/Editor/Water (Pro Only)/Water4/WaterBaseEditor.cs b/playable/Assets/Editor/Water (Pro Only)/Water4/WaterBaseEditor.cs new file mode 100644 index 0000000..8986f9f --- /dev/null +++ b/playable/Assets/Editor/Water (Pro Only)/Water4/WaterBaseEditor.cs @@ -0,0 +1,188 @@ +using UnityEngine; +using UnityEditor; + +[CustomEditor(typeof(WaterBase))] +public class WaterBaseEditor : Editor +{ + public GameObject oceanBase; + private WaterBase waterBase; + private Material oceanMaterial = null; + + private SerializedObject serObj; + private SerializedProperty sharedMaterial; + + + public SerializedProperty waterQuality; + public SerializedProperty edgeBlend; + + public void OnEnable () + { + serObj = new SerializedObject (target); + sharedMaterial = serObj.FindProperty("sharedMaterial"); + waterQuality = serObj.FindProperty("waterQuality"); + edgeBlend = serObj.FindProperty("edgeBlend"); + } + + public override void OnInspectorGUI () + { + serObj.Update(); + + waterBase = (WaterBase)serObj.targetObject; + oceanBase = ((WaterBase)serObj.targetObject).gameObject; + if(!oceanBase) + return; + + GUILayout.Label ("This script helps adjusting water material properties", EditorStyles.miniBoldLabel); + + EditorGUILayout.PropertyField(sharedMaterial, new GUIContent("Material")); + oceanMaterial = (Material)sharedMaterial.objectReferenceValue; + + if (!oceanMaterial) { + sharedMaterial.objectReferenceValue = (Object)WaterEditorUtility.LocateValidWaterMaterial(oceanBase.transform); + serObj.ApplyModifiedProperties(); + oceanMaterial = (Material)sharedMaterial.objectReferenceValue; + if (!oceanMaterial) + return; + } + + EditorGUILayout.Separator (); + + GUILayout.Label ("Overall Quality", EditorStyles.boldLabel); + EditorGUILayout.PropertyField(waterQuality, new GUIContent("Quality")); + EditorGUILayout.PropertyField(edgeBlend, new GUIContent("Edge blend?")); + + if(waterQuality.intValue > (int)WaterQuality.Low && !SystemInfo.supportsRenderTextures) + EditorGUILayout.HelpBox("Water features not supported", MessageType.Warning); + if(edgeBlend.boolValue && !SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.Depth)) + EditorGUILayout.HelpBox("Edge blend not supported", MessageType.Warning); + + EditorGUILayout.Separator (); + + bool hasShore = oceanMaterial.HasProperty("_ShoreTex"); + + GUILayout.Label ("Main Colors", EditorStyles.boldLabel); + GUILayout.Label ("Alpha values define blending with realtime textures", EditorStyles.miniBoldLabel); + + WaterEditorUtility.SetMaterialColor("_BaseColor", EditorGUILayout.ColorField("Refraction", WaterEditorUtility.GetMaterialColor("_BaseColor", oceanMaterial)), oceanMaterial); + WaterEditorUtility.SetMaterialColor("_ReflectionColor", EditorGUILayout.ColorField("Reflection", WaterEditorUtility.GetMaterialColor("_ReflectionColor", oceanMaterial)), oceanMaterial); + + EditorGUILayout.Separator (); + + GUILayout.Label ("Main Textures", EditorStyles.boldLabel); + GUILayout.Label ("Used for small waves (bumps), foam and white caps", EditorStyles.miniBoldLabel); + + WaterEditorUtility.SetMaterialTexture("_BumpMap",(Texture)EditorGUILayout.ObjectField("Normals", WaterEditorUtility.GetMaterialTexture("_BumpMap", waterBase.sharedMaterial), typeof(Texture), false), waterBase.sharedMaterial); + if (hasShore) + WaterEditorUtility.SetMaterialTexture("_ShoreTex", (Texture)EditorGUILayout.ObjectField("Shore & Foam", WaterEditorUtility.GetMaterialTexture("_ShoreTex", waterBase.sharedMaterial), typeof(Texture), false), waterBase.sharedMaterial); + + Vector4 animationTiling; + Vector4 animationDirection; + + Vector2 firstTiling; + Vector2 secondTiling; + Vector2 firstDirection; + Vector2 secondDirection; + + animationTiling = WaterEditorUtility.GetMaterialVector("_BumpTiling", oceanMaterial); + animationDirection = WaterEditorUtility.GetMaterialVector("_BumpDirection", oceanMaterial); + + firstTiling = new Vector2(animationTiling.x*100.0F,animationTiling.y*100.0F); + secondTiling = new Vector2(animationTiling.z*100.0F,animationTiling.w*100.0F); + + firstTiling = EditorGUILayout.Vector2Field("Tiling 1", firstTiling); + secondTiling = EditorGUILayout.Vector2Field("Tiling 2", secondTiling); + + //firstTiling.x = EditorGUILayout.FloatField("1st Tiling U", firstTiling.x); + //firstTiling.y = EditorGUILayout.FloatField("1st Tiling V", firstTiling.y); + //secondTiling.x = EditorGUILayout.FloatField("2nd Tiling U", secondTiling.x); + //secondTiling.y = EditorGUILayout.FloatField("2nd Tiling V", secondTiling.y); + + firstDirection = new Vector2(animationDirection.x,animationDirection.y); + secondDirection = new Vector2(animationDirection.z,animationDirection.w); + + //firstDirection.x = EditorGUILayout.FloatField("1st Animation U", firstDirection.x); + //firstDirection.y = EditorGUILayout.FloatField("1st Animation V", firstDirection.y); + //secondDirection.x = EditorGUILayout.FloatField("2nd Animation U", secondDirection.x); + //secondDirection.y = EditorGUILayout.FloatField("2nd Animation V", secondDirection.y); + + firstDirection = EditorGUILayout.Vector2Field("Direction 1", firstDirection); + secondDirection = EditorGUILayout.Vector2Field("Direction 2", secondDirection); + + animationTiling = new Vector4(firstTiling.x/100.0F,firstTiling.y/100.0F, secondTiling.x/100.0F,secondTiling.y/100.0F); + animationDirection = new Vector4(firstDirection.x,firstDirection.y, secondDirection.x,secondDirection.y); + + WaterEditorUtility.SetMaterialVector("_BumpTiling", animationTiling, oceanMaterial); + WaterEditorUtility.SetMaterialVector("_BumpDirection", animationDirection, oceanMaterial); + + Vector4 displacementParameter = WaterEditorUtility.GetMaterialVector("_DistortParams", oceanMaterial); + Vector4 fade = WaterEditorUtility.GetMaterialVector("_InvFadeParemeter", oceanMaterial); + + EditorGUILayout.Separator (); + + GUILayout.Label ("Normals", EditorStyles.boldLabel); + GUILayout.Label ("Displacement for fresnel, specular and reflection/refraction", EditorStyles.miniBoldLabel); + + float gerstnerNormalIntensity = WaterEditorUtility.GetMaterialFloat("_GerstnerIntensity", oceanMaterial); + gerstnerNormalIntensity = EditorGUILayout.Slider("Per Vertex", gerstnerNormalIntensity, -2.5F, 2.5F); + WaterEditorUtility.SetMaterialFloat("_GerstnerIntensity", gerstnerNormalIntensity, oceanMaterial); + + displacementParameter.x = EditorGUILayout.Slider("Per Pixel", displacementParameter.x, -4.0F, 4.0F); + displacementParameter.y = EditorGUILayout.Slider("Distortion", displacementParameter.y, -0.5F, 0.5F); + // fade.z = EditorGUILayout.Slider("Distance fade", fade.z, 0.0f, 0.5f); + + EditorGUILayout.Separator (); + + GUILayout.Label ("Fresnel", EditorStyles.boldLabel); + GUILayout.Label ("Defines reflection to refraction relation", EditorStyles.miniBoldLabel); + + if(!oceanMaterial.HasProperty("_Fresnel")) { + if(oceanMaterial.HasProperty("_FresnelScale")) { + float fresnelScale = EditorGUILayout.Slider("Intensity", WaterEditorUtility.GetMaterialFloat("_FresnelScale", oceanMaterial), 0.1F, 4.0F); + WaterEditorUtility.SetMaterialFloat("_FresnelScale", fresnelScale, oceanMaterial); + } + displacementParameter.z = EditorGUILayout.Slider("Power", displacementParameter.z, 0.1F, 10.0F); + displacementParameter.w = EditorGUILayout.Slider("Bias", displacementParameter.w, -3.0F, 3.0F); + } + else + { + Texture fresnelTex = (Texture)EditorGUILayout.ObjectField( + "Ramp", + (Texture)WaterEditorUtility.GetMaterialTexture("_Fresnel", + oceanMaterial), + typeof(Texture), + false); + WaterEditorUtility.SetMaterialTexture("_Fresnel", fresnelTex, oceanMaterial); + } + + EditorGUILayout.Separator (); + + WaterEditorUtility.SetMaterialVector("_DistortParams", displacementParameter, oceanMaterial); + + if (edgeBlend.boolValue) + { + GUILayout.Label ("Fading", EditorStyles.boldLabel); + + fade.x = EditorGUILayout.Slider("Edge fade", fade.x, 0.001f, 3.0f); + if(hasShore) + fade.y = EditorGUILayout.Slider("Shore fade", fade.y, 0.001f, 3.0f); + fade.w = EditorGUILayout.Slider("Extinction fade", fade.w, 0.0f, 2.5f); + + WaterEditorUtility.SetMaterialVector("_InvFadeParemeter", fade, oceanMaterial); + } + EditorGUILayout.Separator (); + + if(oceanMaterial.HasProperty("_Foam")) { + GUILayout.Label ("Foam", EditorStyles.boldLabel); + + Vector4 foam = WaterEditorUtility.GetMaterialVector("_Foam", oceanMaterial); + + foam.x = EditorGUILayout.Slider("Intensity", foam.x, 0.0F, 1.0F); + foam.y = EditorGUILayout.Slider("Cutoff", foam.y, 0.0F, 1.0F); + + WaterEditorUtility.SetMaterialVector("_Foam", foam, oceanMaterial); + } + + serObj.ApplyModifiedProperties(); + } + +} \ No newline at end of file diff --git a/playable/Assets/Editor/Water (Pro Only)/Water4/WaterBaseEditor.cs.meta b/playable/Assets/Editor/Water (Pro Only)/Water4/WaterBaseEditor.cs.meta new file mode 100644 index 0000000..6849312 --- /dev/null +++ b/playable/Assets/Editor/Water (Pro Only)/Water4/WaterBaseEditor.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9c2c627f6fe3945b39581fc103d32251 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/playable/Assets/Editor/Water (Pro Only)/Water4/WaterEditorUtility.cs b/playable/Assets/Editor/Water (Pro Only)/Water4/WaterEditorUtility.cs new file mode 100644 index 0000000..057e2da --- /dev/null +++ b/playable/Assets/Editor/Water (Pro Only)/Water4/WaterEditorUtility.cs @@ -0,0 +1,75 @@ +using UnityEngine; +using UnityEditor; + +class WaterEditorUtility +{ + // helper functions to retrieve & set material values + + public static float GetMaterialFloat(System.String name, Material mat) { + return mat.GetFloat(name); + } + public static void SetMaterialFloat(System.String name, float f, Material mat) { + mat.SetFloat(name, f); + } + + public static Color GetMaterialColor(System.String name, Material mat) { + return mat.GetColor(name); + } + public static void SetMaterialColor(System.String name, Color color, Material mat) { + mat.SetColor(name, color); + } + public static Vector4 GetMaterialVector(System.String name, Material mat) { + return mat.GetVector(name); + } + public static void SetMaterialVector(System.String name, Vector4 vector, Material mat) { + mat.SetVector(name, vector); + } + public static Texture GetMaterialTexture(System.String theName, Material mat) { + return mat.GetTexture(theName); + } + public static void SetMaterialTexture(System.String theName, Texture parameter, Material mat) { + mat.SetTexture(theName, parameter); + } + + public static Material LocateValidWaterMaterial(Transform parent) + { + if(parent.renderer && parent.renderer.sharedMaterial) + return parent.renderer.sharedMaterial; + foreach( Transform t in parent) + { + if(t.renderer && t.renderer.sharedMaterial) + return t.renderer.sharedMaterial; + } + return null; + } + + public static void CurveGui (System.String name, SerializedObject serObj, Color color) + { + AnimationCurve curve = new AnimationCurve(new Keyframe(0, 0.0f, 1.0f, 1.0f), new Keyframe(1, 1.0f, 1.0f, 1.0f)); + curve = EditorGUILayout.CurveField(new GUIContent (name), curve, color, new Rect (0.0f,0.0f,1.0f,1.0f)); + + //if (GUI.changed) { + // AnimationCurveChanged(((WaterBase)serObj.targetObject).sharedMaterial, curve); + //((WaterBase)serObj.targetObject).gameObject.SendMessage ("AnimationCurveChanged", SendMessageOptions.DontRequireReceiver); + //} + } + /* + public static void AnimationCurveChanged(Material sharedMaterial, AnimationCurve fresnelCurve) + { + Debug.Log("AnimationCurveChanged"); + Texture2D fresnel = (Texture2D)sharedMaterial.GetTexture("_Fresnel"); + if(!fresnel) + fresnel = new Texture2D(256,1); + + for (int i = 0; i < 256; i++) + { + float val = Mathf.Clamp01(fresnelCurve.Evaluate((float)i)/255.0f); + Debug.Log(""+(((float)i)/255.0f) +": "+val); + fresnel.SetPixel(i, 0, new Color(val,val,val,val)); + } + fresnel.Apply(); + + sharedMaterial.SetTexture("_Fresnel", fresnel); + + } */ +} \ No newline at end of file diff --git a/playable/Assets/Editor/Water (Pro Only)/Water4/WaterEditorUtility.cs.meta b/playable/Assets/Editor/Water (Pro Only)/Water4/WaterEditorUtility.cs.meta new file mode 100644 index 0000000..cd22406 --- /dev/null +++ b/playable/Assets/Editor/Water (Pro Only)/Water4/WaterEditorUtility.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f67f2bac30f824d4f8270bb8bb0779df +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/playable/Assets/Prefabs/Plane.prefab b/playable/Assets/Prefabs/Plane.prefab new file mode 100644 index 0000000..6db80b4 Binary files /dev/null and b/playable/Assets/Prefabs/Plane.prefab differ diff --git a/playable/Assets/Prefabs/Plane.prefab.meta b/playable/Assets/Prefabs/Plane.prefab.meta new file mode 100644 index 0000000..43db263 --- /dev/null +++ b/playable/Assets/Prefabs/Plane.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: a2cdf2ef81f27984fa7b93bd6d364c16 +NativeFormatImporter: + userData: diff --git a/playable/Assets/Scenes/Level1.unity b/playable/Assets/Scenes/Level1.unity index 59cf0ff..b5c3acc 100644 Binary files a/playable/Assets/Scenes/Level1.unity and b/playable/Assets/Scenes/Level1.unity differ diff --git a/playable/Assets/Scripts/Patrol.cs b/playable/Assets/Scripts/Patrol.cs new file mode 100644 index 0000000..279839c --- /dev/null +++ b/playable/Assets/Scripts/Patrol.cs @@ -0,0 +1,48 @@ +using UnityEngine; +using System.Collections; + +public class Patrol : MonoBehaviour { + + public float patrolDistance; + public int waitTime; + public float speed; + public bool startRight; + + public int direction = 1; + private Vector3 startPosition; + private int curWait = 0; + + // Use this for initialization + void Start () { + startPosition = transform.position; + if (!startRight) { + transform.Rotate (Vector3.up * 180); + direction *= -1; + } + + } + + // Update is called once per frame + void Update () { + Vector3 curPosition = transform.position; + Vector3 move = new Vector3(1, 0.0f ,0.0f); + + move.x *= speed; + move *= direction; + + + if (curWait == 0) { + if (Mathf.Abs(startPosition.x - curPosition.x) < patrolDistance) + transform.position += move; + else + curWait = waitTime; + } else if (curWait == 1) { + transform.Rotate (Vector3.up * 180); + direction *= -1; + transform.position -= move; + curWait--; + } else + curWait--; + + } +} diff --git a/playable/Assets/Scripts/Patrol.cs.meta b/playable/Assets/Scripts/Patrol.cs.meta new file mode 100644 index 0000000..58f3179 --- /dev/null +++ b/playable/Assets/Scripts/Patrol.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: afa701e8ac1b548478719de7f588c6d2 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/playable/Assets/Shaders/Water.mat b/playable/Assets/Shaders/Water.mat new file mode 100644 index 0000000..b12e4b0 Binary files /dev/null and b/playable/Assets/Shaders/Water.mat differ diff --git a/playable/Assets/Shaders/Water.mat.meta b/playable/Assets/Shaders/Water.mat.meta new file mode 100644 index 0000000..0ae6401 --- /dev/null +++ b/playable/Assets/Shaders/Water.mat.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 09de098202ab0a7439f834e8df93e9d2 +NativeFormatImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic).meta b/playable/Assets/Standard Assets/Water (Basic).meta new file mode 100644 index 0000000..9b8fe2e --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic).meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: dc7abfa0435174ded902b073322d67cc +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic)/Daylight Simple Water.prefab b/playable/Assets/Standard Assets/Water (Basic)/Daylight Simple Water.prefab new file mode 100644 index 0000000..5ec04e8 Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Basic)/Daylight Simple Water.prefab differ diff --git a/playable/Assets/Standard Assets/Water (Basic)/Daylight Simple Water.prefab.meta b/playable/Assets/Standard Assets/Water (Basic)/Daylight Simple Water.prefab.meta new file mode 100644 index 0000000..b2c3b20 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Daylight Simple Water.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 9485b0c79d11e2e4d0007da98d76c639 +NativeFormatImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic)/Nighttime Simple Water.prefab b/playable/Assets/Standard Assets/Water (Basic)/Nighttime Simple Water.prefab new file mode 100644 index 0000000..3aff6b2 Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Basic)/Nighttime Simple Water.prefab differ diff --git a/playable/Assets/Standard Assets/Water (Basic)/Nighttime Simple Water.prefab.meta b/playable/Assets/Standard Assets/Water (Basic)/Nighttime Simple Water.prefab.meta new file mode 100644 index 0000000..b07b104 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Nighttime Simple Water.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 6b436d069d11415d1100ab9b44295342 +NativeFormatImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources.meta b/playable/Assets/Standard Assets/Water (Basic)/Sources.meta new file mode 100644 index 0000000..402aea4 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Sources.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 70a4c3571f5624280bd8605def97056d +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Materials.meta b/playable/Assets/Standard Assets/Water (Basic)/Sources/Materials.meta new file mode 100644 index 0000000..e261120 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Sources/Materials.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 706eadfad28bc4c1c9bb137b31052b14 +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Materials/Daylight Simple Water.mat b/playable/Assets/Standard Assets/Water (Basic)/Sources/Materials/Daylight Simple Water.mat new file mode 100644 index 0000000..93d18bb Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Basic)/Sources/Materials/Daylight Simple Water.mat differ diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Materials/Daylight Simple Water.mat.meta b/playable/Assets/Standard Assets/Water (Basic)/Sources/Materials/Daylight Simple Water.mat.meta new file mode 100644 index 0000000..b3f3292 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Sources/Materials/Daylight Simple Water.mat.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 52b7d70b1de7c4ce09662b77c14d9fda +NativeFormatImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Materials/Nighttime Simple Water.mat b/playable/Assets/Standard Assets/Water (Basic)/Sources/Materials/Nighttime Simple Water.mat new file mode 100644 index 0000000..3c6d65a Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Basic)/Sources/Materials/Nighttime Simple Water.mat differ diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Materials/Nighttime Simple Water.mat.meta b/playable/Assets/Standard Assets/Water (Basic)/Sources/Materials/Nighttime Simple Water.mat.meta new file mode 100644 index 0000000..e3a733e --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Sources/Materials/Nighttime Simple Water.mat.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: c55afdc4a8a3b4890b07cc7d176510bb +NativeFormatImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Objects.meta b/playable/Assets/Standard Assets/Water (Basic)/Sources/Objects.meta new file mode 100644 index 0000000..a440dc2 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Sources/Objects.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 2fd60b04f7c434a4dafd253d09bfa783 +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Objects/Materials.meta b/playable/Assets/Standard Assets/Water (Basic)/Sources/Objects/Materials.meta new file mode 100644 index 0000000..c6da639 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Sources/Objects/Materials.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 40b01469ebddf42bc84870ba2f3d8c4c +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Objects/Materials/water plane-lambert1.mat b/playable/Assets/Standard Assets/Water (Basic)/Sources/Objects/Materials/water plane-lambert1.mat new file mode 100644 index 0000000..775b573 Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Basic)/Sources/Objects/Materials/water plane-lambert1.mat differ diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Objects/Materials/water plane-lambert1.mat.meta b/playable/Assets/Standard Assets/Water (Basic)/Sources/Objects/Materials/water plane-lambert1.mat.meta new file mode 100644 index 0000000..2398104 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Sources/Objects/Materials/water plane-lambert1.mat.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 30abebfd9bf1c49d8a2d26e61e66bc15 +NativeFormatImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Objects/Water Plane.fbx b/playable/Assets/Standard Assets/Water (Basic)/Sources/Objects/Water Plane.fbx new file mode 100644 index 0000000..a4d6835 Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Basic)/Sources/Objects/Water Plane.fbx differ diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Objects/Water Plane.fbx.meta b/playable/Assets/Standard Assets/Water (Basic)/Sources/Objects/Water Plane.fbx.meta new file mode 100644 index 0000000..d3fc17d --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Sources/Objects/Water Plane.fbx.meta @@ -0,0 +1,68 @@ +fileFormatVersion: 2 +guid: ce8d79c79d11b8f9d00076e98d76c639 +ModelImporter: + serializedVersion: 16 + fileIDToRecycleName: + 100000: //RootNode + 400000: //RootNode + 2300000: //RootNode + 3300000: //RootNode + 4300000: pPlane1 + 4300002: nurbsToPoly1 + 4300004: pCylinder1 + 4300006: waterPlaneMesh + 11100000: //RootNode + materials: + importMaterials: 1 + materialName: 3 + materialSearch: 1 + animations: + legacyGenerateAnimations: 0 + bakeSimulation: 0 + optimizeGameObjects: 0 + motionNodeName: + animationCompression: 1 + animationRotationError: .5 + animationPositionError: .5 + animationScaleError: .5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + importBlendShapes: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + optimizeMeshForGPU: 1 + weldVertices: 1 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + tangentSpace: + normalSmoothAngle: 60 + splitTangentsAcrossUV: 0 + normalImportMode: 0 + tangentImportMode: 1 + importAnimation: 1 + copyAvatar: 0 + humanDescription: + human: [] + skeleton: [] + armTwist: .5 + foreArmTwist: .5 + upperLegTwist: .5 + legTwist: .5 + armStretch: .0500000007 + legStretch: .0500000007 + feetSpacing: 0 + rootMotionBoneName: + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 1 + additionalBone: 1 + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Scripts.meta b/playable/Assets/Standard Assets/Water (Basic)/Sources/Scripts.meta new file mode 100644 index 0000000..20fc392 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Sources/Scripts.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: ac85670a1b2274f22905d6a43940371a +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Scripts/WaterSimple.cs b/playable/Assets/Standard Assets/Water (Basic)/Sources/Scripts/WaterSimple.cs new file mode 100644 index 0000000..8a02041 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Sources/Scripts/WaterSimple.cs @@ -0,0 +1,32 @@ +using UnityEngine; + +// Sets up transformation matrices to scale&scroll water waves +// for the case where graphics card does not support vertex programs. + +[ExecuteInEditMode] +public class WaterSimple : MonoBehaviour +{ + void Update() + { + if( !GetComponent() ) + return; + Material mat = GetComponent().sharedMaterial; + if( !mat ) + return; + + Vector4 waveSpeed = mat.GetVector( "WaveSpeed" ); + float waveScale = mat.GetFloat( "_WaveScale" ); + float t = Time.time / 20.0f; + + Vector4 offset4 = waveSpeed * (t * waveScale); + Vector4 offsetClamped = new Vector4(Mathf.Repeat(offset4.x,1.0f), Mathf.Repeat(offset4.y,1.0f), Mathf.Repeat(offset4.z,1.0f), Mathf.Repeat(offset4.w,1.0f)); + mat.SetVector( "_WaveOffset", offsetClamped ); + + Vector3 scale = new Vector3( 1.0f/waveScale, 1.0f/waveScale, 1 ); + Matrix4x4 scrollMatrix = Matrix4x4.TRS( new Vector3(offsetClamped.x,offsetClamped.y,0), Quaternion.identity, scale ); + mat.SetMatrix( "_WaveMatrix", scrollMatrix ); + + scrollMatrix = Matrix4x4.TRS( new Vector3(offsetClamped.z,offsetClamped.w,0), Quaternion.identity, scale * 0.45f ); + mat.SetMatrix( "_WaveMatrix2", scrollMatrix ); + } +} diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Scripts/WaterSimple.cs.meta b/playable/Assets/Standard Assets/Water (Basic)/Sources/Scripts/WaterSimple.cs.meta new file mode 100644 index 0000000..5391b72 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Sources/Scripts/WaterSimple.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0d2f50a8e0bb841a5aaa90ae55db8849 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Shaders.meta b/playable/Assets/Standard Assets/Water (Basic)/Sources/Shaders.meta new file mode 100644 index 0000000..0006c17 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Sources/Shaders.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: c8e96a067d1ef4982b454cf5a686f648 +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Shaders/FX-Water Simple.shader b/playable/Assets/Standard Assets/Water (Basic)/Sources/Shaders/FX-Water Simple.shader new file mode 100644 index 0000000..b0a2c1f --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Sources/Shaders/FX-Water Simple.shader @@ -0,0 +1,140 @@ +Shader "FX/Water (simple)" { +Properties { + _horizonColor ("Horizon color", COLOR) = ( .172 , .463 , .435 , 0) + _WaveScale ("Wave scale", Range (0.02,0.15)) = .07 + _ColorControl ("Reflective color (RGB) fresnel (A) ", 2D) = "" { } + _ColorControlCube ("Reflective color cube (RGB) fresnel (A) ", Cube) = "" { TexGen CubeReflect } + _BumpMap ("Waves Normalmap ", 2D) = "" { } + WaveSpeed ("Wave speed (map1 x,y; map2 x,y)", Vector) = (19,9,-16,-7) + _MainTex ("Fallback texture", 2D) = "" { } +} + +CGINCLUDE +// ----------------------------------------------------------- +// This section is included in all program sections below + +#include "UnityCG.cginc" + +uniform float4 _horizonColor; + +uniform float4 WaveSpeed; +uniform float _WaveScale; +uniform float4 _WaveOffset; + +struct appdata { + float4 vertex : POSITION; + float3 normal : NORMAL; +}; + +struct v2f { + float4 pos : SV_POSITION; + float2 bumpuv[2] : TEXCOORD0; + float3 viewDir : TEXCOORD2; +}; + +v2f vert(appdata v) +{ + v2f o; + float4 s; + + o.pos = mul (UNITY_MATRIX_MVP, v.vertex); + + // scroll bump waves + float4 temp; + temp.xyzw = v.vertex.xzxz * _WaveScale / unity_Scale.w + _WaveOffset; + o.bumpuv[0] = temp.xy * float2(.4, .45); + o.bumpuv[1] = temp.wz; + + // object space view direction + o.viewDir.xzy = normalize( ObjSpaceViewDir(v.vertex) ); + + return o; +} + +ENDCG + +// ----------------------------------------------------------- +// Fragment program + +Subshader { + Tags { "RenderType"="Opaque" } + Pass { + +CGPROGRAM +#pragma vertex vert +#pragma fragment frag +#pragma fragmentoption ARB_precision_hint_fastest + +sampler2D _BumpMap; +sampler2D _ColorControl; + +half4 frag( v2f i ) : COLOR +{ + half3 bump1 = UnpackNormal(tex2D( _BumpMap, i.bumpuv[0] )).rgb; + half3 bump2 = UnpackNormal(tex2D( _BumpMap, i.bumpuv[1] )).rgb; + half3 bump = (bump1 + bump2) * 0.5; + + half fresnel = dot( i.viewDir, bump ); + half4 water = tex2D( _ColorControl, float2(fresnel,fresnel) ); + + half4 col; + col.rgb = lerp( water.rgb, _horizonColor.rgb, water.a ); + col.a = _horizonColor.a; + return col; +} +ENDCG + } +} + +// ----------------------------------------------------------- +// Old cards + +// three texture, cubemaps +Subshader { + Tags { "RenderType"="Opaque" } + Pass { + Color (0.5,0.5,0.5,0.5) + SetTexture [_MainTex] { + Matrix [_WaveMatrix] + combine texture * primary + } + SetTexture [_MainTex] { + Matrix [_WaveMatrix2] + combine texture * primary + previous + } + SetTexture [_ColorControlCube] { + combine texture +- previous, primary + Matrix [_Reflection] + } + } +} + +// dual texture, cubemaps +Subshader { + Tags { "RenderType"="Opaque" } + Pass { + Color (0.5,0.5,0.5,0.5) + SetTexture [_MainTex] { + Matrix [_WaveMatrix] + combine texture + } + SetTexture [_ColorControlCube] { + combine texture +- previous, primary + Matrix [_Reflection] + } + } +} + +// single texture +Subshader { + Tags { "RenderType"="Opaque" } + Pass { + Color (0.5,0.5,0.5,0) + SetTexture [_MainTex] { + Matrix [_WaveMatrix] + combine texture, primary + } + } +} + +} diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Shaders/FX-Water Simple.shader.meta b/playable/Assets/Standard Assets/Water (Basic)/Sources/Shaders/FX-Water Simple.shader.meta new file mode 100644 index 0000000..7cbb4bf --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Sources/Shaders/FX-Water Simple.shader.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 9dccc8e8f0da4494991c26ef59019551 +ShaderImporter: + defaultTextures: [] + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Shaders/water.mat b/playable/Assets/Standard Assets/Water (Basic)/Sources/Shaders/water.mat new file mode 100644 index 0000000..7dd49c4 Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Basic)/Sources/Shaders/water.mat differ diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Shaders/water.mat.meta b/playable/Assets/Standard Assets/Water (Basic)/Sources/Shaders/water.mat.meta new file mode 100644 index 0000000..12f7ba1 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Sources/Shaders/water.mat.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 5421734063b66ee4f8a180ecae8132bc +NativeFormatImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures.meta b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures.meta new file mode 100644 index 0000000..5e8cee6 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 33850b67ffcaa4b6c9a7146e4be0b917 +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/Water fallback.jpg b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/Water fallback.jpg new file mode 100644 index 0000000..0334b7a Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/Water fallback.jpg differ diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/Water fallback.jpg.meta b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/Water fallback.jpg.meta new file mode 100644 index 0000000..65ad635 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/Water fallback.jpg.meta @@ -0,0 +1,47 @@ +fileFormatVersion: 2 +guid: c2ef94ff9d11915d1100a04b44295342 +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 2 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 512 + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapMode: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: 0 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/Waterbump.jpg b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/Waterbump.jpg new file mode 100644 index 0000000..9cbd3de Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/Waterbump.jpg differ diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/Waterbump.jpg.meta b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/Waterbump.jpg.meta new file mode 100644 index 0000000..036a323 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/Waterbump.jpg.meta @@ -0,0 +1,47 @@ +fileFormatVersion: 2 +guid: a53cf5449d11a15d1100a04b44295342 +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 2 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 1 + externalNormalMap: 1 + heightScale: .0164516103 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 512 + textureSettings: + filterMode: 1 + aniso: 3 + mipBias: 0 + wrapMode: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: 1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/nightgradient cubemap.psd b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/nightgradient cubemap.psd new file mode 100644 index 0000000..b695f21 Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/nightgradient cubemap.psd differ diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/nightgradient cubemap.psd.meta b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/nightgradient cubemap.psd.meta new file mode 100644 index 0000000..d9fec02 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/nightgradient cubemap.psd.meta @@ -0,0 +1,48 @@ +fileFormatVersion: 2 +guid: 006a5f739d1105f6a000538a2aef8c59 +TextureImporter: + fileIDToRecycleName: + 8900000: generatedCubemap + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 2 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .100000001 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 3 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 32 + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapMode: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/nightgradient.psd b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/nightgradient.psd new file mode 100644 index 0000000..d853a2b Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/nightgradient.psd differ diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/nightgradient.psd.meta b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/nightgradient.psd.meta new file mode 100644 index 0000000..79fe21f --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/nightgradient.psd.meta @@ -0,0 +1,47 @@ +fileFormatVersion: 2 +guid: 8403d3349d112ba4d000be1be39e7c39 +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 2 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .100000001 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 32 + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapMode: 1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: 0 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/oceangradient.psd b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/oceangradient.psd new file mode 100644 index 0000000..4469116 Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/oceangradient.psd differ diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/oceangradient.psd.meta b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/oceangradient.psd.meta new file mode 100644 index 0000000..eebcb67 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/oceangradient.psd.meta @@ -0,0 +1,47 @@ +fileFormatVersion: 2 +guid: 047330f39d11745ad0004adb8d76c639 +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 2 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .100000001 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 32 + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapMode: 1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: 0 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/oceangradientcube.psd b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/oceangradientcube.psd new file mode 100644 index 0000000..07ce19a Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/oceangradientcube.psd differ diff --git a/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/oceangradientcube.psd.meta b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/oceangradientcube.psd.meta new file mode 100644 index 0000000..2d96eed --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Basic)/Sources/Textures/oceangradientcube.psd.meta @@ -0,0 +1,48 @@ +fileFormatVersion: 2 +guid: 98c330f39d11745ad0004adb8d76c639 +TextureImporter: + fileIDToRecycleName: + 8900000: generatedCubemap + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 2 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .100000001 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 3 + seamlessCubemap: 0 + textureFormat: 12 + maxTextureSize: 32 + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapMode: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only).meta b/playable/Assets/Standard Assets/Water (Pro Only).meta new file mode 100644 index 0000000..387fd00 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only).meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 15577174a872740edb59495b6549a0c3 +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Daylight Water.prefab b/playable/Assets/Standard Assets/Water (Pro Only)/Daylight Water.prefab new file mode 100644 index 0000000..84a1b4d Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Pro Only)/Daylight Water.prefab differ diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Daylight Water.prefab.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Daylight Water.prefab.meta new file mode 100644 index 0000000..80ef5c3 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Daylight Water.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 780611a67e8e941a2b3aa96e5915a793 +NativeFormatImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Nighttime Water.prefab b/playable/Assets/Standard Assets/Water (Pro Only)/Nighttime Water.prefab new file mode 100644 index 0000000..21f0231 Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Pro Only)/Nighttime Water.prefab differ diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Nighttime Water.prefab.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Nighttime Water.prefab.meta new file mode 100644 index 0000000..704a06c --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Nighttime Water.prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: bcae914220acd4907840a029bb9d9aec +NativeFormatImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Sources.meta new file mode 100644 index 0000000..546b122 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Sources.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 32569ca6b14e24176be40165ccaa300c +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Materials.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Materials.meta new file mode 100644 index 0000000..e4afc72 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Materials.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 8269a010592f549af8f11b1683d9e794 +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Materials/Daylight Water.mat b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Materials/Daylight Water.mat new file mode 100644 index 0000000..ada92c9 Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Materials/Daylight Water.mat differ diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Materials/Daylight Water.mat.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Materials/Daylight Water.mat.meta new file mode 100644 index 0000000..461bca6 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Materials/Daylight Water.mat.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: ae162c0523ab4468bb03ef160eb672e2 +NativeFormatImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Materials/Nighttime Water.mat b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Materials/Nighttime Water.mat new file mode 100644 index 0000000..e3f52c0 Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Materials/Nighttime Water.mat differ diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Materials/Nighttime Water.mat.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Materials/Nighttime Water.mat.meta new file mode 100644 index 0000000..033d978 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Materials/Nighttime Water.mat.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: e633a20421c47426aa04444234225b69 +NativeFormatImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Objects.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Objects.meta new file mode 100644 index 0000000..11d8f9c --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Objects.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: fe5d00245bc1d42a7927f4b2879026b8 +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Objects/Materials.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Objects/Materials.meta new file mode 100644 index 0000000..da5c12c --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Objects/Materials.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 1e68e75546e8d4feab8846bfaf8878d3 +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Objects/Materials/water plane-lambert1.mat b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Objects/Materials/water plane-lambert1.mat new file mode 100644 index 0000000..775b573 Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Objects/Materials/water plane-lambert1.mat differ diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Objects/Materials/water plane-lambert1.mat.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Objects/Materials/water plane-lambert1.mat.meta new file mode 100644 index 0000000..0f828fb --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Objects/Materials/water plane-lambert1.mat.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 358a87f082de94ddd810e929c00c8594 +NativeFormatImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Objects/Water Plane.fbx b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Objects/Water Plane.fbx new file mode 100644 index 0000000..a4d6835 Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Objects/Water Plane.fbx differ diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Objects/Water Plane.fbx.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Objects/Water Plane.fbx.meta new file mode 100644 index 0000000..cf8734e --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Objects/Water Plane.fbx.meta @@ -0,0 +1,68 @@ +fileFormatVersion: 2 +guid: ba6a41dc489914734857bb5924eb70ad +ModelImporter: + serializedVersion: 16 + fileIDToRecycleName: + 100000: //RootNode + 400000: //RootNode + 2300000: //RootNode + 3300000: //RootNode + 4300000: pPlane1 + 4300002: nurbsToPoly1 + 4300004: pCylinder1 + 4300006: waterPlaneMesh + 11100000: //RootNode + materials: + importMaterials: 1 + materialName: 3 + materialSearch: 1 + animations: + legacyGenerateAnimations: 0 + bakeSimulation: 0 + optimizeGameObjects: 0 + motionNodeName: + animationCompression: 1 + animationRotationError: .5 + animationPositionError: .5 + animationScaleError: .5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + importBlendShapes: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + optimizeMeshForGPU: 1 + weldVertices: 1 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + tangentSpace: + normalSmoothAngle: 60 + splitTangentsAcrossUV: 0 + normalImportMode: 0 + tangentImportMode: 1 + importAnimation: 1 + copyAvatar: 0 + humanDescription: + human: [] + skeleton: [] + armTwist: .5 + foreArmTwist: .5 + upperLegTwist: .5 + legTwist: .5 + armStretch: .0500000007 + legStretch: .0500000007 + feetSpacing: 0 + rootMotionBoneName: + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 1 + additionalBone: 1 + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Scripts.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Scripts.meta new file mode 100644 index 0000000..33284b0 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Scripts.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: b5b8c0f9acc2944f086c02cb83f4ae76 +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Scripts/Water.cs b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Scripts/Water.cs new file mode 100644 index 0000000..2f298f3 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Scripts/Water.cs @@ -0,0 +1,369 @@ +using UnityEngine; +using System.Collections; +using System.Collections.Generic; + +[ExecuteInEditMode] // Make water live-update even when not in play mode +public class Water : MonoBehaviour +{ + public enum WaterMode { + Simple = 0, + Reflective = 1, + Refractive = 2, + }; + public WaterMode m_WaterMode = WaterMode.Refractive; + public bool m_DisablePixelLights = true; + public int m_TextureSize = 256; + public float m_ClipPlaneOffset = 0.07f; + + public LayerMask m_ReflectLayers = -1; + public LayerMask m_RefractLayers = -1; + + private Dictionary m_ReflectionCameras = new Dictionary(); // Camera -> Camera table + private Dictionary m_RefractionCameras = new Dictionary(); // Camera -> Camera table + + private RenderTexture m_ReflectionTexture = null; + private RenderTexture m_RefractionTexture = null; + private WaterMode m_HardwareWaterSupport = WaterMode.Refractive; + private int m_OldReflectionTextureSize = 0; + private int m_OldRefractionTextureSize = 0; + + private static bool s_InsideWater = false; + + // This is called when it's known that the object will be rendered by some + // camera. We render reflections / refractions and do other updates here. + // Because the script executes in edit mode, reflections for the scene view + // camera will just work! + public void OnWillRenderObject() + { + if( !enabled || !renderer || !renderer.sharedMaterial || !renderer.enabled ) + return; + + Camera cam = Camera.current; + if( !cam ) + return; + + // Safeguard from recursive water reflections. + if( s_InsideWater ) + return; + s_InsideWater = true; + + // Actual water rendering mode depends on both the current setting AND + // the hardware support. There's no point in rendering refraction textures + // if they won't be visible in the end. + m_HardwareWaterSupport = FindHardwareWaterSupport(); + WaterMode mode = GetWaterMode(); + + Camera reflectionCamera, refractionCamera; + CreateWaterObjects( cam, out reflectionCamera, out refractionCamera ); + + // find out the reflection plane: position and normal in world space + Vector3 pos = transform.position; + Vector3 normal = transform.up; + + // Optionally disable pixel lights for reflection/refraction + int oldPixelLightCount = QualitySettings.pixelLightCount; + if( m_DisablePixelLights ) + QualitySettings.pixelLightCount = 0; + + UpdateCameraModes( cam, reflectionCamera ); + UpdateCameraModes( cam, refractionCamera ); + + // Render reflection if needed + if( mode >= WaterMode.Reflective ) + { + // Reflect camera around reflection plane + float d = -Vector3.Dot (normal, pos) - m_ClipPlaneOffset; + Vector4 reflectionPlane = new Vector4 (normal.x, normal.y, normal.z, d); + + Matrix4x4 reflection = Matrix4x4.zero; + CalculateReflectionMatrix (ref reflection, reflectionPlane); + Vector3 oldpos = cam.transform.position; + Vector3 newpos = reflection.MultiplyPoint( oldpos ); + reflectionCamera.worldToCameraMatrix = cam.worldToCameraMatrix * reflection; + + // Setup oblique projection matrix so that near plane is our reflection + // plane. This way we clip everything below/above it for free. + Vector4 clipPlane = CameraSpacePlane( reflectionCamera, pos, normal, 1.0f ); + reflectionCamera.projectionMatrix = cam.CalculateObliqueMatrix(clipPlane); + + reflectionCamera.cullingMask = ~(1<<4) & m_ReflectLayers.value; // never render water layer + reflectionCamera.targetTexture = m_ReflectionTexture; + GL.SetRevertBackfacing (true); + reflectionCamera.transform.position = newpos; + Vector3 euler = cam.transform.eulerAngles; + reflectionCamera.transform.eulerAngles = new Vector3(-euler.x, euler.y, euler.z); + reflectionCamera.Render(); + reflectionCamera.transform.position = oldpos; + GL.SetRevertBackfacing (false); + renderer.sharedMaterial.SetTexture( "_ReflectionTex", m_ReflectionTexture ); + } + + // Render refraction + if( mode >= WaterMode.Refractive ) + { + refractionCamera.worldToCameraMatrix = cam.worldToCameraMatrix; + + // Setup oblique projection matrix so that near plane is our reflection + // plane. This way we clip everything below/above it for free. + Vector4 clipPlane = CameraSpacePlane( refractionCamera, pos, normal, -1.0f ); + refractionCamera.projectionMatrix = cam.CalculateObliqueMatrix(clipPlane); + + refractionCamera.cullingMask = ~(1<<4) & m_RefractLayers.value; // never render water layer + refractionCamera.targetTexture = m_RefractionTexture; + refractionCamera.transform.position = cam.transform.position; + refractionCamera.transform.rotation = cam.transform.rotation; + refractionCamera.Render(); + renderer.sharedMaterial.SetTexture( "_RefractionTex", m_RefractionTexture ); + } + + // Restore pixel light count + if( m_DisablePixelLights ) + QualitySettings.pixelLightCount = oldPixelLightCount; + + // Setup shader keywords based on water mode + switch( mode ) + { + case WaterMode.Simple: + Shader.EnableKeyword( "WATER_SIMPLE" ); + Shader.DisableKeyword( "WATER_REFLECTIVE" ); + Shader.DisableKeyword( "WATER_REFRACTIVE" ); + break; + case WaterMode.Reflective: + Shader.DisableKeyword( "WATER_SIMPLE" ); + Shader.EnableKeyword( "WATER_REFLECTIVE" ); + Shader.DisableKeyword( "WATER_REFRACTIVE" ); + break; + case WaterMode.Refractive: + Shader.DisableKeyword( "WATER_SIMPLE" ); + Shader.DisableKeyword( "WATER_REFLECTIVE" ); + Shader.EnableKeyword( "WATER_REFRACTIVE" ); + break; + } + + s_InsideWater = false; + } + + + // Cleanup all the objects we possibly have created + void OnDisable() + { + if( m_ReflectionTexture ) { + DestroyImmediate( m_ReflectionTexture ); + m_ReflectionTexture = null; + } + if( m_RefractionTexture ) { + DestroyImmediate( m_RefractionTexture ); + m_RefractionTexture = null; + } + foreach (KeyValuePair kvp in m_ReflectionCameras) + DestroyImmediate( (kvp.Value).gameObject ); + m_ReflectionCameras.Clear(); + foreach (KeyValuePair kvp in m_RefractionCameras) + DestroyImmediate( (kvp.Value).gameObject ); + m_RefractionCameras.Clear(); + } + + + // This just sets up some matrices in the material; for really + // old cards to make water texture scroll. + void Update() + { + if( !renderer ) + return; + Material mat = renderer.sharedMaterial; + if( !mat ) + return; + + Vector4 waveSpeed = mat.GetVector( "WaveSpeed" ); + float waveScale = mat.GetFloat( "_WaveScale" ); + Vector4 waveScale4 = new Vector4(waveScale, waveScale, waveScale * 0.4f, waveScale * 0.45f); + + // Time since level load, and do intermediate calculations with doubles + double t = Time.timeSinceLevelLoad / 20.0; + Vector4 offsetClamped = new Vector4( + (float)System.Math.IEEERemainder(waveSpeed.x * waveScale4.x * t, 1.0), + (float)System.Math.IEEERemainder(waveSpeed.y * waveScale4.y * t, 1.0), + (float)System.Math.IEEERemainder(waveSpeed.z * waveScale4.z * t, 1.0), + (float)System.Math.IEEERemainder(waveSpeed.w * waveScale4.w * t, 1.0) + ); + + mat.SetVector( "_WaveOffset", offsetClamped ); + mat.SetVector( "_WaveScale4", waveScale4 ); + + Vector3 waterSize = renderer.bounds.size; + Vector3 scale = new Vector3( waterSize.x*waveScale4.x, waterSize.z*waveScale4.y, 1 ); + Matrix4x4 scrollMatrix = Matrix4x4.TRS( new Vector3(offsetClamped.x,offsetClamped.y,0), Quaternion.identity, scale ); + mat.SetMatrix( "_WaveMatrix", scrollMatrix ); + + scale = new Vector3( waterSize.x*waveScale4.z, waterSize.z*waveScale4.w, 1 ); + scrollMatrix = Matrix4x4.TRS( new Vector3(offsetClamped.z,offsetClamped.w,0), Quaternion.identity, scale ); + mat.SetMatrix( "_WaveMatrix2", scrollMatrix ); + } + + private void UpdateCameraModes( Camera src, Camera dest ) + { + if( dest == null ) + return; + // set water camera to clear the same way as current camera + dest.clearFlags = src.clearFlags; + dest.backgroundColor = src.backgroundColor; + if( src.clearFlags == CameraClearFlags.Skybox ) + { + Skybox sky = src.GetComponent(typeof(Skybox)) as Skybox; + Skybox mysky = dest.GetComponent(typeof(Skybox)) as Skybox; + if( !sky || !sky.material ) + { + mysky.enabled = false; + } + else + { + mysky.enabled = true; + mysky.material = sky.material; + } + } + // update other values to match current camera. + // even if we are supplying custom camera&projection matrices, + // some of values are used elsewhere (e.g. skybox uses far plane) + dest.farClipPlane = src.farClipPlane; + dest.nearClipPlane = src.nearClipPlane; + dest.orthographic = src.orthographic; + dest.fieldOfView = src.fieldOfView; + dest.aspect = src.aspect; + dest.orthographicSize = src.orthographicSize; + } + + // On-demand create any objects we need for water + private void CreateWaterObjects( Camera currentCamera, out Camera reflectionCamera, out Camera refractionCamera ) + { + WaterMode mode = GetWaterMode(); + + reflectionCamera = null; + refractionCamera = null; + + if( mode >= WaterMode.Reflective ) + { + // Reflection render texture + if( !m_ReflectionTexture || m_OldReflectionTextureSize != m_TextureSize ) + { + if( m_ReflectionTexture ) + DestroyImmediate( m_ReflectionTexture ); + m_ReflectionTexture = new RenderTexture( m_TextureSize, m_TextureSize, 16 ); + m_ReflectionTexture.name = "__WaterReflection" + GetInstanceID(); + m_ReflectionTexture.isPowerOfTwo = true; + m_ReflectionTexture.hideFlags = HideFlags.DontSave; + m_OldReflectionTextureSize = m_TextureSize; + } + + // Camera for reflection + m_ReflectionCameras.TryGetValue(currentCamera, out reflectionCamera); + if (!reflectionCamera) // catch both not-in-dictionary and in-dictionary-but-deleted-GO + { + GameObject go = new GameObject( "Water Refl Camera id" + GetInstanceID() + " for " + currentCamera.GetInstanceID(), typeof(Camera), typeof(Skybox) ); + reflectionCamera = go.camera; + reflectionCamera.enabled = false; + reflectionCamera.transform.position = transform.position; + reflectionCamera.transform.rotation = transform.rotation; + reflectionCamera.gameObject.AddComponent("FlareLayer"); + go.hideFlags = HideFlags.HideAndDontSave; + m_ReflectionCameras[currentCamera] = reflectionCamera; + } + } + + if( mode >= WaterMode.Refractive ) + { + // Refraction render texture + if( !m_RefractionTexture || m_OldRefractionTextureSize != m_TextureSize ) + { + if( m_RefractionTexture ) + DestroyImmediate( m_RefractionTexture ); + m_RefractionTexture = new RenderTexture( m_TextureSize, m_TextureSize, 16 ); + m_RefractionTexture.name = "__WaterRefraction" + GetInstanceID(); + m_RefractionTexture.isPowerOfTwo = true; + m_RefractionTexture.hideFlags = HideFlags.DontSave; + m_OldRefractionTextureSize = m_TextureSize; + } + + // Camera for refraction + m_RefractionCameras.TryGetValue(currentCamera, out refractionCamera); + if (!refractionCamera) // catch both not-in-dictionary and in-dictionary-but-deleted-GO + { + GameObject go = new GameObject( "Water Refr Camera id" + GetInstanceID() + " for " + currentCamera.GetInstanceID(), typeof(Camera), typeof(Skybox) ); + refractionCamera = go.camera; + refractionCamera.enabled = false; + refractionCamera.transform.position = transform.position; + refractionCamera.transform.rotation = transform.rotation; + refractionCamera.gameObject.AddComponent("FlareLayer"); + go.hideFlags = HideFlags.HideAndDontSave; + m_RefractionCameras[currentCamera] = refractionCamera; + } + } + } + + private WaterMode GetWaterMode() + { + if( m_HardwareWaterSupport < m_WaterMode ) + return m_HardwareWaterSupport; + else + return m_WaterMode; + } + + private WaterMode FindHardwareWaterSupport() + { + if( !SystemInfo.supportsRenderTextures || !renderer ) + return WaterMode.Simple; + + Material mat = renderer.sharedMaterial; + if( !mat ) + return WaterMode.Simple; + + string mode = mat.GetTag("WATERMODE", false); + if( mode == "Refractive" ) + return WaterMode.Refractive; + if( mode == "Reflective" ) + return WaterMode.Reflective; + + return WaterMode.Simple; + } + + // Extended sign: returns -1, 0 or 1 based on sign of a + private static float sgn(float a) + { + if (a > 0.0f) return 1.0f; + if (a < 0.0f) return -1.0f; + return 0.0f; + } + + // Given position/normal of the plane, calculates plane in camera space. + private Vector4 CameraSpacePlane (Camera cam, Vector3 pos, Vector3 normal, float sideSign) + { + Vector3 offsetPos = pos + normal * m_ClipPlaneOffset; + Matrix4x4 m = cam.worldToCameraMatrix; + Vector3 cpos = m.MultiplyPoint( offsetPos ); + Vector3 cnormal = m.MultiplyVector( normal ).normalized * sideSign; + return new Vector4( cnormal.x, cnormal.y, cnormal.z, -Vector3.Dot(cpos,cnormal) ); + } + + // Calculates reflection matrix around the given plane + private static void CalculateReflectionMatrix (ref Matrix4x4 reflectionMat, Vector4 plane) + { + reflectionMat.m00 = (1F - 2F*plane[0]*plane[0]); + reflectionMat.m01 = ( - 2F*plane[0]*plane[1]); + reflectionMat.m02 = ( - 2F*plane[0]*plane[2]); + reflectionMat.m03 = ( - 2F*plane[3]*plane[0]); + + reflectionMat.m10 = ( - 2F*plane[1]*plane[0]); + reflectionMat.m11 = (1F - 2F*plane[1]*plane[1]); + reflectionMat.m12 = ( - 2F*plane[1]*plane[2]); + reflectionMat.m13 = ( - 2F*plane[3]*plane[1]); + + reflectionMat.m20 = ( - 2F*plane[2]*plane[0]); + reflectionMat.m21 = ( - 2F*plane[2]*plane[1]); + reflectionMat.m22 = (1F - 2F*plane[2]*plane[2]); + reflectionMat.m23 = ( - 2F*plane[3]*plane[2]); + + reflectionMat.m30 = 0F; + reflectionMat.m31 = 0F; + reflectionMat.m32 = 0F; + reflectionMat.m33 = 1F; + } +} diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Scripts/Water.cs.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Scripts/Water.cs.meta new file mode 100644 index 0000000..1517591 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Scripts/Water.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a3d3ef1a5bbfb4e0a910fbbe5830b1f9 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Shaders.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Shaders.meta new file mode 100644 index 0000000..f6d54ca --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Shaders.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: e70b47c0cfc1d4b12a3c663d7582a523 +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Shaders/FX-Water.shader b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Shaders/FX-Water.shader new file mode 100644 index 0000000..074ab95 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Shaders/FX-Water.shader @@ -0,0 +1,211 @@ +Shader "FX/Water" { +Properties { + _WaveScale ("Wave scale", Range (0.02,0.15)) = 0.063 + _ReflDistort ("Reflection distort", Range (0,1.5)) = 0.44 + _RefrDistort ("Refraction distort", Range (0,1.5)) = 0.40 + _RefrColor ("Refraction color", COLOR) = ( .34, .85, .92, 1) + _Fresnel ("Fresnel (A) ", 2D) = "gray" {} + _BumpMap ("Normalmap ", 2D) = "bump" {} + WaveSpeed ("Wave speed (map1 x,y; map2 x,y)", Vector) = (19,9,-16,-7) + _ReflectiveColor ("Reflective color (RGB) fresnel (A) ", 2D) = "" {} + _ReflectiveColorCube ("Reflective color cube (RGB) fresnel (A)", Cube) = "" { TexGen CubeReflect } + _HorizonColor ("Simple water horizon color", COLOR) = ( .172, .463, .435, 1) + _MainTex ("Fallback texture", 2D) = "" {} + _ReflectionTex ("Internal Reflection", 2D) = "" {} + _RefractionTex ("Internal Refraction", 2D) = "" {} +} + + +// ----------------------------------------------------------- +// Fragment program cards + + +Subshader { + Tags { "WaterMode"="Refractive" "RenderType"="Opaque" } + Pass { +CGPROGRAM +#pragma vertex vert +#pragma fragment frag +#pragma fragmentoption ARB_precision_hint_fastest +#pragma multi_compile WATER_REFRACTIVE WATER_REFLECTIVE WATER_SIMPLE + +#if defined (WATER_REFLECTIVE) || defined (WATER_REFRACTIVE) +#define HAS_REFLECTION 1 +#endif +#if defined (WATER_REFRACTIVE) +#define HAS_REFRACTION 1 +#endif + + +#include "UnityCG.cginc" + +uniform float4 _WaveScale4; +uniform float4 _WaveOffset; + +#if HAS_REFLECTION +uniform float _ReflDistort; +#endif +#if HAS_REFRACTION +uniform float _RefrDistort; +#endif + +struct appdata { + float4 vertex : POSITION; + float3 normal : NORMAL; +}; + +struct v2f { + float4 pos : SV_POSITION; + #if defined(HAS_REFLECTION) || defined(HAS_REFRACTION) + float4 ref : TEXCOORD0; + float2 bumpuv0 : TEXCOORD1; + float2 bumpuv1 : TEXCOORD2; + float3 viewDir : TEXCOORD3; + #else + float2 bumpuv0 : TEXCOORD0; + float2 bumpuv1 : TEXCOORD1; + float3 viewDir : TEXCOORD2; + #endif + +}; + +v2f vert(appdata v) +{ + v2f o; + o.pos = mul (UNITY_MATRIX_MVP, v.vertex); + + // scroll bump waves + float4 temp; + temp.xyzw = v.vertex.xzxz * _WaveScale4 / unity_Scale.w + _WaveOffset; + o.bumpuv0 = temp.xy; + o.bumpuv1 = temp.wz; + + // object space view direction (will normalize per pixel) + o.viewDir.xzy = ObjSpaceViewDir(v.vertex); + + #if defined(HAS_REFLECTION) || defined(HAS_REFRACTION) + o.ref = ComputeScreenPos(o.pos); + #endif + + return o; +} + +#if defined (WATER_REFLECTIVE) || defined (WATER_REFRACTIVE) +sampler2D _ReflectionTex; +#endif +#if defined (WATER_REFLECTIVE) || defined (WATER_SIMPLE) +sampler2D _ReflectiveColor; +#endif +#if defined (WATER_REFRACTIVE) +sampler2D _Fresnel; +sampler2D _RefractionTex; +uniform float4 _RefrColor; +#endif +#if defined (WATER_SIMPLE) +uniform float4 _HorizonColor; +#endif +sampler2D _BumpMap; + +half4 frag( v2f i ) : SV_Target +{ + i.viewDir = normalize(i.viewDir); + + // combine two scrolling bumpmaps into one + half3 bump1 = UnpackNormal(tex2D( _BumpMap, i.bumpuv0 )).rgb; + half3 bump2 = UnpackNormal(tex2D( _BumpMap, i.bumpuv1 )).rgb; + half3 bump = (bump1 + bump2) * 0.5; + + // fresnel factor + half fresnelFac = dot( i.viewDir, bump ); + + // perturb reflection/refraction UVs by bumpmap, and lookup colors + + #if HAS_REFLECTION + float4 uv1 = i.ref; uv1.xy += bump * _ReflDistort; + half4 refl = tex2Dproj( _ReflectionTex, UNITY_PROJ_COORD(uv1) ); + #endif + #if HAS_REFRACTION + float4 uv2 = i.ref; uv2.xy -= bump * _RefrDistort; + half4 refr = tex2Dproj( _RefractionTex, UNITY_PROJ_COORD(uv2) ) * _RefrColor; + #endif + + // final color is between refracted and reflected based on fresnel + half4 color; + + #if defined(WATER_REFRACTIVE) + half fresnel = UNITY_SAMPLE_1CHANNEL( _Fresnel, float2(fresnelFac,fresnelFac) ); + color = lerp( refr, refl, fresnel ); + #endif + + #if defined(WATER_REFLECTIVE) + half4 water = tex2D( _ReflectiveColor, float2(fresnelFac,fresnelFac) ); + color.rgb = lerp( water.rgb, refl.rgb, water.a ); + color.a = refl.a * water.a; + #endif + + #if defined(WATER_SIMPLE) + half4 water = tex2D( _ReflectiveColor, float2(fresnelFac,fresnelFac) ); + color.rgb = lerp( water.rgb, _HorizonColor.rgb, water.a ); + color.a = _HorizonColor.a; + #endif + + return color; +} +ENDCG + + } +} + +// ----------------------------------------------------------- +// Old cards + +// three texture, cubemaps +Subshader { + Tags { "WaterMode"="Simple" "RenderType"="Opaque" } + Pass { + Color (0.5,0.5,0.5,0.5) + SetTexture [_MainTex] { + Matrix [_WaveMatrix] + combine texture * primary + } + SetTexture [_MainTex] { + Matrix [_WaveMatrix2] + combine texture * primary + previous + } + SetTexture [_ReflectiveColorCube] { + combine texture +- previous, primary + Matrix [_Reflection] + } + } +} + +// dual texture, cubemaps +Subshader { + Tags { "WaterMode"="Simple" "RenderType"="Opaque" } + Pass { + Color (0.5,0.5,0.5,0.5) + SetTexture [_MainTex] { + Matrix [_WaveMatrix] + combine texture + } + SetTexture [_ReflectiveColorCube] { + combine texture +- previous, primary + Matrix [_Reflection] + } + } +} + +// single texture +Subshader { + Tags { "WaterMode"="Simple" "RenderType"="Opaque" } + Pass { + Color (0.5,0.5,0.5,0) + SetTexture [_MainTex] { + Matrix [_WaveMatrix] + combine texture, primary + } + } +} + + +} diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Shaders/FX-Water.shader.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Shaders/FX-Water.shader.meta new file mode 100644 index 0000000..f07b540 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Shaders/FX-Water.shader.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 1cac2e0bcc34e4b3cbb4bd85982eba83 +ShaderImporter: + defaultTextures: [] + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures.meta new file mode 100644 index 0000000..fcbb7a3 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: c22094bc116524b2a95c9aae09278b22 +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/Water Fresnel.psd b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/Water Fresnel.psd new file mode 100644 index 0000000..3ddb225 Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/Water Fresnel.psd differ diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/Water Fresnel.psd.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/Water Fresnel.psd.meta new file mode 100644 index 0000000..73ff846 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/Water Fresnel.psd.meta @@ -0,0 +1,47 @@ +fileFormatVersion: 2 +guid: 5b5c5575fd4c74abd9f7b30862fb76a3 +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 2 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 1024 + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapMode: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/Water fallback.jpg b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/Water fallback.jpg new file mode 100644 index 0000000..0334b7a Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/Water fallback.jpg differ diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/Water fallback.jpg.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/Water fallback.jpg.meta new file mode 100644 index 0000000..ad09131 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/Water fallback.jpg.meta @@ -0,0 +1,47 @@ +fileFormatVersion: 2 +guid: e6f8288974c664a309d6c66de636978c +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 2 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 512 + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapMode: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: 0 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/Waterbump.jpg b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/Waterbump.jpg new file mode 100644 index 0000000..9cbd3de Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/Waterbump.jpg differ diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/Waterbump.jpg.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/Waterbump.jpg.meta new file mode 100644 index 0000000..d454458 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/Waterbump.jpg.meta @@ -0,0 +1,47 @@ +fileFormatVersion: 2 +guid: 2dd3788f8589b40bf82a92d76ffc5091 +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 2 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 1 + externalNormalMap: 1 + heightScale: .0164516103 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 512 + textureSettings: + filterMode: 1 + aniso: 3 + mipBias: 0 + wrapMode: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: 1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/nightgradient cubemap.psd b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/nightgradient cubemap.psd new file mode 100644 index 0000000..b695f21 Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/nightgradient cubemap.psd differ diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/nightgradient cubemap.psd.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/nightgradient cubemap.psd.meta new file mode 100644 index 0000000..c3e5579 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/nightgradient cubemap.psd.meta @@ -0,0 +1,48 @@ +fileFormatVersion: 2 +guid: 15c6acc4f11254a04b03849245d80574 +TextureImporter: + fileIDToRecycleName: + 8900000: generatedCubemap + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 2 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .100000001 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 3 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 32 + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapMode: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/nightgradient.psd b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/nightgradient.psd new file mode 100644 index 0000000..d853a2b Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/nightgradient.psd differ diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/nightgradient.psd.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/nightgradient.psd.meta new file mode 100644 index 0000000..8b60fb3 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/nightgradient.psd.meta @@ -0,0 +1,47 @@ +fileFormatVersion: 2 +guid: b725b62cfc9d04e4886735ab2a8107d1 +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 2 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .100000001 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 32 + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapMode: 1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: 0 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/oceangradient.psd b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/oceangradient.psd new file mode 100644 index 0000000..4469116 Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/oceangradient.psd differ diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/oceangradient.psd.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/oceangradient.psd.meta new file mode 100644 index 0000000..412f852 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/oceangradient.psd.meta @@ -0,0 +1,47 @@ +fileFormatVersion: 2 +guid: 17680dc3bf8f74b498b01cf1481e2593 +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 2 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .100000001 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 32 + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapMode: 1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: 0 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/oceangradientcube.psd b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/oceangradientcube.psd new file mode 100644 index 0000000..07ce19a Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/oceangradientcube.psd differ diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/oceangradientcube.psd.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/oceangradientcube.psd.meta new file mode 100644 index 0000000..044ba3b --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Sources/Textures/oceangradientcube.psd.meta @@ -0,0 +1,48 @@ +fileFormatVersion: 2 +guid: 9cda328e4b6954d70841a8a66f42ec08 +TextureImporter: + fileIDToRecycleName: + 8900000: generatedCubemap + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 2 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .100000001 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 3 + seamlessCubemap: 0 + textureFormat: 12 + maxTextureSize: 32 + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapMode: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4.meta new file mode 100644 index 0000000..edf4cbd --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 17e234879cb994b7f93d7437c10d23d6 +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources.meta new file mode 100644 index 0000000..10788e0 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 7097f369c5ba74821bd76c430889322a +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Materials.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Materials.meta new file mode 100644 index 0000000..235158e --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Materials.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: a771af3b1958445078af5fe2e9ec726c +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Materials/Water4Example.mat b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Materials/Water4Example.mat new file mode 100644 index 0000000..9ba902d Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Materials/Water4Example.mat differ diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Materials/Water4Example.mat.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Materials/Water4Example.mat.meta new file mode 100644 index 0000000..b6e7d19 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Materials/Water4Example.mat.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 4e1467e748fa74c64b96759b3d9713ae +NativeFormatImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Materials/Water4ExampleSimple.mat b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Materials/Water4ExampleSimple.mat new file mode 100644 index 0000000..c5541d5 Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Materials/Water4ExampleSimple.mat differ diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Materials/Water4ExampleSimple.mat.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Materials/Water4ExampleSimple.mat.meta new file mode 100644 index 0000000..6fa73d5 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Materials/Water4ExampleSimple.mat.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 656fde119942645aa8e062e04c119aa1 +NativeFormatImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects.meta new file mode 100644 index 0000000..b211fad --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 6aa58ee2f84094af2846e1a7bb0c23f9 +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects/Materials.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects/Materials.meta new file mode 100644 index 0000000..02193c2 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects/Materials.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 3033e46ab6c9e44a9b9dd0e9f5130357 +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects/Materials/ocean_plane-No Name.mat b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects/Materials/ocean_plane-No Name.mat new file mode 100644 index 0000000..8cba076 Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects/Materials/ocean_plane-No Name.mat differ diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects/Materials/ocean_plane-No Name.mat.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects/Materials/ocean_plane-No Name.mat.meta new file mode 100644 index 0000000..42d90d0 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects/Materials/ocean_plane-No Name.mat.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: eae94293b93a5474d8b82710736a6022 +NativeFormatImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects/ocean_plane.FBX b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects/ocean_plane.FBX new file mode 100644 index 0000000..2825722 Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects/ocean_plane.FBX differ diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects/ocean_plane.FBX.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects/ocean_plane.FBX.meta new file mode 100644 index 0000000..f62ad4e --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects/ocean_plane.FBX.meta @@ -0,0 +1,65 @@ +fileFormatVersion: 2 +guid: 681e41ee1260343b395ca58745c94870 +ModelImporter: + serializedVersion: 16 + fileIDToRecycleName: + 100000: //RootNode + 400000: //RootNode + 2300000: //RootNode + 3300000: //RootNode + 4300000: kraut_plane + 11100000: //RootNode + materials: + importMaterials: 1 + materialName: 3 + materialSearch: 1 + animations: + legacyGenerateAnimations: 3 + bakeSimulation: 0 + optimizeGameObjects: 0 + motionNodeName: + animationCompression: 1 + animationRotationError: .5 + animationPositionError: .5 + animationScaleError: .5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + importBlendShapes: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + optimizeMeshForGPU: 1 + weldVertices: 1 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + tangentSpace: + normalSmoothAngle: 60 + splitTangentsAcrossUV: 1 + normalImportMode: 0 + tangentImportMode: 1 + importAnimation: 1 + copyAvatar: 0 + humanDescription: + human: [] + skeleton: [] + armTwist: .5 + foreArmTwist: .5 + upperLegTwist: .5 + legTwist: .5 + armStretch: .0500000007 + legStretch: .0500000007 + feetSpacing: 0 + rootMotionBoneName: + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 1 + additionalBone: 0 + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects/ocean_plane.mat b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects/ocean_plane.mat new file mode 100644 index 0000000..a125097 Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects/ocean_plane.mat differ diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects/ocean_plane.mat.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects/ocean_plane.mat.meta new file mode 100644 index 0000000..91408d6 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Objects/ocean_plane.mat.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 80dc0f296ac9946ca8fe9c4259b1b229 +NativeFormatImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts.meta new file mode 100644 index 0000000..9660339 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 3bbbb1d2bfc4f43f79f3226bca2d1f64 +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/Displace.cs b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/Displace.cs new file mode 100644 index 0000000..e304482 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/Displace.cs @@ -0,0 +1,39 @@ +using UnityEngine; + +[ExecuteInEditMode] +[RequireComponent(typeof(WaterBase))] + +public class Displace : MonoBehaviour +{ + public void Awake() + { + if (enabled) + OnEnable(); + else + OnDisable(); + } + + public void OnEnable() + { + Shader.EnableKeyword("WATER_VERTEX_DISPLACEMENT_ON"); + Shader.DisableKeyword("WATER_VERTEX_DISPLACEMENT_OFF"); + } + + public void OnDisable() + { + Shader.EnableKeyword("WATER_VERTEX_DISPLACEMENT_OFF"); + Shader.DisableKeyword("WATER_VERTEX_DISPLACEMENT_ON"); + } + + /* + public float GetOffsetAt(Vector3 pos, int displacementMapAmounts = 3) + { + return 0.0f; + } + + public Vector3 GetNormalAt(Vector3 pos, float scale = 1.0F) + { + return Vector3.one; + } + */ +} \ No newline at end of file diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/Displace.cs.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/Displace.cs.meta new file mode 100644 index 0000000..5c22653 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/Displace.cs.meta @@ -0,0 +1,16 @@ +fileFormatVersion: 2 +guid: c62b7d87755b447919138e67f8e22e0c +MonoImporter: + serializedVersion: 2 + defaultReferences: + - displacement2D: {fileID: 2800000, guid: 478fe261b62ca4bd99fb0a88e3bdb7ef, type: 2} + - secondDisplacement2D: {fileID: 2800000, guid: 64cfb2c11a69743638efec3e7f2d370f, + type: 2} + - thirdDisplacement2D: {fileID: 2800000, guid: 9a40d060f6add4542958ee8e54c8f88b, + type: 2} + - firstCompressed: {fileID: 2800000, guid: a782b26d6436b48d9882906b9f8ca31a, type: 2} + - secondCompressed: {fileID: 2800000, guid: 4facc21e08e3a43ed97c930f7dae6e7b, type: 2} + - thirdCompressed: {fileID: 2800000, guid: dc30b984e8e3c4cdfb38d5fceb411602, type: 2} + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/GerstnerDisplace.cs b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/GerstnerDisplace.cs new file mode 100644 index 0000000..5879af1 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/GerstnerDisplace.cs @@ -0,0 +1,9 @@ +using UnityEngine; + +[ExecuteInEditMode] +[RequireComponent(typeof(WaterBase))] + +public class GerstnerDisplace : Displace +{ + +} \ No newline at end of file diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/GerstnerDisplace.cs.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/GerstnerDisplace.cs.meta new file mode 100644 index 0000000..114e81f --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/GerstnerDisplace.cs.meta @@ -0,0 +1,16 @@ +fileFormatVersion: 2 +guid: 42e7f46d0e5a84171a3909479c1646ba +MonoImporter: + serializedVersion: 2 + defaultReferences: + - displacement2D: {fileID: 2800000, guid: 478fe261b62ca4bd99fb0a88e3bdb7ef, type: 2} + - secondDisplacement2D: {fileID: 2800000, guid: 64cfb2c11a69743638efec3e7f2d370f, + type: 2} + - thirdDisplacement2D: {fileID: 2800000, guid: 9a40d060f6add4542958ee8e54c8f88b, + type: 2} + - firstCompressed: {fileID: 2800000, guid: a782b26d6436b48d9882906b9f8ca31a, type: 2} + - secondCompressed: {fileID: 2800000, guid: 4facc21e08e3a43ed97c930f7dae6e7b, type: 2} + - thirdCompressed: {fileID: 2800000, guid: dc30b984e8e3c4cdfb38d5fceb411602, type: 2} + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/MeshContainer.cs b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/MeshContainer.cs new file mode 100644 index 0000000..1232086 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/MeshContainer.cs @@ -0,0 +1,19 @@ +using UnityEngine; + +public class MeshContainer +{ + public Mesh mesh; + public Vector3[] vertices; + public Vector3[] normals; + + public MeshContainer(Mesh m) { + mesh = m; + vertices = m.vertices; + normals = m.normals; + } + + public void Update() { + mesh.vertices = vertices; + mesh.normals = normals; + } +} \ No newline at end of file diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/MeshContainer.cs.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/MeshContainer.cs.meta new file mode 100644 index 0000000..5b996ca --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/MeshContainer.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 951d74f7d57bed84cb623c62436bd064 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/PlanarReflection.cs b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/PlanarReflection.cs new file mode 100644 index 0000000..a345627 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/PlanarReflection.cs @@ -0,0 +1,222 @@ + +using UnityEngine; +using System.Collections; +using System.Collections.Generic; + +[ExecuteInEditMode] +[RequireComponent(typeof(WaterBase))] +public class PlanarReflection : MonoBehaviour +{ + // reflection + public LayerMask reflectionMask; + public bool reflectSkybox = false; + public Color clearColor = Color.grey; + public System.String reflectionSampler = "_ReflectionTex"; + + // height + public float clipPlaneOffset = 0.07F; + + private Vector3 oldpos = Vector3.zero; + private Camera reflectionCamera; + private Material sharedMaterial = null; + private Dictionary helperCameras = null; + + public void Start () + { + sharedMaterial = ((WaterBase)gameObject.GetComponent(typeof(WaterBase))).sharedMaterial; + } + + private Camera CreateReflectionCameraFor(Camera cam) + { + System.String reflName = gameObject.name+"Reflection"+cam.name; + GameObject go = GameObject.Find(reflName); + + if(!go) + go = new GameObject(reflName, typeof(Camera)); + if(!go.GetComponent(typeof(Camera))) + go.AddComponent(typeof(Camera)); + Camera reflectCamera = go.camera; + + reflectCamera.backgroundColor = clearColor; + reflectCamera.clearFlags = reflectSkybox ? CameraClearFlags.Skybox : CameraClearFlags.SolidColor; + + SetStandardCameraParameter(reflectCamera,reflectionMask); + + if(!reflectCamera.targetTexture) + reflectCamera.targetTexture = CreateTextureFor(cam); + + return reflectCamera; + } + + private void SetStandardCameraParameter(Camera cam, LayerMask mask) + { + cam.cullingMask = mask & ~(1<(); + + if(!helperCameras.ContainsKey(currentCam)) { + helperCameras.Add(currentCam, false); + } + if(helperCameras[currentCam]) { + return; + } + + if(!reflectionCamera) + reflectionCamera = CreateReflectionCameraFor(currentCam); + + RenderReflectionFor(currentCam, reflectionCamera); + + helperCameras[currentCam] = true; + } + + public void LateUpdate () + { + if (null != helperCameras) + helperCameras.Clear(); + } + + public void WaterTileBeingRendered (Transform tr, Camera currentCam) + { + RenderHelpCameras(currentCam); + + if(reflectionCamera && sharedMaterial) { + sharedMaterial.SetTexture(reflectionSampler, reflectionCamera.targetTexture); + } + } + + public void OnEnable() + { + Shader.EnableKeyword("WATER_REFLECTIVE"); + Shader.DisableKeyword("WATER_SIMPLE"); + } + + public void OnDisable() + { + Shader.EnableKeyword("WATER_SIMPLE"); + Shader.DisableKeyword("WATER_REFLECTIVE"); + } + + + private void RenderReflectionFor (Camera cam, Camera reflectCamera) + { + if(!reflectCamera) + return; + + if(sharedMaterial && !sharedMaterial.HasProperty(reflectionSampler)) { + return; + } + + reflectCamera.cullingMask = reflectionMask & ~(1< 0.0F) return 1.0F; + if (a < 0.0F) return -1.0F; + return 0.0F; + } + + private Vector4 CameraSpacePlane (Camera cam, Vector3 pos, Vector3 normal, float sideSign) + { + Vector3 offsetPos = pos + normal * clipPlaneOffset; + Matrix4x4 m = cam.worldToCameraMatrix; + Vector3 cpos = m.MultiplyPoint (offsetPos); + Vector3 cnormal = m.MultiplyVector (normal).normalized * sideSign; + + return new Vector4 (cnormal.x, cnormal.y, cnormal.z, -Vector3.Dot (cpos,cnormal)); + } +} diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/PlanarReflection.cs.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/PlanarReflection.cs.meta new file mode 100644 index 0000000..154eb21 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/PlanarReflection.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4185bc77c7194462ca3b1097ef4a5de0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/SpecularLighting.cs b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/SpecularLighting.cs new file mode 100644 index 0000000..67be1b8 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/SpecularLighting.cs @@ -0,0 +1,24 @@ +using UnityEngine; + +[RequireComponent(typeof(WaterBase))] +[ExecuteInEditMode] +public class SpecularLighting : MonoBehaviour +{ + public Transform specularLight; + private WaterBase waterBase = null; + + public void Start () + { + waterBase = (WaterBase)gameObject.GetComponent(typeof(WaterBase)); + } + + public void Update () + { + if (!waterBase) + waterBase = (WaterBase)gameObject.GetComponent(typeof(WaterBase)); + + if (specularLight && waterBase.sharedMaterial) + waterBase.sharedMaterial.SetVector("_WorldLightDir", specularLight.transform.forward); + } + +} diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/SpecularLighting.cs.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/SpecularLighting.cs.meta new file mode 100644 index 0000000..1e4cd42 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/SpecularLighting.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: de2ab2b9ac93bb544b9552e49030371b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/WaterBase.cs b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/WaterBase.cs new file mode 100644 index 0000000..b353ecf --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/WaterBase.cs @@ -0,0 +1,56 @@ +using UnityEngine; + +public enum WaterQuality { + High = 2, + Medium = 1, + Low = 0, +} + +[ExecuteInEditMode] +public class WaterBase : MonoBehaviour +{ + public Material sharedMaterial; + public WaterQuality waterQuality = WaterQuality.High; + public bool edgeBlend = true; + + public void UpdateShader() + { + if(waterQuality > WaterQuality.Medium) + sharedMaterial.shader.maximumLOD = 501; + else if(waterQuality> WaterQuality.Low) + sharedMaterial.shader.maximumLOD = 301; + else + sharedMaterial.shader.maximumLOD = 201; + + // If the system does not support depth textures (ie. NaCl), turn off edge bleeding, + // as the shader will render everything as transparent if the depth texture is not valid. + if (!SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.Depth)) + edgeBlend = false; + + if(edgeBlend) + { + Shader.EnableKeyword("WATER_EDGEBLEND_ON"); + Shader.DisableKeyword("WATER_EDGEBLEND_OFF"); + // just to make sure (some peeps might forget to add a water tile to the patches) + if (Camera.main) + Camera.main.depthTextureMode |= DepthTextureMode.Depth; + } + else + { + Shader.EnableKeyword("WATER_EDGEBLEND_OFF"); + Shader.DisableKeyword("WATER_EDGEBLEND_ON"); + } + } + + public void WaterTileBeingRendered (Transform tr, Camera currentCam) + { + if (currentCam && edgeBlend) + currentCam.depthTextureMode |= DepthTextureMode.Depth; + } + + public void Update () + { + if(sharedMaterial) + UpdateShader(); + } +} \ No newline at end of file diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/WaterBase.cs.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/WaterBase.cs.meta new file mode 100644 index 0000000..bbc0ce0 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/WaterBase.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a1da353243062479a9b31c85074a796b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/WaterTile.cs b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/WaterTile.cs new file mode 100644 index 0000000..9350cfd --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/WaterTile.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +[ExecuteInEditMode] +public class WaterTile : MonoBehaviour +{ + public PlanarReflection reflection; + public WaterBase waterBase; + + public void Start () + { + AcquireComponents(); + } + + private void AcquireComponents() + { + if (!reflection) { + if (transform.parent) + reflection = (PlanarReflection)transform.parent.GetComponent(); + else + reflection = (PlanarReflection)transform.GetComponent(); + } + + if (!waterBase) { + if (transform.parent) + waterBase = (WaterBase)transform.parent.GetComponent(); + else + waterBase = (WaterBase)transform.GetComponent(); + } + } + +#if UNITY_EDITOR + public void Update () + { + AcquireComponents(); + } +#endif + + public void OnWillRenderObject() + { + if (reflection) + reflection.WaterTileBeingRendered(transform, Camera.current); + if (waterBase) + waterBase.WaterTileBeingRendered(transform, Camera.current); + } +} diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/WaterTile.cs.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/WaterTile.cs.meta new file mode 100644 index 0000000..a2bf18c --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Scripts/WaterTile.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2a91e8dd37cdd41efb4859b65aced7a2 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Shaders.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Shaders.meta new file mode 100644 index 0000000..d42a7b9 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Shaders.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 2c538784885b34a5987ed9f6651d9ecd +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Shaders/FX-SimpleWater4.shader b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Shaders/FX-SimpleWater4.shader new file mode 100644 index 0000000..2338211 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Shaders/FX-SimpleWater4.shader @@ -0,0 +1,429 @@ +Shader "FX/SimpleWater4" { +Properties { + _ReflectionTex ("Internal reflection", 2D) = "white" {} + + _MainTex ("Fallback texture", 2D) = "black" {} + _BumpMap ("Normals ", 2D) = "bump" {} + + _DistortParams ("Distortions (Bump waves, Reflection, Fresnel power, Fresnel bias)", Vector) = (1.0 ,1.0, 2.0, 1.15) + _InvFadeParemeter ("Auto blend parameter (Edge, Shore, Distance scale)", Vector) = (0.15 ,0.15, 0.5, 1.0) + + _AnimationTiling ("Animation Tiling (Displacement)", Vector) = (2.2 ,2.2, -1.1, -1.1) + _AnimationDirection ("Animation Direction (displacement)", Vector) = (1.0 ,1.0, 1.0, 1.0) + + _BumpTiling ("Bump Tiling", Vector) = (1.0 ,1.0, -2.0, 3.0) + _BumpDirection ("Bump Direction & Speed", Vector) = (1.0 ,1.0, -1.0, 1.0) + + _FresnelScale ("FresnelScale", Range (0.15, 4.0)) = 0.75 + + _BaseColor ("Base color", COLOR) = ( .54, .95, .99, 0.5) + _ReflectionColor ("Reflection color", COLOR) = ( .54, .95, .99, 0.5) + _SpecularColor ("Specular color", COLOR) = ( .72, .72, .72, 1) + + _WorldLightDir ("Specular light direction", Vector) = (0.0, 0.1, -0.5, 0.0) + _Shininess ("Shininess", Range (2.0, 500.0)) = 200.0 + + _GerstnerIntensity("Per vertex displacement", Float) = 1.0 + _GAmplitude ("Wave Amplitude", Vector) = (0.3 ,0.35, 0.25, 0.25) + _GFrequency ("Wave Frequency", Vector) = (1.3, 1.35, 1.25, 1.25) + _GSteepness ("Wave Steepness", Vector) = (1.0, 1.0, 1.0, 1.0) + _GSpeed ("Wave Speed", Vector) = (1.2, 1.375, 1.1, 1.5) + _GDirectionAB ("Wave Direction", Vector) = (0.3 ,0.85, 0.85, 0.25) + _GDirectionCD ("Wave Direction", Vector) = (0.1 ,0.9, 0.5, 0.5) +} + + +CGINCLUDE + + #include "UnityCG.cginc" + #include "WaterInclude.cginc" + + struct appdata + { + float4 vertex : POSITION; + float3 normal : NORMAL; + }; + + // interpolator structs + + struct v2f + { + float4 pos : SV_POSITION; + float4 normalInterpolator : TEXCOORD0; + float3 viewInterpolator : TEXCOORD1; + float4 bumpCoords : TEXCOORD2; + float4 screenPos : TEXCOORD3; + float4 grabPassPos : TEXCOORD4; + }; + + struct v2f_noGrab + { + float4 pos : SV_POSITION; + float4 normalInterpolator : TEXCOORD0; + float3 viewInterpolator : TEXCOORD1; + float4 bumpCoords : TEXCOORD2; + float4 screenPos : TEXCOORD3; + }; + + struct v2f_simple + { + float4 pos : SV_POSITION; + float3 viewInterpolator : TEXCOORD0; + float4 bumpCoords : TEXCOORD1; + }; + + // textures + sampler2D _BumpMap; + sampler2D _ReflectionTex; + sampler2D _RefractionTex; + sampler2D _ShoreTex; + sampler2D_float _CameraDepthTexture; + + // colors in use + uniform float4 _RefrColorDepth; + uniform float4 _SpecularColor; + uniform float4 _BaseColor; + uniform float4 _ReflectionColor; + + // edge & shore fading + uniform float4 _InvFadeParemeter; + + // specularity + uniform float _Shininess; + uniform float4 _WorldLightDir; + + // fresnel, vertex & bump displacements & strength + uniform float4 _DistortParams; + uniform float _FresnelScale; + uniform float4 _BumpTiling; + uniform float4 _BumpDirection; + + uniform float4 _GAmplitude; + uniform float4 _GFrequency; + uniform float4 _GSteepness; + uniform float4 _GSpeed; + uniform float4 _GDirectionAB; + uniform float4 _GDirectionCD; + + // shortcuts + #define PER_PIXEL_DISPLACE _DistortParams.x + #define REALTIME_DISTORTION _DistortParams.y + #define FRESNEL_POWER _DistortParams.z + #define VERTEX_WORLD_NORMAL i.normalInterpolator.xyz + #define DISTANCE_SCALE _InvFadeParemeter.z + #define FRESNEL_BIAS _DistortParams.w + + // + // HQ VERSION + // + + v2f vert(appdata_full v) + { + v2f o; + + half3 worldSpaceVertex = mul(_Object2World,(v.vertex)).xyz; + half3 vtxForAni = (worldSpaceVertex).xzz * unity_Scale.w; + + half3 nrml; + half3 offsets; + + Gerstner ( + offsets, nrml, v.vertex.xyz, vtxForAni, // offsets, nrml will be written + _GAmplitude, // amplitude + _GFrequency, // frequency + _GSteepness, // steepness + _GSpeed, // speed + _GDirectionAB, // direction # 1, 2 + _GDirectionCD // direction # 3, 4 + ); + + v.vertex.xyz += offsets; + + half2 tileableUv = worldSpaceVertex.xz; + + o.bumpCoords.xyzw = (tileableUv.xyxy + _Time.xxxx * _BumpDirection.xyzw) * _BumpTiling.xyzw; + + o.viewInterpolator.xyz = worldSpaceVertex - _WorldSpaceCameraPos; + + o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + + ComputeScreenAndGrabPassPos(o.pos, o.screenPos, o.grabPassPos); + + o.normalInterpolator.xyz = nrml; + + o.normalInterpolator.w = 1;//GetDistanceFadeout(o.screenPos.w, DISTANCE_SCALE); + + return o; + } + + half4 frag( v2f i ) : SV_Target + { + half3 worldNormal = PerPixelNormal(_BumpMap, i.bumpCoords, VERTEX_WORLD_NORMAL, PER_PIXEL_DISPLACE); + half3 viewVector = normalize(i.viewInterpolator.xyz); + + half4 distortOffset = half4(worldNormal.xz * REALTIME_DISTORTION * 10.0, 0, 0); + half4 screenWithOffset = i.screenPos + distortOffset; + half4 grabWithOffset = i.grabPassPos + distortOffset; + + half4 rtRefractionsNoDistort = tex2Dproj(_RefractionTex, UNITY_PROJ_COORD(i.grabPassPos)); + half refrFix = SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(grabWithOffset)); + half4 rtRefractions = tex2Dproj(_RefractionTex, UNITY_PROJ_COORD(grabWithOffset)); + + #ifdef WATER_REFLECTIVE + half4 rtReflections = tex2Dproj(_ReflectionTex, UNITY_PROJ_COORD(screenWithOffset)); + #endif + + #ifdef WATER_EDGEBLEND_ON + if (LinearEyeDepth(refrFix) < i.screenPos.z) + rtRefractions = rtRefractionsNoDistort; + #endif + + half3 reflectVector = normalize(reflect(viewVector, worldNormal)); + half3 h = normalize ((_WorldLightDir.xyz) + viewVector.xyz); + float nh = max (0, dot (worldNormal, -h)); + float spec = max(0.0,pow (nh, _Shininess)); + + half4 edgeBlendFactors = half4(1.0, 0.0, 0.0, 0.0); + + #ifdef WATER_EDGEBLEND_ON + half depth = SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.screenPos)); + depth = LinearEyeDepth(depth); + edgeBlendFactors = saturate(_InvFadeParemeter * (depth-i.screenPos.w)); + #endif + + // shading for fresnel term + worldNormal.xz *= _FresnelScale; + half refl2Refr = Fresnel(viewVector, worldNormal, FRESNEL_BIAS, FRESNEL_POWER); + + // base, depth & reflection colors + half4 baseColor = _BaseColor; + #ifdef WATER_REFLECTIVE + half4 reflectionColor = lerp (rtReflections,_ReflectionColor,_ReflectionColor.a); + #else + half4 reflectionColor = _ReflectionColor; + #endif + + baseColor = lerp (lerp (rtRefractions, baseColor, baseColor.a), reflectionColor, refl2Refr); + baseColor = baseColor + spec * _SpecularColor; + + baseColor.a = edgeBlendFactors.x; + return baseColor; + } + + // + // MQ VERSION + // + + v2f_noGrab vert300(appdata_full v) + { + v2f_noGrab o; + + half3 worldSpaceVertex = mul(_Object2World,(v.vertex)).xyz; + half3 vtxForAni = (worldSpaceVertex).xzz * unity_Scale.w; + + half3 nrml; + half3 offsets; + Gerstner ( + offsets, nrml, v.vertex.xyz, vtxForAni, // offsets, nrml will be written + _GAmplitude, // amplitude + _GFrequency, // frequency + _GSteepness, // steepness + _GSpeed, // speed + _GDirectionAB, // direction # 1, 2 + _GDirectionCD // direction # 3, 4 + ); + + v.vertex.xyz += offsets; + + half2 tileableUv = worldSpaceVertex.xz; + + o.bumpCoords.xyzw = (tileableUv.xyxy + _Time.xxxx * _BumpDirection.xyzw) * _BumpTiling.xyzw; + + o.viewInterpolator.xyz = worldSpaceVertex - _WorldSpaceCameraPos; + + o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + + o.screenPos = ComputeScreenPos(o.pos); + + o.normalInterpolator.xyz = nrml; + + o.normalInterpolator.w = 1;//GetDistanceFadeout(o.screenPos.w, DISTANCE_SCALE); + + return o; + } + + half4 frag300( v2f_noGrab i ) : SV_Target + { + half3 worldNormal = PerPixelNormal(_BumpMap, i.bumpCoords, VERTEX_WORLD_NORMAL, PER_PIXEL_DISPLACE); + half3 viewVector = normalize(i.viewInterpolator.xyz); + + half4 distortOffset = half4(worldNormal.xz * REALTIME_DISTORTION * 10.0, 0, 0); + half4 screenWithOffset = i.screenPos + distortOffset; + + #ifdef WATER_REFLECTIVE + half4 rtReflections = tex2Dproj(_ReflectionTex, UNITY_PROJ_COORD(screenWithOffset)); + #endif + + half3 reflectVector = normalize(reflect(viewVector, worldNormal)); + half3 h = normalize (_WorldLightDir.xyz + viewVector.xyz); + float nh = max (0, dot (worldNormal, -h)); + float spec = max(0.0,pow (nh, _Shininess)); + + half4 edgeBlendFactors = half4(1.0, 0.0, 0.0, 0.0); + + #ifdef WATER_EDGEBLEND_ON + half depth = SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.screenPos)); + depth = LinearEyeDepth(depth); + edgeBlendFactors = saturate(_InvFadeParemeter * (depth-i.screenPos.z)); + #endif + + worldNormal.xz *= _FresnelScale; + half refl2Refr = Fresnel(viewVector, worldNormal, FRESNEL_BIAS, FRESNEL_POWER); + + half4 baseColor = _BaseColor; + #ifdef WATER_REFLECTIVE + baseColor = lerp (baseColor, lerp (rtReflections,_ReflectionColor,_ReflectionColor.a), saturate(refl2Refr * 1.0)); + #else + baseColor = _ReflectionColor;//lerp (baseColor, _ReflectionColor, saturate(refl2Refr * 2.0)); + #endif + + baseColor = baseColor + spec * _SpecularColor; + + baseColor.a = edgeBlendFactors.x * saturate(0.5 + refl2Refr * 1.0); + return baseColor; + } + + // + // LQ VERSION + // + + v2f_simple vert200(appdata_full v) + { + v2f_simple o; + + half3 worldSpaceVertex = mul(_Object2World, v.vertex).xyz; + half2 tileableUv = worldSpaceVertex.xz; + + o.bumpCoords.xyzw = (tileableUv.xyxy + _Time.xxxx * _BumpDirection.xyzw) * _BumpTiling.xyzw; + + o.viewInterpolator.xyz = worldSpaceVertex-_WorldSpaceCameraPos; + + o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + + return o; + + } + + half4 frag200( v2f_simple i ) : SV_Target + { + half3 worldNormal = PerPixelNormal(_BumpMap, i.bumpCoords, half3(0,1,0), PER_PIXEL_DISPLACE); + half3 viewVector = normalize(i.viewInterpolator.xyz); + + half3 reflectVector = normalize(reflect(viewVector, worldNormal)); + half3 h = normalize ((_WorldLightDir.xyz) + viewVector.xyz); + float nh = max (0, dot (worldNormal, -h)); + float spec = max(0.0,pow (nh, _Shininess)); + + worldNormal.xz *= _FresnelScale; + half refl2Refr = Fresnel(viewVector, worldNormal, FRESNEL_BIAS, FRESNEL_POWER); + + half4 baseColor = _BaseColor; + baseColor = lerp(baseColor, _ReflectionColor, saturate(refl2Refr * 2.0)); + baseColor.a = saturate(2.0 * refl2Refr + 0.5); + + baseColor.rgb += spec * _SpecularColor.rgb; + return baseColor; + } + +ENDCG + +Subshader +{ + Tags {"RenderType"="Transparent" "Queue"="Transparent"} + + Lod 500 + ColorMask RGB + + GrabPass { "_RefractionTex" } + + Pass { + Blend SrcAlpha OneMinusSrcAlpha + ZTest LEqual + ZWrite Off + Cull Off + + CGPROGRAM + + #pragma target 3.0 + + #pragma vertex vert + #pragma fragment frag + + #pragma glsl + + #pragma fragmentoption ARB_precision_hint_fastest + + #pragma multi_compile WATER_VERTEX_DISPLACEMENT_ON WATER_VERTEX_DISPLACEMENT_OFF + #pragma multi_compile WATER_EDGEBLEND_ON WATER_EDGEBLEND_OFF + #pragma multi_compile WATER_REFLECTIVE WATER_SIMPLE + + ENDCG + } +} + +Subshader +{ + Tags {"RenderType"="Transparent" "Queue"="Transparent"} + + Lod 300 + ColorMask RGB + + Pass { + Blend SrcAlpha OneMinusSrcAlpha + ZTest LEqual + ZWrite Off + Cull Off + + CGPROGRAM + + #pragma target 3.0 + + #pragma vertex vert300 + #pragma fragment frag300 + + #pragma glsl + + #pragma fragmentoption ARB_precision_hint_fastest + #pragma multi_compile WATER_VERTEX_DISPLACEMENT_ON WATER_VERTEX_DISPLACEMENT_OFF + #pragma multi_compile WATER_EDGEBLEND_ON WATER_EDGEBLEND_OFF + #pragma multi_compile WATER_REFLECTIVE WATER_SIMPLE + + ENDCG + } +} + +Subshader +{ + Tags {"RenderType"="Transparent" "Queue"="Transparent"} + + Lod 200 + ColorMask RGB + + Pass { + Blend SrcAlpha OneMinusSrcAlpha + ZTest LEqual + ZWrite Off + Cull Off + + CGPROGRAM + + #pragma vertex vert200 + #pragma fragment frag200 + #pragma fragmentoption ARB_precision_hint_fastest + + ENDCG + } +} + +Fallback "Transparent/Diffuse" +} diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Shaders/FX-SimpleWater4.shader.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Shaders/FX-SimpleWater4.shader.meta new file mode 100644 index 0000000..3bfce86 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Shaders/FX-SimpleWater4.shader.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 8aaff0751054e4a9cb4642d01eaf5be9 +ShaderImporter: + defaultTextures: [] + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Shaders/FX-Water4.shader b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Shaders/FX-Water4.shader new file mode 100644 index 0000000..660f05b --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Shaders/FX-Water4.shader @@ -0,0 +1,444 @@ +Shader "FX/Water4" { +Properties { + _ReflectionTex ("Internal reflection", 2D) = "white" {} + + _MainTex ("Fallback texture", 2D) = "black" {} + _ShoreTex ("Shore & Foam texture ", 2D) = "black" {} + _BumpMap ("Normals ", 2D) = "bump" {} + + _DistortParams ("Distortions (Bump waves, Reflection, Fresnel power, Fresnel bias)", Vector) = (1.0 ,1.0, 2.0, 1.15) + _InvFadeParemeter ("Auto blend parameter (Edge, Shore, Distance scale)", Vector) = (0.15 ,0.15, 0.5, 1.0) + + _AnimationTiling ("Animation Tiling (Displacement)", Vector) = (2.2 ,2.2, -1.1, -1.1) + _AnimationDirection ("Animation Direction (displacement)", Vector) = (1.0 ,1.0, 1.0, 1.0) + + _BumpTiling ("Bump Tiling", Vector) = (1.0 ,1.0, -2.0, 3.0) + _BumpDirection ("Bump Direction & Speed", Vector) = (1.0 ,1.0, -1.0, 1.0) + + _FresnelScale ("FresnelScale", Range (0.15, 4.0)) = 0.75 + + _BaseColor ("Base color", COLOR) = ( .54, .95, .99, 0.5) + _ReflectionColor ("Reflection color", COLOR) = ( .54, .95, .99, 0.5) + _SpecularColor ("Specular color", COLOR) = ( .72, .72, .72, 1) + + _WorldLightDir ("Specular light direction", Vector) = (0.0, 0.1, -0.5, 0.0) + _Shininess ("Shininess", Range (2.0, 500.0)) = 200.0 + + _Foam ("Foam (intensity, cutoff)", Vector) = (0.1, 0.375, 0.0, 0.0) + + _GerstnerIntensity("Per vertex displacement", Float) = 1.0 + _GAmplitude ("Wave Amplitude", Vector) = (0.3 ,0.35, 0.25, 0.25) + _GFrequency ("Wave Frequency", Vector) = (1.3, 1.35, 1.25, 1.25) + _GSteepness ("Wave Steepness", Vector) = (1.0, 1.0, 1.0, 1.0) + _GSpeed ("Wave Speed", Vector) = (1.2, 1.375, 1.1, 1.5) + _GDirectionAB ("Wave Direction", Vector) = (0.3 ,0.85, 0.85, 0.25) + _GDirectionCD ("Wave Direction", Vector) = (0.1 ,0.9, 0.5, 0.5) +} + + +CGINCLUDE + + #include "UnityCG.cginc" + #include "WaterInclude.cginc" + + struct appdata + { + float4 vertex : POSITION; + float3 normal : NORMAL; + }; + + // interpolator structs + + struct v2f + { + float4 pos : SV_POSITION; + float4 normalInterpolator : TEXCOORD0; + float4 viewInterpolator : TEXCOORD1; + float4 bumpCoords : TEXCOORD2; + float4 screenPos : TEXCOORD3; + float4 grabPassPos : TEXCOORD4; + }; + + struct v2f_noGrab + { + float4 pos : SV_POSITION; + float4 normalInterpolator : TEXCOORD0; + float3 viewInterpolator : TEXCOORD1; + float4 bumpCoords : TEXCOORD2; + float4 screenPos : TEXCOORD3; + }; + + struct v2f_simple + { + float4 pos : SV_POSITION; + float4 viewInterpolator : TEXCOORD0; + float4 bumpCoords : TEXCOORD1; + }; + + // textures + sampler2D _BumpMap; + sampler2D _ReflectionTex; + sampler2D _RefractionTex; + sampler2D _ShoreTex; + sampler2D_float _CameraDepthTexture; + + // colors in use + uniform float4 _RefrColorDepth; + uniform float4 _SpecularColor; + uniform float4 _BaseColor; + uniform float4 _ReflectionColor; + + // edge & shore fading + uniform float4 _InvFadeParemeter; + + // specularity + uniform float _Shininess; + uniform float4 _WorldLightDir; + + // fresnel, vertex & bump displacements & strength + uniform float4 _DistortParams; + uniform float _FresnelScale; + uniform float4 _BumpTiling; + uniform float4 _BumpDirection; + + uniform float4 _GAmplitude; + uniform float4 _GFrequency; + uniform float4 _GSteepness; + uniform float4 _GSpeed; + uniform float4 _GDirectionAB; + uniform float4 _GDirectionCD; + + // foam + uniform float4 _Foam; + + // shortcuts + #define PER_PIXEL_DISPLACE _DistortParams.x + #define REALTIME_DISTORTION _DistortParams.y + #define FRESNEL_POWER _DistortParams.z + #define VERTEX_WORLD_NORMAL i.normalInterpolator.xyz + #define FRESNEL_BIAS _DistortParams.w + #define NORMAL_DISPLACEMENT_PER_VERTEX _InvFadeParemeter.z + + // + // HQ VERSION + // + + v2f vert(appdata_full v) + { + v2f o; + + half3 worldSpaceVertex = mul(_Object2World,(v.vertex)).xyz; + half3 vtxForAni = (worldSpaceVertex).xzz * unity_Scale.w; + + half3 nrml; + half3 offsets; + Gerstner ( + offsets, nrml, v.vertex.xyz, vtxForAni, // offsets, nrml will be written + _GAmplitude, // amplitude + _GFrequency, // frequency + _GSteepness, // steepness + _GSpeed, // speed + _GDirectionAB, // direction # 1, 2 + _GDirectionCD // direction # 3, 4 + ); + + v.vertex.xyz += offsets; + + // one can also use worldSpaceVertex.xz here (speed!), albeit it'll end up a little skewed + half2 tileableUv = mul(_Object2World,(v.vertex)).xz; + + o.bumpCoords.xyzw = (tileableUv.xyxy + _Time.xxxx * _BumpDirection.xyzw) * _BumpTiling.xyzw; + + o.viewInterpolator.xyz = worldSpaceVertex - _WorldSpaceCameraPos; + + o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + + ComputeScreenAndGrabPassPos(o.pos, o.screenPos, o.grabPassPos); + + o.normalInterpolator.xyz = nrml; + + o.viewInterpolator.w = saturate(offsets.y); + o.normalInterpolator.w = 1;//GetDistanceFadeout(o.screenPos.w, DISTANCE_SCALE); + + return o; + } + + half4 frag( v2f i ) : SV_Target + { + half3 worldNormal = PerPixelNormal(_BumpMap, i.bumpCoords, VERTEX_WORLD_NORMAL, PER_PIXEL_DISPLACE); + half3 viewVector = normalize(i.viewInterpolator.xyz); + + half4 distortOffset = half4(worldNormal.xz * REALTIME_DISTORTION * 10.0, 0, 0); + half4 screenWithOffset = i.screenPos + distortOffset; + half4 grabWithOffset = i.grabPassPos + distortOffset; + + half4 rtRefractionsNoDistort = tex2Dproj(_RefractionTex, UNITY_PROJ_COORD(i.grabPassPos)); + half refrFix = SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(grabWithOffset)); + half4 rtRefractions = tex2Dproj(_RefractionTex, UNITY_PROJ_COORD(grabWithOffset)); + + #ifdef WATER_REFLECTIVE + half4 rtReflections = tex2Dproj(_ReflectionTex, UNITY_PROJ_COORD(screenWithOffset)); + #endif + + #ifdef WATER_EDGEBLEND_ON + if (LinearEyeDepth(refrFix) < i.screenPos.z) + rtRefractions = rtRefractionsNoDistort; + #endif + + half3 reflectVector = normalize(reflect(viewVector, worldNormal)); + half3 h = normalize ((_WorldLightDir.xyz) + viewVector.xyz); + float nh = max (0, dot (worldNormal, -h)); + float spec = max(0.0,pow (nh, _Shininess)); + + half4 edgeBlendFactors = half4(1.0, 0.0, 0.0, 0.0); + + #ifdef WATER_EDGEBLEND_ON + half depth = SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.screenPos)); + depth = LinearEyeDepth(depth); + edgeBlendFactors = saturate(_InvFadeParemeter * (depth-i.screenPos.w)); + edgeBlendFactors.y = 1.0-edgeBlendFactors.y; + #endif + + // shading for fresnel term + worldNormal.xz *= _FresnelScale; + half refl2Refr = Fresnel(viewVector, worldNormal, FRESNEL_BIAS, FRESNEL_POWER); + + // base, depth & reflection colors + half4 baseColor = ExtinctColor (_BaseColor, i.viewInterpolator.w * _InvFadeParemeter.w); + #ifdef WATER_REFLECTIVE + half4 reflectionColor = lerp (rtReflections,_ReflectionColor,_ReflectionColor.a); + #else + half4 reflectionColor = _ReflectionColor; + #endif + + baseColor = lerp (lerp (rtRefractions, baseColor, baseColor.a), reflectionColor, refl2Refr); + baseColor = baseColor + spec * _SpecularColor; + + // handle foam + half4 foam = Foam(_ShoreTex, i.bumpCoords * 2.0); + baseColor.rgb += foam.rgb * _Foam.x * (edgeBlendFactors.y + saturate(i.viewInterpolator.w - _Foam.y)); + + baseColor.a = edgeBlendFactors.x; + return baseColor; + } + + // + // MQ VERSION + // + + v2f_noGrab vert300(appdata_full v) + { + v2f_noGrab o; + + half3 worldSpaceVertex = mul(_Object2World,(v.vertex)).xyz; + half3 vtxForAni = (worldSpaceVertex).xzz * unity_Scale.w; + + half3 nrml; + half3 offsets; + Gerstner ( + offsets, nrml, v.vertex.xyz, vtxForAni, // offsets, nrml will be written + _GAmplitude, // amplitude + _GFrequency, // frequency + _GSteepness, // steepness + _GSpeed, // speed + _GDirectionAB, // direction # 1, 2 + _GDirectionCD // direction # 3, 4 + ); + + v.vertex.xyz += offsets; + + // one can also use worldSpaceVertex.xz here (speed!), albeit it'll end up a little skewed + half2 tileableUv = mul(_Object2World,v.vertex).xz; + o.bumpCoords.xyzw = (tileableUv.xyxy + _Time.xxxx * _BumpDirection.xyzw) * _BumpTiling.xyzw; + + o.viewInterpolator.xyz = worldSpaceVertex - _WorldSpaceCameraPos; + + o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + + o.screenPos = ComputeScreenPos(o.pos); + + o.normalInterpolator.xyz = nrml; + o.normalInterpolator.w = 1;//GetDistanceFadeout(o.screenPos.w, DISTANCE_SCALE); + + return o; + } + + half4 frag300( v2f_noGrab i ) : SV_Target + { + half3 worldNormal = PerPixelNormal(_BumpMap, i.bumpCoords, normalize(VERTEX_WORLD_NORMAL), PER_PIXEL_DISPLACE); + + half3 viewVector = normalize(i.viewInterpolator.xyz); + + half4 distortOffset = half4(worldNormal.xz * REALTIME_DISTORTION * 10.0, 0, 0); + half4 screenWithOffset = i.screenPos + distortOffset; + + #ifdef WATER_REFLECTIVE + half4 rtReflections = tex2Dproj(_ReflectionTex, UNITY_PROJ_COORD(screenWithOffset)); + #endif + + half3 reflectVector = normalize(reflect(viewVector, worldNormal)); + half3 h = normalize (_WorldLightDir.xyz + viewVector.xyz); + float nh = max (0, dot (worldNormal, -h)); + float spec = max(0.0,pow (nh, _Shininess)); + + half4 edgeBlendFactors = half4(1.0, 0.0, 0.0, 0.0); + + #ifdef WATER_EDGEBLEND_ON + half depth = SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.screenPos)); + depth = LinearEyeDepth(depth); + edgeBlendFactors = saturate(_InvFadeParemeter * (depth-i.screenPos.z)); + edgeBlendFactors.y = 1.0-edgeBlendFactors.y; + #endif + + worldNormal.xz *= _FresnelScale; + half refl2Refr = Fresnel(viewVector, worldNormal, FRESNEL_BIAS, FRESNEL_POWER); + + half4 baseColor = _BaseColor; + #ifdef WATER_REFLECTIVE + baseColor = lerp (baseColor, lerp (rtReflections,_ReflectionColor,_ReflectionColor.a), saturate(refl2Refr * 2.0)); + #else + baseColor = lerp (baseColor, _ReflectionColor, saturate(refl2Refr * 2.0)); + #endif + + baseColor = baseColor + spec * _SpecularColor; + + baseColor.a = edgeBlendFactors.x * saturate(0.5 + refl2Refr * 1.0); + return baseColor; + } + + // + // LQ VERSION + // + + v2f_simple vert200(appdata_full v) + { + v2f_simple o; + + half3 worldSpaceVertex = mul(_Object2World, v.vertex).xyz; + half2 tileableUv = worldSpaceVertex.xz; + + o.bumpCoords.xyzw = (tileableUv.xyxy + _Time.xxxx * _BumpDirection.xyzw) * _BumpTiling.xyzw; + + o.viewInterpolator.xyz = worldSpaceVertex-_WorldSpaceCameraPos; + + o.pos = mul(UNITY_MATRIX_MVP, v.vertex); + + o.viewInterpolator.w = 1;//GetDistanceFadeout(ComputeScreenPos(o.pos).w, DISTANCE_SCALE); + + return o; + + } + + half4 frag200( v2f_simple i ) : SV_Target + { + half3 worldNormal = PerPixelNormal(_BumpMap, i.bumpCoords, half3(0,1,0), PER_PIXEL_DISPLACE); + half3 viewVector = normalize(i.viewInterpolator.xyz); + + half3 reflectVector = normalize(reflect(viewVector, worldNormal)); + half3 h = normalize ((_WorldLightDir.xyz) + viewVector.xyz); + float nh = max (0, dot (worldNormal, -h)); + float spec = max(0.0,pow (nh, _Shininess)); + + worldNormal.xz *= _FresnelScale; + half refl2Refr = Fresnel(viewVector, worldNormal, FRESNEL_BIAS, FRESNEL_POWER); + + half4 baseColor = _BaseColor; + baseColor = lerp(baseColor, _ReflectionColor, saturate(refl2Refr * 2.0)); + baseColor.a = saturate(2.0 * refl2Refr + 0.5); + + baseColor.rgb += spec * _SpecularColor.rgb; + return baseColor; + } + +ENDCG + +Subshader +{ + Tags {"RenderType"="Transparent" "Queue"="Transparent"} + + Lod 500 + ColorMask RGB + + GrabPass { "_RefractionTex" } + + Pass { + Blend SrcAlpha OneMinusSrcAlpha + ZTest LEqual + ZWrite Off + Cull Off + + CGPROGRAM + + #pragma target 3.0 + + #pragma vertex vert + #pragma fragment frag + + #pragma glsl + + #pragma fragmentoption ARB_precision_hint_fastest + + #pragma multi_compile WATER_VERTEX_DISPLACEMENT_ON WATER_VERTEX_DISPLACEMENT_OFF + #pragma multi_compile WATER_EDGEBLEND_ON WATER_EDGEBLEND_OFF + #pragma multi_compile WATER_REFLECTIVE WATER_SIMPLE + + ENDCG + } +} + +Subshader +{ + Tags {"RenderType"="Transparent" "Queue"="Transparent"} + + Lod 300 + ColorMask RGB + + Pass { + Blend SrcAlpha OneMinusSrcAlpha + ZTest LEqual + ZWrite Off + Cull Off + + CGPROGRAM + + #pragma target 3.0 + + #pragma vertex vert300 + #pragma fragment frag300 + + #pragma glsl + + #pragma fragmentoption ARB_precision_hint_fastest + #pragma multi_compile WATER_VERTEX_DISPLACEMENT_ON WATER_VERTEX_DISPLACEMENT_OFF + #pragma multi_compile WATER_EDGEBLEND_ON WATER_EDGEBLEND_OFF + #pragma multi_compile WATER_REFLECTIVE WATER_SIMPLE + + ENDCG + } +} + +Subshader +{ + Tags {"RenderType"="Transparent" "Queue"="Transparent"} + + Lod 200 + ColorMask RGB + + Pass { + Blend SrcAlpha OneMinusSrcAlpha + ZTest LEqual + ZWrite Off + Cull Off + + CGPROGRAM + + #pragma vertex vert200 + #pragma fragment frag200 + #pragma fragmentoption ARB_precision_hint_fastest + + ENDCG + } +} + +Fallback "Transparent/Diffuse" +} diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Shaders/FX-Water4.shader.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Shaders/FX-Water4.shader.meta new file mode 100644 index 0000000..b13f8ba --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Shaders/FX-Water4.shader.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 475c4a4e617a8401b84ca7b32c7cc460 +ShaderImporter: + defaultTextures: [] + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Shaders/WaterInclude.cginc b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Shaders/WaterInclude.cginc new file mode 100644 index 0000000..1d87748 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Shaders/WaterInclude.cginc @@ -0,0 +1,266 @@ + +#ifndef WATER_CG_INCLUDED +#define WATER_CG_INCLUDED + +#include "UnityCG.cginc" + +half _GerstnerIntensity; + +inline half3 PerPixelNormal(sampler2D bumpMap, half4 coords, half3 vertexNormal, half bumpStrength) +{ + half4 bump = tex2D(bumpMap, coords.xy) + tex2D(bumpMap, coords.zw); + bump.xy = bump.wy - half2(1.0, 1.0); + half3 worldNormal = vertexNormal + bump.xxy * bumpStrength * half3(1,0,1); + return normalize(worldNormal); +} + +inline half3 PerPixelNormalUnpacked(sampler2D bumpMap, half4 coords, half bumpStrength) +{ + half4 bump = tex2D(bumpMap, coords.xy) + tex2D(bumpMap, coords.zw); + bump = bump * 0.5; + half3 normal = UnpackNormal(bump); + normal.xy *= bumpStrength; + return normalize(normal); +} + +inline half3 GetNormal(half4 tf) { + #ifdef WATER_VERTEX_DISPLACEMENT_ON + return half3(2,1,2) * tf.rbg - half3(1,0,1); + #else + return half3(0,1,0); + #endif +} + +inline half GetDistanceFadeout(half screenW, half speed) { + return 1.0f / abs(0.5f + screenW * speed); +} + +half4 GetDisplacement3(half4 tileableUv, half4 tiling, half4 directionSpeed, sampler2D mapA, sampler2D mapB, sampler2D mapC) +{ + half4 displacementUv = tileableUv * tiling + _Time.xxxx * directionSpeed; + #ifdef WATER_VERTEX_DISPLACEMENT_ON + half4 tf = tex2Dlod(mapA, half4(displacementUv.xy, 0.0,0.0)); + tf += tex2Dlod(mapB, half4(displacementUv.zw, 0.0,0.0)); + tf += tex2Dlod(mapC, half4(displacementUv.xw, 0.0,0.0)); + tf *= 0.333333; + #else + half4 tf = half4(0.5,0.5,0.5,0.0); + #endif + + return tf; +} + +half4 GetDisplacement2(half4 tileableUv, half4 tiling, half4 directionSpeed, sampler2D mapA, sampler2D mapB) +{ + half4 displacementUv = tileableUv * tiling + _Time.xxxx * directionSpeed; + #ifdef WATER_VERTEX_DISPLACEMENT_ON + half4 tf = tex2Dlod(mapA, half4(displacementUv.xy, 0.0,0.0)); + tf += tex2Dlod(mapB, half4(displacementUv.zw, 0.0,0.0)); + tf *= 0.5; + #else + half4 tf = half4(0.5,0.5,0.5,0.0); + #endif + + return tf; +} + +inline void ComputeScreenAndGrabPassPos (float4 pos, out float4 screenPos, out float4 grabPassPos) +{ + #if UNITY_UV_STARTS_AT_TOP + float scale = -1.0; + #else + float scale = 1.0f; + #endif + + screenPos = ComputeScreenPos(pos); + grabPassPos.xy = ( float2( pos.x, pos.y*scale ) + pos.w ) * 0.5; + grabPassPos.zw = pos.zw; +} + + +inline half3 PerPixelNormalUnpacked(sampler2D bumpMap, half4 coords, half bumpStrength, half2 perVertxOffset) +{ + half4 bump = tex2D(bumpMap, coords.xy) + tex2D(bumpMap, coords.zw); + bump = bump * 0.5; + half3 normal = UnpackNormal(bump); + normal.xy *= bumpStrength; + normal.xy += perVertxOffset; + return normalize(normal); +} + +inline half3 PerPixelNormalLite(sampler2D bumpMap, half4 coords, half3 vertexNormal, half bumpStrength) +{ + half4 bump = tex2D(bumpMap, coords.xy); + bump.xy = bump.wy - half2(0.5, 0.5); + half3 worldNormal = vertexNormal + bump.xxy * bumpStrength * half3(1,0,1); + return normalize(worldNormal); +} + +inline half4 Foam(sampler2D shoreTex, half4 coords, half amount) +{ + half4 foam = ( tex2D(shoreTex, coords.xy) * tex2D(shoreTex,coords.zw) ) - 0.125; + foam.a = amount; + return foam; +} + +inline half4 Foam(sampler2D shoreTex, half4 coords) +{ + half4 foam = (tex2D(shoreTex, coords.xy) * tex2D(shoreTex,coords.zw)) - 0.125; + return foam; +} + +inline half Fresnel(half3 viewVector, half3 worldNormal, half bias, half power) +{ + half facing = clamp(1.0-max(dot(-viewVector, worldNormal), 0.0), 0.0,1.0); + half refl2Refr = saturate(bias+(1.0-bias) * pow(facing,power)); + return refl2Refr; +} + +inline half FresnelViaTexture(half3 viewVector, half3 worldNormal, sampler2D fresnel) +{ + half facing = saturate(dot(-viewVector, worldNormal)); + half fresn = tex2D(fresnel, half2(facing, 0.5f)).b; + return fresn; +} + +inline half2 GetTileableUv(half4 vertex) +{ + // @NOTE: use worldSpaceVertex.xz instead of ws to make it rotation independent + half2 ws = half2(_Object2World[0][3],_Object2World[2][3]); + half2 tileableUv = (ws + vertex.xz/unity_Scale.w); + return tileableUv; +} + +inline void VertexDisplacementHQ( sampler2D mapA, sampler2D mapB, + sampler2D mapC, half4 uv, + half vertexStrength, half3 normal, + out half4 vertexOffset, out half2 normalOffset) +{ + half4 tf = tex2Dlod(mapA, half4(uv.xy, 0.0,0.0)); + tf += tex2Dlod(mapB, half4(uv.zw, 0.0,0.0)); + tf += tex2Dlod(mapC, half4(uv.xw, 0.0,0.0)); + tf /= 3.0; + + tf.rga = tf.rga-half3(0.5,0.5,0.0); + + // height displacement in alpha channel, normals info in rgb + + vertexOffset = tf.a * half4(normal.xyz, 0.0) * vertexStrength; + normalOffset = tf.rg; +} + +inline void VertexDisplacementLQ( sampler2D mapA, sampler2D mapB, + sampler2D mapC, half4 uv, + half vertexStrength, half normalsStrength, + out half4 vertexOffset, out half2 normalOffset) +{ + // @NOTE: for best performance, this should really be properly packed! + + half4 tf = tex2Dlod(mapA, half4(uv.xy, 0.0,0.0)); + tf += tex2Dlod(mapB, half4(uv.zw, 0.0,0.0)); + tf *= 0.5; + + tf.rga = tf.rga-half3(0.5,0.5,0.0); + + // height displacement in alpha channel, normals info in rgb + + vertexOffset = tf.a * half4(0,1,0,0) * vertexStrength; + normalOffset = tf.rg * normalsStrength; +} + +half4 ExtinctColor (half4 baseColor, half extinctionAmount) +{ + // tweak the extinction coefficient for different coloring + return baseColor - extinctionAmount * half4(0.15, 0.03, 0.01, 0.0); +} + + half3 GerstnerOffsets (half2 xzVtx, half steepness, half amp, half freq, half speed, half2 dir) + { + half3 offsets; + + offsets.x = + steepness * amp * dir.x * + cos( freq * dot( dir, xzVtx ) + speed * _Time.x); + + offsets.z = + steepness * amp * dir.y * + cos( freq * dot( dir, xzVtx ) + speed * _Time.x); + + offsets.y = + amp * sin ( freq * dot( dir, xzVtx ) + speed * _Time.x); + + return offsets; + } + + half3 GerstnerOffset4 (half2 xzVtx, half4 steepness, half4 amp, half4 freq, half4 speed, half4 dirAB, half4 dirCD) + { + half3 offsets; + + half4 AB = steepness.xxyy * amp.xxyy * dirAB.xyzw; + half4 CD = steepness.zzww * amp.zzww * dirCD.xyzw; + + half4 dotABCD = freq.xyzw * half4(dot(dirAB.xy, xzVtx), dot(dirAB.zw, xzVtx), dot(dirCD.xy, xzVtx), dot(dirCD.zw, xzVtx)); + half4 TIME = _Time.yyyy * speed; + + half4 COS = cos (dotABCD + TIME); + half4 SIN = sin (dotABCD + TIME); + + offsets.x = dot(COS, half4(AB.xz, CD.xz)); + offsets.z = dot(COS, half4(AB.yw, CD.yw)); + offsets.y = dot(SIN, amp); + + return offsets; + } + + half3 GerstnerNormal (half2 xzVtx, half steepness, half amp, half freq, half speed, half2 dir) + { + half3 nrml = half3(0,0,0); + + nrml.x -= + dir.x * (amp * freq) * + cos(freq * dot( dir, xzVtx ) + speed * _Time.x); + + nrml.z -= + dir.y * (amp * freq) * + cos(freq * dot( dir, xzVtx ) + speed * _Time.x); + + return nrml; + } + + half3 GerstnerNormal4 (half2 xzVtx, half4 amp, half4 freq, half4 speed, half4 dirAB, half4 dirCD) + { + half3 nrml = half3(0,2.0,0); + + half4 AB = freq.xxyy * amp.xxyy * dirAB.xyzw; + half4 CD = freq.zzww * amp.zzww * dirCD.xyzw; + + half4 dotABCD = freq.xyzw * half4(dot(dirAB.xy, xzVtx), dot(dirAB.zw, xzVtx), dot(dirCD.xy, xzVtx), dot(dirCD.zw, xzVtx)); + half4 TIME = _Time.yyyy * speed; + + half4 COS = cos (dotABCD + TIME); + + nrml.x -= dot(COS, half4(AB.xz, CD.xz)); + nrml.z -= dot(COS, half4(AB.yw, CD.yw)); + + nrml.xz *= _GerstnerIntensity; + nrml = normalize (nrml); + + return nrml; + } + + void Gerstner ( out half3 offs, out half3 nrml, + half3 vtx, half3 tileableVtx, + half4 amplitude, half4 frequency, half4 steepness, + half4 speed, half4 directionAB, half4 directionCD ) + { + #ifdef WATER_VERTEX_DISPLACEMENT_ON + offs = GerstnerOffset4(tileableVtx.xz, steepness, amplitude, frequency, speed, directionAB, directionCD); + nrml = GerstnerNormal4(tileableVtx.xz + offs.xz, amplitude, frequency, speed, directionAB, directionCD); + #else + offs = half3(0,0,0); + nrml = half3(0,1,0); + #endif + } + + +#endif diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Shaders/WaterInclude.cginc.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Shaders/WaterInclude.cginc.meta new file mode 100644 index 0000000..99942c0 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Shaders/WaterInclude.cginc.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 34e1452e07a0b40c295c5b10aa679465 +ShaderImporter: + defaultTextures: [] + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Textures.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Textures.meta new file mode 100644 index 0000000..dc5baea --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Textures.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 3cc8ac37e0da341db819af6143a07b03 +folderAsset: yes +DefaultImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Textures/SimpleFoam.png b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Textures/SimpleFoam.png new file mode 100644 index 0000000..e83c171 Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Textures/SimpleFoam.png differ diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Textures/SimpleFoam.png.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Textures/SimpleFoam.png.meta new file mode 100644 index 0000000..6e7a6d6 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Textures/SimpleFoam.png.meta @@ -0,0 +1,47 @@ +fileFormatVersion: 2 +guid: 36dd0b22da8874ed38075789055ca664 +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 1024 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Textures/smallWavesMap.png b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Textures/smallWavesMap.png new file mode 100644 index 0000000..477d61c Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Textures/smallWavesMap.png differ diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Textures/smallWavesMap.png.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Textures/smallWavesMap.png.meta new file mode 100644 index 0000000..e0bf51c --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Sources/Textures/smallWavesMap.png.meta @@ -0,0 +1,47 @@ +fileFormatVersion: 2 +guid: fb6566c21f717904f83743a5a76dd0b0 +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 1 + externalNormalMap: 1 + heightScale: .131052643 + normalMapFilter: 1 + isReadable: 1 + grayScaleToAlpha: 0 + generateCubemap: 0 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 256 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: 1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Water4Example (Advanced).prefab b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Water4Example (Advanced).prefab new file mode 100644 index 0000000..425a698 Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Water4Example (Advanced).prefab differ diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Water4Example (Advanced).prefab.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Water4Example (Advanced).prefab.meta new file mode 100644 index 0000000..9fde22b --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Water4Example (Advanced).prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: b544816461f324e56a39767fdeb5b114 +NativeFormatImporter: + userData: diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Water4Example (Simple).prefab b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Water4Example (Simple).prefab new file mode 100644 index 0000000..c8391c9 Binary files /dev/null and b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Water4Example (Simple).prefab differ diff --git a/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Water4Example (Simple).prefab.meta b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Water4Example (Simple).prefab.meta new file mode 100644 index 0000000..5fb5954 --- /dev/null +++ b/playable/Assets/Standard Assets/Water (Pro Only)/Water4/Water4Example (Simple).prefab.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 843740dbe549a4a6ba9556d1b80001f5 +NativeFormatImporter: + userData: