(Update) Clean Projet

This commit is contained in:
2026-06-24 14:38:51 +02:00
parent 48588ccfed
commit ef01552268
2629 changed files with 1523 additions and 430219 deletions
@@ -0,0 +1,203 @@
3.2.6 (April 7th 2026)
Verified compatibility with Unity 6.4.
Fixed:
- Pre-emptive code warning fixes for Unity 6.5+
3.2.5 (February 5th 2026)
Added:
- Support for GPU Height Queries when using WebGPU in Unity 6.1 (experimental).
Fixed:
- Intersection foam cutting off at a certain height on river materials
3.2.4 (January 5th 2026)
Fixed:
- Pre-emptive fix for obsolete code warnings in Unity 6.4+ (EntityId.implicit)
- Pre-emptive fix for Unity 6.5+ due to non-Render Graph functions being obsolete.
3.2.3 (October 22nd 2025)
Minimum required version is now Unity 6000.0.60f1 to include a bug fix.
Fixed:
- Removed workaround for a bug in Unity 6.1+ (UUM-90433). This caused the scene-view to not render correctly in some setups.
- Lightmaps not taking effect if the GPU Resident Drawer was active.
Changed:
- Align To Water component now shows a warning if the GPU method is used, yet no Main camera is present.
3.2.2 (July 30th 2025)
Changed:
- Height Pre-Pass is now strictly executed for the Main Camera when in play mode.
Fixed:
- GPU Height Queries did not appear to work when more than one Base camera was present.
- Shadow Strength parameter not affecting the underwater surface.
3.2.1 (July 7th 2025)
Added:
- Align Transform To Water component, "Follow Target" transform field. Has the transform follow another on the XZ plane
- Set Custom Water Time component, added an option to use Coordinated Universal Time
- Render feature settings, added option to disable Height pre-pass for the scene view when playing.
Changed:
- Align Transform To Water, 'smoothing' is now a scalable float value, rather than a toggle
Fixed:
- GPU height queries not always firing a callback if the water didn't happen to render in the very first frame
3.2.0 (June 12th 2025)
Added:
- Support for Rendering Layers (aka Light Layers)
- Surface Foam clipping parameter, for dynamic effects foam
- Light reflections now have a "Sharp" option
- Water Decal shader, option to enable vertex color alpha fading (eg. particle effects)
- Nintendo Style + Arcade Ocean materials
Changed:
- The "Receive Dynamic Effects Foam" toggle is now a float value. Allows to scale up the foam per-material.
- Material UI, separated reflections into Light and Environment sections
Fixed:
- GPU Height Queries returning incorrect Wave animation heights if the Scene-view tab was open during Play mode
- Distance Normals flowing backwards for rivers when Advanced Shading was used
3.1.1 (June 3rd 2025)
Fixed:
- Underwater Rendering not rendering correctly when Deferred rendering was in use
- Demo scene loading in some scenes twice in Unity 6.1 when entering play mode
Changed:
- Render feature SSR settings, the "Reflect Skybox" parameter was renamed to "Reflect Everything" for clarity
3.1.0 (May 30th 2025)
This update includes some core changes, to add support for the Underwater Rendering extension, but has no functional impact on existing projects.
Added:
- Demo scene, night-time lighting scenario
- Global Wave Origin Offset component, add a Transform's position to any wave layers set to the "Radial" mode
- Screen-Space Reflections, added option to also accept skybox reflections
- Option on render feature to disable GPU Height Queries in edit-mode (avoids the scene-view always redrawing)
Changed:
- Planar Reflections Renderer, reflection will now flip if the camera goes below the plane (support for underwater rendering).
Fixed:
- Reflection probes not affecting the water surface in Unity 6.1 (requires 6000.1.3f+)
- Potential situations where the Ocean surface may be incorrectly culled.
Removed:
- Planar Reflections Renderer, "Render Range" parameter. The functionality behind this was deprecated in Unity 6.0.
3.0.5 (February 17th 2025)
Fixed:
- Camera projection being overriden in minimal rendering setups when using Dynamic Effects
Added:
- Planar Reflections Renderer, option to disable rendering in the scene-view
- Set Water Position Offset component, added "negate" option
Removed:
- Curved World 2020 support (can still be manually incorporated)
3.0.4 (January 15th 2025)
Added:
- Fog integration for Buto (v7+)
- Wave profile procedural editor, "base direction" parameter
Changed:
- Optimization to height readback GPU processing
- Improved error handling when using unsupported features on WebGL
Fixed:
- Fixed incorrect shading on slopes in some scenarios when using Dynamic Effects (requires v3.0.4 as well)
3.0.3 (December 2nd 2024)
Added:
- Installation section in asset window, provides setup warnings/errors with quick-fix buttons
- Lowpoly-style normal map
- Puddle prefabs
- Option to specify the source for the underwater fog: Depth Texture or Vertex Color
- Menu item: Window/Stylized Water 3/Create default reflection probe
- Options to toggle Dynamic Effects Height/Foam/Normals per material
- Set Custom Time component: added option for dynamic speed
- Distance Foam feature, blends in a 2nd layer of Surface Foam within a configurable range
Changed:
- "Vertex Color Depth" option has been replaced by "Vertex Color Transparency" (value automatically upgrades)
- Having Directional Caustics or Screen-Space Reflections enabled no longer forces the Depth texture to render (though still requires it)
- Water Decals now revert to their original height if not water surface was detected below them
Fixed:
- Occlusion Culling causing incorrect Planar Reflections
- Possible null-ref error stemming from render feature
- Resolved a GC-allocation
- Memory leak in destroyed Align To Water components if the CPU-method was used.
- Flat shading not having any effect if Dynamic Effects is disabled
- Water Grid, not creating any geometry if the Vertex Distance value was larger than an individual tile
- Foam Bubbles: dynamic effects foam not contributing
- Ocean prefab potentially showing as changed in a VCS, despite no apparent changes.
- Material UI: min/max slider not allowing keyboard input
3.0.2 (November 12th 2024)
Changed:
- Material UI will now show a notification if extensions or integration aren't active installed.
- Wave tint color is now applied after color absorption
Fixed:
- Enviro 3 fog not taking effect (now requires v3.2.0+)
- Shader error when using the Gamma color space
- Workaround for editor crash when using DirectX 12 and first adding the render feature (IN-88755)
3.0.1 (November 4th 2024)
This version also requires updating the Dynamic Effects extension to v3.0.1
Added:
- Intersection Foam, parameter to control the ripple speed separately
Changed:
- Render target inspector is now functional again
Fixed:
- Dynamic Effects extension not installed automatically
- Point/spot lights no longer affecting the water after a certain distance
- Incorrect configuration on Waterfall particle prefabs
3.0.0 (October 31st 2024)
What's new?
• Rewritten rendering code for Render Graph support
• Revamped wave animations, allowing for various types of waves
• Height Pre-pass, allows other shaders to read out the water surface height.
• GPU-based height query system, making rivers and Dynamic Effects readable
• Water decals, snaps textures onto the water (oil spills, weeds, targeting reticules)
• Improved wave crest foam shading (min/max range + bubbles)
• Ocean mesh component, 8x8km mesh with gradual vertex density
• Improved support for RigidBodies for the Align To Water component
• Waterfall prefabs (3 sizes)
Added:
- Option on shader to disable point/spot light: caustics & translucency
- Waterfall prefabs (mesh, material + particles)
- Support for the Waves feature on rivers
- Align Transform To Water component now better handles RigidBodies
Changed:
- Directional Caustics is now a per-material option
- Screen-space Reflections is now a per-material option
- Sharp and Smooth intersection foam styles are now merged into one feature
- "Align Transform To Waves" is now called "Align Transform To Water"
Removed:
- Integration for Dynamic Water Physics 2 (now deferred to author)
- Non-exponential Vertical Depth (deemed unused) option
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 793931a466dcf8743a80dc24cd9f9a56
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/CHANGELOG.md
uploadId: 895866
@@ -0,0 +1,6 @@
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
IDList=
URL=https://staggart.xyz/unity/stylized-water-3/sw3-docs/
HotKey=0
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 34cd7ff569c148941a18a2b494e0e596
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Documentation.url
uploadId: 895866
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7e7bfc054e36c424b97776205fef2d54
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,419 @@
// Stylized Water 3 by Staggart Creations (http://staggart.xyz)
// COPYRIGHT PROTECTED UNDER THE UNITY ASSET STORE EULA (https://unity.com/legal/as-terms)
// • Copying or referencing source code for the production of new asset store, or public, content is strictly prohibited!
// • Uploading this file to a public repository will subject it to an automated DMCA takedown request.
#if !UNITY_6000_0_OR_NEWER
#error [Stylized Water 3] Imported in a version older than Unity 6, all present script and shader compile errors are valid and not something to simply be fixed. Upgrade the project to Unity 6 to resolve them.
#endif
using System;
using System.Collections.Generic;
using System.Net;
using UnityEditor;
using UnityEditor.PackageManager;
using UnityEditor.PackageManager.Requests;
using PackageInfo = UnityEditor.PackageManager.PackageInfo;
using UnityEngine;
using Object = UnityEngine.Object;
namespace StylizedWater3
{
public class AssetInfo
{
private const string THIS_FILE_GUID = "b15801d8ff7e9574288149dd4cebaa68";
public const string ASSET_NAME = "Stylized Water 3";
public const string ASSET_ID = "287769";
public const string ASSET_ABRV = "SW3";
public const string INSTALLED_VERSION = "3.2.6";
private static readonly Dictionary<string, int> REQUIRED_PATCH_VERSIONS = new Dictionary<string, int>()
{
{ "6000.0", 22 },
{ "6000.1", 3 }
};
public const string MIN_URP_VERSION = "17.0.3";
public const string DOC_URL = "https://staggart.xyz/unity/stylized-water-3/sw3-docs/";
public const string FORUM_URL = "https://discussions.unity.com/t/1542753";
public const string EMAIL_URL = "mailto:contact@staggart.xyz?subject=Stylized Water 3";
public const string DISCORD_INVITE_URL = "https://discord.gg/GNjEaJc8gw";
#if !URP //Enabled when com.unity.render-pipelines.universal is below MIN_URP_VERSION
[InitializeOnLoad]
sealed class PackageInstaller : Editor
{
[InitializeOnLoadMethod]
public static void Initialize()
{
GetLatestCompatibleURPVersion();
if (EditorUtility.DisplayDialog(ASSET_NAME + " v" + INSTALLED_VERSION, "This package requires the Universal Render Pipeline " + MIN_URP_VERSION + " or newer, would you like to install or update it now?", "OK", "Later"))
{
Debug.Log("Universal Render Pipeline <b>v" + lastestURPVersion + "</b> will start installing in a moment. Please refer to the URP documentation for set up instructions");
Debug.Log("After installing and setting up URP, you must Re-import the Shaders folder!");
InstallURP();
}
}
private static PackageInfo urpPackage;
private static string lastestURPVersion;
#if SWS_DEV
[MenuItem("SWS/Get latest URP version")]
#endif
private static void GetLatestCompatibleURPVersion()
{
if(urpPackage == null) urpPackage = GetURPPackage();
if(urpPackage == null) return;
lastestURPVersion = urpPackage.versions.latestCompatible;
#if SWS_DEV
Debug.Log("Latest compatible URP version: " + lastestURPVersion);
#endif
}
private static void InstallURP()
{
if(urpPackage == null) urpPackage = GetURPPackage();
if(urpPackage == null) return;
lastestURPVersion = urpPackage.versions.latestCompatible;
AddRequest addRequest = Client.Add(URP_PACKAGE_ID + "@" + lastestURPVersion);
//Update Core and Shader Graph packages as well, doesn't always happen automatically
for (int i = 0; i < urpPackage.dependencies.Length; i++)
{
#if SWS_DEV
Debug.Log("Updating URP dependency <i>" + urpPackage.dependencies[i].name + "</i> to " + urpPackage.dependencies[i].version);
#endif
addRequest = Client.Add(urpPackage.dependencies[i].name + "@" + urpPackage.dependencies[i].version);
}
//Wait until finished
while(!addRequest.IsCompleted || addRequest.Status == StatusCode.InProgress) { }
WaterShaderImporter.ReimportAll();
}
}
#endif
public const string URP_PACKAGE_ID = "com.unity.render-pipelines.universal";
public static PackageInfo GetURPPackage()
{
SearchRequest request = Client.Search(URP_PACKAGE_ID);
while (request.Status == StatusCode.InProgress) { /* Waiting... */ }
if (request.Status == StatusCode.Failure)
{
Debug.LogError("Failed to retrieve URP package from Package Manager...");
return null;
}
return request.Result[0];
}
//Sorry, as much as I hate to intrude on an entire project, this is the only way in Unity to track importing or updating an asset
public class ImportOrUpdateAsset : AssetPostprocessor
{
private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromPath)
{
for (int i = 0; i < importedAssets.Length; i++)
{
OnPreProcessAsset(importedAssets[i]);
}
for (int i = 0; i < deletedAssets.Length; i++)
{
OnPreProcessAsset(deletedAssets[i]);
}
}
private static void OnPreProcessAsset(string m_assetPath)
{
//Importing/updating the Stylized Water 3 asset
if (m_assetPath.EndsWith("Stylized Water 3/Editor/AssetInfo.cs") || m_assetPath.EndsWith("com.staggartcreations.stylizedwater3/Editor/AssetInfo.cs"))
{
Installer.Initialize();
Installer.OpenWindowIfNeeded();
}
//These files change every version, so will trigger when updating or importing the first time
if (m_assetPath.EndsWith("Extension.UnderwaterRendering.cs"))
{
OnImportExtension("Underwater Rendering");
}
if (m_assetPath.EndsWith("Extension.DynamicEffects.cs"))
{
OnImportExtension("Dynamic Effects");
}
}
private static void OnImportExtension(string name)
{
Debug.Log($"[Stylized Water 3] {name} extension installed/deleted or updated. Reimporting water shader(s) to toggle integration.");
//Re-import any .watershader3 files, since these depend on the installation state of extensions
WaterShaderImporter.ReimportAll();
}
}
public static bool MeetsMinimumVersion(string versionMinimum)
{
Version curVersion = new Version(INSTALLED_VERSION);
Version minVersion = new Version(versionMinimum);
return curVersion >= minVersion;
}
public static void OpenAssetStore(string url = null)
{
if (url == string.Empty) url = "https://assetstore.unity.com/packages/slug/" + ASSET_ID;
Application.OpenURL(url + "?aid=1011l7Uk8&pubref=sw3editor");
}
public static void OpenReviewsPage()
{
Application.OpenURL($"https://assetstore.unity.com/packages/slug/{ASSET_ID}?aid=1011l7Uk8&pubref=sw3editor#reviews");
}
public static void OpenInPackageManager()
{
Application.OpenURL("com.unity3d.kharma:content/" + ASSET_ID);
}
public static void OpenForumPage()
{
Application.OpenURL(FORUM_URL + "/page-999");
}
public static string GetRootFolder()
{
//Get script path
string scriptFilePath = AssetDatabase.GUIDToAssetPath(THIS_FILE_GUID);
//Truncate to get relative path
string rootFolder = scriptFilePath.Replace("Editor/AssetInfo.cs", string.Empty);
#if SWS_DEV
//Debug.Log("<b>Package root</b> " + rootFolder);
#endif
return rootFolder;
}
public static class VersionChecking
{
public static string MinRequiredUnityVersion = "undefined";
public enum UnityVersionType
{
Release,
Beta,
Alpha
}
public static UnityVersionType unityVersionType;
[InitializeOnLoadMethod]
static void Initialize()
{
if (CHECK_PERFORMED == false)
{
CheckForUpdate(false);
CHECK_PERFORMED = true;
}
}
private static bool CHECK_PERFORMED
{
get => SessionState.GetBool("SW3_VERSION_CHECK_PERFORMED", false);
set => SessionState.SetBool("SW3_VERSION_CHECK_PERFORMED", value);
}
public static string LATEST_VERSION
{
get => SessionState.GetString("SW3_LATEST_VERSION", INSTALLED_VERSION);
set => SessionState.SetString("SW3_LATEST_VERSION", value);
}
public static bool UPDATE_AVAILABLE => new Version(LATEST_VERSION) > new Version(INSTALLED_VERSION);
public static string GetUnityVersion()
{
string version = UnityEditorInternal.InternalEditorUtility.GetFullUnityVersion();
//Remove GUID in parenthesis
return version.Substring(0, version.LastIndexOf(" ("));
}
public static bool supportedMajorVersion = true;
public static bool supportedPatchVersion = true;
public static bool compatibleVersion = true;
private static void ParseUnityVersion(string versionString, out int major, out int minor, out int patch, out UnityVersionType type)
{
var match = System.Text.RegularExpressions.Regex.Match(versionString, @"^(\d+)\.(\d+)\.(\d+)");
if (match.Success)
{
major = int.Parse(match.Groups[1].Value);
minor = int.Parse(match.Groups[2].Value);
patch = int.Parse(match.Groups[3].Value);
if (versionString.Contains("b"))
{
type = UnityVersionType.Beta;
}
else if (versionString.Contains("a"))
{
type = UnityVersionType.Alpha;
}
else
{
type = UnityVersionType.Release;
}
}
else
{
throw new FormatException($"Invalid Unity version format: {versionString}.");
}
}
public static void CheckUnityVersion()
{
string unityVersion = GetUnityVersion();
#if !UNITY_6000_0_OR_NEWER
compatibleVersion = false;
#endif
#if !UNITY_6000_0_OR_NEWER || UNITY_7000_OR_NEWER
supportedMajorVersion = false;
#endif
ParseUnityVersion(unityVersion, out int major, out int minor, out int patch, out unityVersionType);
//Get the minimum required patch version for the current Unity version (eg. 6000.1)
if (REQUIRED_PATCH_VERSIONS.TryGetValue($"{major}.{minor}", out int minPatchVersion))
{
supportedPatchVersion = patch >= minPatchVersion;
}
else
{
//None found, current Unity version likely unknown
supportedPatchVersion = true;
}
MinRequiredUnityVersion = $"{major}.{minor}.{minPatchVersion}";
}
public static string apiResult;
private static bool showPopup;
public enum VersionStatus
{
UpToDate,
Outdated
}
public enum QueryStatus
{
Fetching,
Completed,
Failed
}
public static QueryStatus queryStatus = QueryStatus.Completed;
#if SWS_DEV
[MenuItem("SWS/Check for update")]
#endif
public static void GetLatestVersionPopup()
{
CheckForUpdate(true);
}
private static int VersionStringToInt(string input)
{
//Remove all non-alphanumeric characters from version
input = input.Replace(".", string.Empty);
input = input.Replace(" BETA", string.Empty);
return int.Parse(input, System.Globalization.NumberStyles.Any);
}
public static void CheckForUpdate(bool showPopup = false)
{
//Offline
if (Application.internetReachability == NetworkReachability.NotReachable)
{
LATEST_VERSION = INSTALLED_VERSION;
return;
}
VersionChecking.showPopup = showPopup;
queryStatus = QueryStatus.Fetching;
var url = $"https://api.assetstore.unity3d.com/package/latest-version/{ASSET_ID}";
using (System.Net.WebClient webClient = new System.Net.WebClient())
{
webClient.DownloadStringCompleted += OnRetrievedAPIContent;
webClient.DownloadStringAsync(new System.Uri(url), apiResult);
}
}
private class AssetStoreItem
{
public string name;
public string version;
}
private static void OnRetrievedAPIContent(object sender, DownloadStringCompletedEventArgs e)
{
if (e.Error == null && !e.Cancelled)
{
string result = e.Result;
AssetStoreItem asset = (AssetStoreItem)JsonUtility.FromJson(result, typeof(AssetStoreItem));
LATEST_VERSION = asset.version;
//LATEST_VERSION = "9.9.9";
#if SWS_DEV
Debug.Log("<b>Asset store API</b> Update available = " + UPDATE_AVAILABLE + " (Installed:" + INSTALLED_VERSION + ") (Remote:" + LATEST_VERSION + ")");
#endif
queryStatus = QueryStatus.Completed;
if (VersionChecking.showPopup)
{
if (UPDATE_AVAILABLE)
{
if (EditorUtility.DisplayDialog(ASSET_NAME + ", version " + INSTALLED_VERSION, "An updated version is available: " + LATEST_VERSION, "Open Package Manager", "Close"))
{
OpenInPackageManager();
}
}
else
{
if (EditorUtility.DisplayDialog(ASSET_NAME + ", version " + INSTALLED_VERSION, "Installed version is up-to-date!", "Close")) { }
}
}
}
else
{
Debug.LogWarning("[" + ASSET_NAME + "] Contacting update server failed: " + e.Error.Message);
queryStatus = QueryStatus.Failed;
}
}
}
}
}
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: b15801d8ff7e9574288149dd4cebaa68
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/AssetInfo.cs
uploadId: 895866
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 6ed5097af7d138040808f978ab8fbaa8
timeCreated: 1701083972
@@ -0,0 +1,137 @@
// Stylized Water 3 by Staggart Creations (http://staggart.xyz)
// COPYRIGHT PROTECTED UNDER THE UNITY ASSET STORE EULA (https://unity.com/legal/as-terms)
// • Copying or referencing source code for the production of new asset store, or public, content is strictly prohibited!
// • Uploading this file to a public repository will subject it to an automated DMCA takedown request.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine.UIElements;
using PrefabStageUtility = UnityEditor.SceneManagement.PrefabStageUtility;
namespace StylizedWater3
{
[CanEditMultipleObjects]
[CustomEditor(typeof(AlignToWater))]
public class AlignToWaterInspector : Editor
{
AlignToWater script;
SerializedProperty heightInterface;
SerializedProperty followTarget;
SerializedProperty surfaceSize;
SerializedProperty heightOffset;
SerializedProperty rollAmount;
SerializedProperty rotation;
SerializedProperty smoothing;
private bool isRiver;
private bool wavesEnabled;
private string proSkinPrefix => EditorGUIUtility.isProSkin ? "d_" : "";
private void OnEnable()
{
script = (AlignToWater)target;
heightInterface = serializedObject.FindProperty("heightInterface");
followTarget = serializedObject.FindProperty("followTarget");
surfaceSize = serializedObject.FindProperty("surfaceSize");
heightOffset = serializedObject.FindProperty("heightOffset");
rollAmount = serializedObject.FindProperty("rollAmount");
rotation = serializedObject.FindProperty("rotation");
smoothing = serializedObject.FindProperty("smoothing");
ValidateMaterial();
}
public override void OnInspectorGUI()
{
UI.DrawHeader();
using (new EditorGUILayout.HorizontalScope())
{
GUILayout.Space(EditorGUIUtility.labelWidth);
AlignToWater.EnableInEditor =
GUILayout.Toggle(AlignToWater.EnableInEditor, new GUIContent(" Run in edit-mode (global)", EditorGUIUtility.IconContent(
(AlignToWater.EnableInEditor ? "animationvisibilitytoggleon" : "animationvisibilitytoggleoff")).image), "Button");
}
EditorGUILayout.Space();
serializedObject.Update();
if (script.rigidbody)
{
EditorGUILayout.HelpBox("RigidBody attachment detected! A fair reminder that this is not a physics-compatible component." +
"\n\n" +
"Physics will be overriden and its position and rotation will be set directly." +
"\nVertical forces applied to it will cause visible jittering.", MessageType.Warning);
}
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(heightInterface);
//UI.DrawNotification(isRiver, "Material has river mode enabled, buoyancy only works for flat water bodies", MessageType.Error);
//UI.DrawNotification(!wavesEnabled && !isRiver, "Material used on the water object does not have waves enabled.", MessageType.Error);
/*
if (script.waterObject && script.waterObject.material)
{
UI.DrawNotification((script.waterObject.material.GetFloat("_WorldSpaceUV") == 0f), "Material must use world-projected UV", "Change", ()=> script.waterObject.material.SetFloat("_WorldSpaceUV", 1f), MessageType.Error);
}
*/
EditorGUILayout.Space();
EditorGUILayout.PropertyField(surfaceSize);
EditorGUILayout.Space();
EditorGUILayout.PropertyField(followTarget);
EditorGUILayout.PropertyField(heightOffset);
EditorGUILayout.PropertyField(rollAmount);
EditorGUILayout.Separator();
EditorGUILayout.PropertyField(rotation);
EditorGUILayout.PropertyField(smoothing);
UI.DrawNotification(smoothing.floatValue == 0f && script.rigidbody, "Smoothing is required to mitigate jittering of the RigidBody", MessageType.Warning);
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
ValidateMaterial();
}
UI.DrawFooter();
}
private void ValidateMaterial()
{
/*
if (script.waterObject && script.waterObject.material)
{
if (script.waterObject.material != script.waterObject.meshRenderer.sharedMaterial) script.waterObject.material = script.waterObject.meshRenderer.sharedMaterial;
wavesEnabled = WaveParameters.WavesEnabled(script.waterObject.material);
isRiver = script.waterObject.material.IsKeywordEnabled(ShaderParams.Keywords.River);
}
*/
}
}
}
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: e47e6ece236452443bf1418a01d87491
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 148978298399363526, guid: 0000000000000000d000000000000000, type: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/Inspectors/AlignToWaterInspector.cs
uploadId: 895866
@@ -0,0 +1,92 @@
// Stylized Water 3 by Staggart Creations (http://staggart.xyz)
// COPYRIGHT PROTECTED UNDER THE UNITY ASSET STORE EULA (https://unity.com/legal/as-terms)
// • Copying or referencing source code for the production of new asset store, or public, content is strictly prohibited!
// • Uploading this file to a public repository will subject it to an automated DMCA takedown request.
using System;
using UnityEditor;
using UnityEngine;
namespace StylizedWater3
{
[CustomEditor(typeof(OceanFollowBehaviour))]
public class OceanFollowBehaviourInspector : Editor
{
private SerializedProperty material;
private SerializedProperty enableInEditMode;
private SerializedProperty followTarget;
private bool isvalidSetup;
private void OnEnable()
{
material = serializedObject.FindProperty("material");
enableInEditMode = serializedObject.FindProperty("enableInEditMode");
followTarget = serializedObject.FindProperty("followTarget");
isvalidSetup = ((OceanFollowBehaviour)target).InvalidSetup();
}
private bool materialChanged;
public override void OnInspectorGUI()
{
UI.DrawHeader();
serializedObject.Update();
UI.DrawNotification(isvalidSetup, "This component has an invalid set up, one or more references went missing." +
"\n\nThis component must not be added manually." +
"\n\nInstead go to GameObject->3D Object->Water->Ocean to create an ocean",
MessageType.Error);
EditorGUI.BeginChangeCheck();
using (new EditorGUILayout.HorizontalScope())
{
GUILayout.Space(EditorGUIUtility.labelWidth);
OceanFollowBehaviour.ShowWireFrame = GUILayout.Toggle(OceanFollowBehaviour.ShowWireFrame, new GUIContent(" Show Wireframe", EditorGUIUtility.IconContent((OceanFollowBehaviour.ShowWireFrame ? "animationvisibilitytoggleon" : "animationvisibilitytoggleoff")).image), "Button");
}
EditorGUILayout.Separator();
using (new EditorGUILayout.HorizontalScope())
{
materialChanged = false;
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(material);
if (EditorGUI.EndChangeCheck()) materialChanged = true;
EditorGUI.BeginDisabledGroup(material.objectReferenceValue == null);
if (GUILayout.Button("Edit", EditorStyles.miniButton, GUILayout.Width(50f)))
{
Selection.activeObject = material.objectReferenceValue;
//StylizedWaterEditor.PopUpMaterialEditor.Create(material.objectReferenceValue);
}
EditorGUI.EndDisabledGroup();
}
EditorGUILayout.Separator();
EditorGUILayout.PropertyField(enableInEditMode);
EditorGUILayout.PropertyField(followTarget);
if (followTarget.objectReferenceValue == null)
{
EditorGUILayout.HelpBox("None assigned. The actively rendering camera will be automatically followed", MessageType.Info);
}
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
if (materialChanged)
{
OceanFollowBehaviour component = (OceanFollowBehaviour)target;
component.ApplyMaterial();
}
}
UI.DrawFooter();
}
}
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: d01f8235914f45d2b896c0384d978acc
timeCreated: 1729594576
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/Inspectors/OceanFollowBehaviourInspector.cs
uploadId: 895866
@@ -0,0 +1,361 @@
// Stylized Water 3 by Staggart Creations (http://staggart.xyz)
// COPYRIGHT PROTECTED UNDER THE UNITY ASSET STORE EULA (https://unity.com/legal/as-terms)
// • Copying or referencing source code for the production of new asset store, or public, content is strictly prohibited!
// • Uploading this file to a public repository will subject it to an automated DMCA takedown request.
using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.XR;
namespace StylizedWater3
{
[CustomEditor(typeof(PlanarReflectionRenderer))]
public class PlanarReflectionRendererInspector : Editor
{
private PlanarReflectionRenderer renderer;
//Rendering
private SerializedProperty rotatable;
private SerializedProperty cullingMask;
private SerializedProperty rendererIndex;
private SerializedProperty offset;
private SerializedProperty includeSkybox;
private SerializedProperty enableFog;
private SerializedProperty enableInSceneView;
//Quality
private SerializedProperty renderShadows;
private SerializedProperty renderScale;
private SerializedProperty maximumLODLevel;
private SerializedProperty waterObjects;
private SerializedProperty moveWithTransform;
private Bounds curBounds;
private bool waterLayerError;
private bool previewReflection
{
get => EditorPrefs.GetBool("SWS2_PREVIEW_REFLECTION_ENABLED", true);
set => EditorPrefs.SetBool("SWS2_PREVIEW_REFLECTION_ENABLED", value);
}
private RenderTexture previewTexture;
#if URP
private void OnEnable()
{
PipelineUtilities.RefreshRendererList();
renderer = (PlanarReflectionRenderer)target;
rotatable = serializedObject.FindProperty("rotatable");
cullingMask = serializedObject.FindProperty("cullingMask");
rendererIndex = serializedObject.FindProperty("rendererIndex");
offset = serializedObject.FindProperty("offset");
includeSkybox = serializedObject.FindProperty("includeSkybox");
enableFog = serializedObject.FindProperty("enableFog");
enableInSceneView = serializedObject.FindProperty("enableInSceneView");
renderShadows = serializedObject.FindProperty("renderShadows");
renderScale = serializedObject.FindProperty("renderScale");
maximumLODLevel = serializedObject.FindProperty("maximumLODLevel");
waterObjects = serializedObject.FindProperty("waterObjects");
moveWithTransform = serializedObject.FindProperty("moveWithTransform");
if (renderer.waterObjects.Count == 0 && WaterObject.Instances.Count == 1)
{
renderer.waterObjects.Add(WaterObject.Instances[0]);
renderer.RecalculateBounds();
renderer.EnableMaterialReflectionSampling();
EditorUtility.SetDirty(target);
serializedObject.ApplyModifiedPropertiesWithoutUndo();
}
ValidateWaterObjectLayer();
curBounds = renderer.CalculateBounds();
RenderPipelineManager.endCameraRendering += OnEndCameraRendering;
}
private Camera currentCamera;
private string currentCameraName;
private bool waterObjectsVisible;
private void OnEndCameraRendering(ScriptableRenderContext context, Camera camera)
{
if (!previewReflection) return;
if (renderer.InvalidContext(camera)) return;
currentCamera = camera;
waterObjectsVisible = renderer.WaterObjectsVisible(currentCamera);
previewTexture = renderer.TryGetReflectionTexture(currentCamera);
currentCameraName = currentCamera.name;
}
private void OnDisable()
{
RenderPipelineManager.endCameraRendering -= OnEndCameraRendering;
}
#endif
public override void OnInspectorGUI()
{
#if !URP
UI.DrawNotification("The Universal Render Pipeline package v" + AssetInfo.MIN_URP_VERSION + " or newer is not installed", MessageType.Error);
#else
UI.DrawHeader();
if (ShaderUtil.anythingCompiling)
{
EditorGUILayout.HelpBox("Rendering is temporarily paused, while the editor finishes compiling shaders", MessageType.Info);
}
using (new EditorGUILayout.HorizontalScope())
{
GUILayout.Space(EditorGUIUtility.labelWidth);
previewReflection =
GUILayout.Toggle(previewReflection, new GUIContent(" Preview reflection", EditorGUIUtility.IconContent(
(previewReflection ? "animationvisibilitytoggleon" : "animationvisibilitytoggleoff")).image), "Button");
}
using (new EditorGUILayout.HorizontalScope())
{
GUILayout.Space(EditorGUIUtility.labelWidth);
EditorGUILayout.LabelField("Status: " + (waterObjectsVisible && currentCamera ? $"Rendering (camera: {currentCamera.name})" : "Not rendering (water not in view for any camera)"), EditorStyles.miniLabel);
}
UI.DrawNotification(PipelineUtilities.VREnabled(), "Not supported with VR rendering", MessageType.Error);
UI.DrawNotification(PlanarReflectionRenderer.AllowReflections == false, "Reflections have been globally disabled by an external script", MessageType.Warning);
serializedObject.Update();
EditorGUI.BeginChangeCheck();
EditorGUILayout.LabelField("Rendering", EditorStyles.boldLabel);
EditorGUI.BeginChangeCheck();
UI.DrawRendererProperty(rendererIndex);
if (EditorGUI.EndChangeCheck())
{
renderer.SetRendererIndex(rendererIndex.intValue);
}
//Default renderer
if (rendererIndex.intValue == 0)
{
UI.DrawNotification("\n" +
"Using the default renderer for reflections is strongly discouraged." +
"\n\nMost (if not all) render features, such as third-party post processing effects, will also render for the reflection." +
"\n\nThis can lead to rendering artefacts and negatively impacts overall performance." +
"\n", MessageType.Warning);
//If there are no other renderers to assign, suggest to auto-create one
UI.DrawNotification(PipelineUtilities.rendererIndexList.Length <= 2, "It is highly recommend to create a separate empty renderer", "Create and assign", CreateRenderer, MessageType.None);
EditorGUILayout.Space();
}
EditorGUILayout.PropertyField(cullingMask);
EditorGUILayout.PropertyField(includeSkybox);
EditorGUILayout.PropertyField(enableFog);
if(enableFog.boolValue) EditorGUILayout.HelpBox("Unity's built-in fog does not support oblique projections. Expect incorrect fog shading on tall objects or large triangles", MessageType.Warning);
EditorGUILayout.PropertyField(enableInSceneView);
EditorGUILayout.Space();
EditorGUILayout.PropertyField(rotatable);
EditorGUILayout.PropertyField(offset);
EditorGUILayout.Space();
EditorGUILayout.LabelField("Quality", EditorStyles.boldLabel);
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(renderShadows);
if (EditorGUI.EndChangeCheck())
{
renderer.ToggleShadows(renderShadows.boolValue);
}
EditorGUILayout.PropertyField(renderScale);
EditorGUILayout.PropertyField(maximumLODLevel);
EditorGUILayout.Space();
EditorGUILayout.LabelField("Target water objects", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(moveWithTransform, new GUIContent("Move bounds with transform", moveWithTransform.tooltip));
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(waterObjects);
if (EditorGUI.EndChangeCheck())
{
curBounds = renderer.CalculateBounds();
}
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
}
using (new EditorGUILayout.HorizontalScope())
{
GUILayout.FlexibleSpace();
if(GUILayout.Button(new GUIContent("Auto-find", "Assigns all active water objects currently in the scene"), EditorStyles.miniButton))
{
renderer.waterObjects = new List<WaterObject>(WaterObject.Instances);
renderer.RecalculateBounds();
curBounds = renderer.bounds;
renderer.EnableMaterialReflectionSampling();
ValidateWaterObjectLayer();
EditorUtility.SetDirty(target);
}
if(GUILayout.Button("Clear", EditorStyles.miniButton))
{
renderer.ToggleMaterialReflectionSampling(false);
renderer.waterObjects.Clear();
renderer.RecalculateBounds();
EditorUtility.SetDirty(target);
}
}
if (renderer.waterObjects != null)
{
UI.DrawNotification(renderer.waterObjects.Count == 0, "Assign at least one Water Object", MessageType.Info);
if (renderer.waterObjects.Count > 0)
{
UI.DrawNotification(curBounds.size != renderer.bounds.size || (moveWithTransform.boolValue == false && curBounds.center != renderer.bounds.center), "Water objects have changed or moved, bounds needs to be recalculated", "Recalculate",() => RecalculateBounds(), MessageType.Error);
}
UI.DrawNotification(waterLayerError, "One or more Water Objects aren't on the \"Water\" layer.\n\nThis causes recursive reflections", "Fix", () => SetObjectsOnWaterLayer(), MessageType.Error);
}
#endif
UI.DrawFooter();
}
#if URP
private void CreateRenderer()
{
int index = -1;
string path = "";
PipelineUtilities.CreateAndAssignNewRenderer(out index, out path);
if (index >= 0)
{
rendererIndex.intValue = index;
serializedObject.ApplyModifiedProperties();
serializedObject.Update();
renderer.SetRendererIndex(rendererIndex.intValue);
if (path != string.Empty)
{
Debug.Log("New renderer created at path <i>" + path + "</i>");
}
}
}
public override bool HasPreviewGUI()
{
return previewReflection && previewTexture;
}
public override bool RequiresConstantRepaint()
{
return HasPreviewGUI();
}
public override GUIContent GetPreviewTitle()
{
return currentCamera ? new GUIContent(currentCameraName + " reflection") : new GUIContent("Reflection");
}
public override void OnPreviewSettings()
{
if (HasPreviewGUI() == false) return;
GUILayout.Label($"Resolution ({previewTexture.width}x{previewTexture.height})");
}
private bool drawAlpha;
public override void OnPreviewGUI(Rect r, GUIStyle background)
{
if (drawAlpha)
{
EditorGUI.DrawTextureAlpha(r, previewTexture, ScaleMode.ScaleToFit);
}
else
{
GUI.DrawTexture(r, previewTexture, ScaleMode.ScaleToFit, false);
}
Rect btnRect = r;
btnRect.x += 10f;
btnRect.y += 10f;
btnRect.width = 150f;
btnRect.height = 20f;
drawAlpha = GUI.Toggle(btnRect, drawAlpha, new GUIContent(" Alpha channel"));
}
private void ValidateWaterObjectLayer()
{
if (renderer.waterObjects == null) return;
waterLayerError = false;
int layerID = LayerMask.NameToLayer("Water");
foreach (WaterObject obj in renderer.waterObjects)
{
//Is not on "Water" layer?
if (obj.gameObject.layer != layerID)
{
waterLayerError = true;
return;
}
}
}
private void SetObjectsOnWaterLayer()
{
int layerID = LayerMask.NameToLayer("Water");
foreach (WaterObject obj in renderer.waterObjects)
{
//Is not on "Water" layer?
if (obj.gameObject.layer != layerID)
{
obj.gameObject.layer = layerID;
EditorUtility.SetDirty(obj);
}
}
waterLayerError = false;
}
#endif
private void RecalculateBounds()
{
#if URP
renderer.RecalculateBounds();
curBounds = renderer.bounds;
EditorUtility.SetDirty(target);
#endif
}
}
}
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: ddec133f70260bb4aa7800414c2ba3c1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/Inspectors/PlanarReflectionRendererInspector.cs
uploadId: 895866
@@ -0,0 +1,157 @@
// Stylized Water 3 by Staggart Creations (http://staggart.xyz)
// COPYRIGHT PROTECTED UNDER THE UNITY ASSET STORE EULA (https://unity.com/legal/as-terms)
// • Copying or referencing source code for the production of new asset store, or public, content is strictly prohibited!
// • Uploading this file to a public repository will subject it to an automated DMCA takedown request.
#if URP
using System;
using UnityEditor;
using UnityEngine;
namespace StylizedWater3
{
[CustomEditor(typeof(StylizedWaterRenderFeature))]
public partial class RenderFeatureEditor : Editor
{
private StylizedWaterRenderFeature renderFeature;
private SerializedProperty screenSpaceReflectionSettings;
private SerializedProperty allowDirectionalCaustics;
private SerializedProperty heightPrePassSettings;
private SerializedProperty terrainHeightPrePassSettings;
private void OnEnable()
{
renderFeature = (StylizedWaterRenderFeature)target;
screenSpaceReflectionSettings = serializedObject.FindProperty("screenSpaceReflectionSettings");
allowDirectionalCaustics = serializedObject.FindProperty("allowDirectionalCaustics");
heightPrePassSettings = serializedObject.FindProperty("heightPrePassSettings");
#if SWS_DEV
terrainHeightPrePassSettings = serializedObject.FindProperty("terrainHeightPrePassSettings");
#endif
EnableFlowMapEditor();
DynamicEffectsOnEnable();
UnderwaterRenderingOnEnable();
}
public override void OnInspectorGUI()
{
using (new EditorGUILayout.HorizontalScope())
{
EditorGUILayout.LabelField($"Version {AssetInfo.INSTALLED_VERSION}", EditorStyles.miniLabel);
if (GUILayout.Button(new GUIContent(" Documentation", EditorGUIUtility.FindTexture("_Help"))))
{
Application.OpenURL(AssetInfo.DOC_URL);
}
if (GUILayout.Button(new GUIContent(" Debugger", EditorGUIUtility.IconContent("Profiler.Rendering").image, "Inspect the render buffer outputs")))
{
RenderTargetDebuggerWindow.Open();
}
}
EditorGUILayout.Space();
UI.DrawNotification(PipelineUtilities.RenderGraphEnabled() == false, "Render Graph is disabled, functionality on this render feature will not be functional", "Enable", () =>
{
PipelineUtilities.SetRenderGraphCompatibilityMode(false);
}, MessageType.Error);
serializedObject.Update();
EditorGUI.BeginChangeCheck();
UI.DrawNotification(renderFeature.heightReadbackCS == null, "A compute shader is not assigned to the render feature. Do not add render features in Play mode!", "Attempt fix", () =>
{
renderFeature.VerifyReferences();
}, MessageType.Error);
EditorGUILayout.PropertyField(allowDirectionalCaustics);
EditorGUILayout.Space();
EditorGUILayout.PropertyField(screenSpaceReflectionSettings);
if (renderFeature.screenSpaceReflectionSettings.reflectEverything && screenSpaceReflectionSettings.isExpanded)
{
UI.DrawNotification("Enabling this option bypasses failed reflection ray filtering." +
"\n\nReflection artefacts are to be expected!", MessageType.Warning);
}
EditorGUILayout.Space();
EditorGUILayout.PropertyField(heightPrePassSettings);
if (heightPrePassSettings.isExpanded)
{
HeightPrePass.Settings settings = ((StylizedWaterRenderFeature)target).heightPrePassSettings;
string statsText = "";
statsText += $"Current resolution: {PlanarProjection.CalculateResolution(settings.range, settings.cellsPerUnit, 16, settings.maxResolution)}px\n";
using (new EditorGUILayout.HorizontalScope())
{
GUILayout.Space(EditorGUIUtility.labelWidth);
EditorGUILayout.HelpBox(statsText, MessageType.None);
}
EditorGUILayout.HelpBox("This will pre-render all the height (including any displacement effects) of all water objects (on the Water layer!) into a buffer. Allowing other shaders to access this information." +
"\n\nSee the Height.hlsl shader library for the API, or use the \"Sample Water Height\" Sub-graph in Shader Graph." +
"\n\nThis is for advanced users, and Water Decals and the \"GPU Async Readback\" height readback API makes use of this", MessageType.Info);
if (HeightQuerySystem.RequiresHeightPrepass)
{
EditorGUILayout.HelpBox("Height Pre-pass is forcible enabled at the moment, because there are height queries being issued from script.", MessageType.Info);
}
}
EditorGUILayout.Space();
EditorGUILayout.LabelField("GPU Height Queries", EditorStyles.boldLabel);
HeightQuerySystem.DISABLE_IN_EDIT_MODE = EditorGUILayout.Toggle("Forced Disable In Edit-mode", HeightQuerySystem.DISABLE_IN_EDIT_MODE);
using (new EditorGUILayout.HorizontalScope())
{
EditorGUILayout.LabelField("");
if (GUILayout.Button(new GUIContent(" Inspect Queries", EditorGUIUtility.FindTexture("_Help"))))
{
HeightQuerySystemEditor.HeightQueryInspector.Open();
}
}
#if SWS_DEV
EditorGUILayout.Space();
EditorGUILayout.PropertyField(terrainHeightPrePassSettings);
#endif
EditorGUILayout.Space();
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
}
DrawFlowMapEditor();
DynamicEffectsOnInspectorGUI();
UnderwaterRenderingOnInspectorGUI();
UI.DrawFooter();
}
partial void EnableFlowMapEditor();
partial void DrawFlowMapEditor();
partial void DynamicEffectsOnEnable();
partial void DynamicEffectsOnInspectorGUI();
partial void UnderwaterRenderingOnEnable();
partial void UnderwaterRenderingOnInspectorGUI();
}
}
#endif
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 7b8b99303c66f4b4691ee9f596f1a3bf
timeCreated: 1701084026
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/Inspectors/RenderFeatureEditor.cs
uploadId: 895866
@@ -0,0 +1,114 @@
// Stylized Water 3 by Staggart Creations (http://staggart.xyz)
// COPYRIGHT PROTECTED UNDER THE UNITY ASSET STORE EULA (https://unity.com/legal/as-terms)
// • Copying or referencing source code for the production of new asset store, or public, content is strictly prohibited!
// • Uploading this file to a public repository will subject it to an automated DMCA takedown request.
using UnityEditor;
using UnityEngine;
namespace StylizedWater3
{
[CustomEditor(typeof(WaterGrid))]
public class CreateWaterGridInspector : Editor
{
private WaterGrid script;
private SerializedProperty material;
private SerializedProperty followSceneCamera;
private SerializedProperty autoAssignCamera;
private SerializedProperty followTarget;
private SerializedProperty scale;
private SerializedProperty vertexDistance;
private SerializedProperty rowsColumns;
private int vertexCount;
private void OnEnable()
{
script = (WaterGrid) target;
script.m_rowsColumns = script.rowsColumns;
material = serializedObject.FindProperty("material");
followSceneCamera = serializedObject.FindProperty("followSceneCamera");
autoAssignCamera = serializedObject.FindProperty("autoAssignCamera");
followTarget = serializedObject.FindProperty("followTarget");
scale = serializedObject.FindProperty("scale");
vertexDistance = serializedObject.FindProperty("vertexDistance");
rowsColumns = serializedObject.FindProperty("rowsColumns");
}
public override void OnInspectorGUI()
{
UI.DrawHeader();
using (new EditorGUILayout.HorizontalScope())
{
GUILayout.Space(EditorGUIUtility.labelWidth);
WaterGrid.DisplayGrid = GUILayout.Toggle(WaterGrid.DisplayGrid , new GUIContent(" Display Grid", EditorGUIUtility.IconContent((WaterGrid.DisplayGrid ? "animationvisibilitytoggleon" : "animationvisibilitytoggleoff")).image), "Button");
WaterGrid.DisplayWireframe = GUILayout.Toggle(WaterGrid.DisplayWireframe, new GUIContent(" Show Wireframe", EditorGUIUtility.IconContent((WaterGrid.DisplayWireframe ? "animationvisibilitytoggleon" : "animationvisibilitytoggleoff")).image), "Button");
}
serializedObject.Update();
EditorGUI.BeginChangeCheck();
EditorGUILayout.LabelField("Appearance", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(material);
if(material.objectReferenceValue == null) EditorGUILayout.HelpBox("A material must be assigned", MessageType.Error);
EditorGUILayout.Space();
EditorGUILayout.LabelField("Movement", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(followSceneCamera);
using (new EditorGUI.DisabledScope(autoAssignCamera.boolValue))
{
EditorGUILayout.PropertyField(followTarget);
}
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(autoAssignCamera);
EditorGUI.indentLevel--;
EditorGUILayout.Space();
EditorGUILayout.LabelField("Grid geometry", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(scale, GUILayout.MaxWidth(EditorGUIUtility.labelWidth + 95f));
using (new EditorGUILayout.HorizontalScope())
{
EditorGUILayout.PrefixLabel(rowsColumns.displayName);
using (new EditorGUI.DisabledScope(rowsColumns.intValue <= 0))
{
if (GUILayout.Button("-", EditorStyles.miniButtonLeft, GUILayout.Width(25f)))
{
rowsColumns.intValue--;
}
}
EditorGUILayout.PropertyField(rowsColumns, GUIContent.none, GUILayout.MaxWidth(40f));
if (GUILayout.Button("+", EditorStyles.miniButtonRight, GUILayout.Width(25f)))
{
rowsColumns.intValue++;
}
EditorGUILayout.LabelField($"= {rowsColumns.intValue * rowsColumns.intValue} tiles", EditorStyles.miniLabel);
}
EditorGUILayout.Space();
EditorGUILayout.PropertyField(vertexDistance, new GUIContent("Min. vertex distance", vertexDistance.tooltip));
vertexCount = Mathf.FloorToInt(((scale.floatValue / rowsColumns.intValue) / vertexDistance.floatValue) * ((scale.floatValue / rowsColumns.intValue) / vertexDistance.floatValue));
//EditorGUILayout.HelpBox($"Vertex count: {vertexCount}", MessageType.None);
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
//Executed here since objects can't be destroyed from OnValidate
script.Recreate();
}
UI.DrawFooter();
}
}
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: b340d2e902f13d1438eb157b2904daa3
timeCreated: 1680100927
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/Inspectors/WaterGridInspector.cs
uploadId: 895866
@@ -0,0 +1,169 @@
// Stylized Water 3 by Staggart Creations (http://staggart.xyz)
// COPYRIGHT PROTECTED UNDER THE UNITY ASSET STORE EULA (https://unity.com/legal/as-terms)
// • Copying or referencing source code for the production of new asset store, or public, content is strictly prohibited!
// • Uploading this file to a public repository will subject it to an automated DMCA takedown request.
using UnityEditor;
using UnityEditor.AssetImporters;
using UnityEngine;
namespace StylizedWater3
{
[CustomEditor(typeof(WaterMeshImporter))]
public class WaterMeshImporterInspector: ScriptedImporterEditor
{
private SerializedProperty waterMesh;
private SerializedProperty shape;
private SerializedProperty scale;
private SerializedProperty UVTiling;
private SerializedProperty vertexDistance;
private SerializedProperty noise;
private SerializedProperty boundsPadding;
private WaterMeshImporter importer;
private bool autoApplyChanges;
private bool previewInSceneView
{
get => EditorPrefs.GetBool("SWS2_PREVIEW_WATER_MESH_ENABLED", true);
set => EditorPrefs.SetBool("SWS2_PREVIEW_WATER_MESH_ENABLED", value);
}
public override void OnEnable()
{
base.OnEnable();
importer = (WaterMeshImporter)target;
waterMesh = serializedObject.FindProperty("waterMesh");
shape = waterMesh.FindPropertyRelative("shape");
scale = waterMesh.FindPropertyRelative("scale");
UVTiling = waterMesh.FindPropertyRelative("UVTiling");
vertexDistance = waterMesh.FindPropertyRelative("vertexDistance");
noise = waterMesh.FindPropertyRelative("noise");
boundsPadding = waterMesh.FindPropertyRelative("boundsPadding");
SceneView.duringSceneGui += OnSceneGUI;
}
public override void OnInspectorGUI()
{
UI.DrawHeader();
using (new EditorGUILayout.HorizontalScope())
{
GUILayout.Space(EditorGUIUtility.labelWidth);
previewInSceneView =
GUILayout.Toggle(previewInSceneView, new GUIContent(" Preview in scene view", EditorGUIUtility.IconContent(
(previewInSceneView ? "animationvisibilitytoggleon" : "animationvisibilitytoggleoff")).image), "Button");
}
if (previewInSceneView && WaterObject.Instances.Count > 0)
{
using (new EditorGUILayout.HorizontalScope())
{
GUILayout.Space(EditorGUIUtility.labelWidth);
EditorGUILayout.HelpBox($"Drawing on WaterObject instances in the scene ({WaterObject.Instances.Count})", MessageType.None);
}
}
EditorGUILayout.Space();
serializedObject.Update();
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(shape);
EditorGUILayout.Space();
EditorGUILayout.PropertyField(scale);
EditorGUILayout.PropertyField(vertexDistance);
int subdivisions = Mathf.FloorToInt(scale.floatValue / vertexDistance.floatValue);
int vertexCount = Mathf.FloorToInt(subdivisions * subdivisions);
using (new EditorGUILayout.HorizontalScope())
{
GUILayout.Space(EditorGUIUtility.labelWidth);
EditorGUILayout.HelpBox($"Vertex count: {vertexCount:N1}", MessageType.None);
}
EditorGUILayout.Space();
EditorGUILayout.PropertyField(UVTiling);
EditorGUILayout.PropertyField(noise);
EditorGUILayout.PropertyField(boundsPadding);
EditorGUILayout.Space();
autoApplyChanges = EditorGUILayout.Toggle("Auto-apply changes", autoApplyChanges);
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
if (autoApplyChanges && HasModified())
{
this.SaveChanges();
//importer = (WaterMeshImporter)target;
}
}
this.ApplyRevertGUI();
UI.DrawFooter();
}
private void OnDestroy()
{
SceneView.duringSceneGui -= OnSceneGUI;
}
private Material mat;
private void OnSceneGUI(SceneView obj)
{
if (!previewInSceneView)
{
GL.wireframe = false;
return;
}
if (!mat)
{
mat = new Material(Shader.Find("Unlit/Color"));
mat.color = new Color(0,0,0, 0.25f);
mat.mainTexture = Texture2D.whiteTexture;
}
mat.SetPass(0);
if (importer.waterMesh.mesh)
{
GL.wireframe = true;
if (WaterObject.Instances.Count > 0)
{
foreach (WaterObject waterObject in WaterObject.Instances)
{
Graphics.DrawMeshNow(importer.waterMesh.mesh, waterObject.transform.localToWorldMatrix);
}
}
else
{
if (SceneView.lastActiveSceneView)
{
//Position in view
Vector3 position = SceneView.lastActiveSceneView.camera.transform.position + (SceneView.lastActiveSceneView.camera.transform.forward * importer.waterMesh.scale * 0.5f);
Graphics.DrawMeshNow(importer.waterMesh.mesh, position, Quaternion.identity);
}
}
GL.wireframe = false;
}
}
}
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 97fbcf08a16d4498b8d18b0ce8df5fee
timeCreated: 1728821855
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/Inspectors/WaterMeshImporterInspector.cs
uploadId: 895866
@@ -0,0 +1,149 @@
// Stylized Water 3 by Staggart Creations (http://staggart.xyz)
// COPYRIGHT PROTECTED UNDER THE UNITY ASSET STORE EULA (https://unity.com/legal/as-terms)
// • Copying or referencing source code for the production of new asset store, or public, content is strictly prohibited!
// • Uploading this file to a public repository will subject it to an automated DMCA takedown request.
using System;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
#if URP
using UnityEngine.Rendering.Universal;
#endif
namespace StylizedWater3
{
[CustomEditor(typeof(WaterObject))]
[CanEditMultipleObjects]
public class WaterObjectInspector : Editor
{
private WaterObject component;
private SerializedProperty material;
private SerializedProperty meshFilter;
private SerializedProperty meshRenderer;
private bool depthTextureRequired;
private bool opaqueTextureRequired;
private bool showInstances
{
get => SessionState.GetBool("WATEROBJECT_SHOW_INSTANCES", false);
set => SessionState.SetBool("WATEROBJECT_SHOW_INSTANCES", value);
}
private Texture icon;
private void OnEnable()
{
component = (WaterObject)target;
icon = Resources.Load<Texture>("water-object-icon");
material = serializedObject.FindProperty("material");
meshFilter = serializedObject.FindProperty("meshFilter");
meshRenderer = serializedObject.FindProperty("meshRenderer");
CheckMaterial();
}
private void CheckMaterial()
{
#if URP
if (UniversalRenderPipeline.asset == null || component.material == null) return;
depthTextureRequired = UniversalRenderPipeline.asset.supportsCameraDepthTexture == false && component.material.GetFloat("_DisableDepthTexture") == 0f;
opaqueTextureRequired = UniversalRenderPipeline.asset.supportsCameraOpaqueTexture == false && component.material.GetFloat("_RefractionOn") == 1f;
#endif
}
public override void OnInspectorGUI()
{
#if URP
if (UniversalRenderPipeline.asset)
{
UI.DrawNotification(
depthTextureRequired,
"Depth texture is disabled, but is required for the water material",
"Enable",
() =>
{
StylizedWaterEditor.EnableDepthTexture();
CheckMaterial();
},
MessageType.Error);
UI.DrawNotification(
opaqueTextureRequired,
"Opaque texture is disabled, but is required for the water material",
"Enable",
() =>
{
StylizedWaterEditor.EnableOpaqueTexture();
CheckMaterial();
},
MessageType.Error);
}
#endif
EditorGUILayout.HelpBox("This component provides a means for other scripts to identify and find water bodies", MessageType.None);
UI.DrawNotification(component.gameObject.layer != LayerMask.NameToLayer("Water"), "Object is not on the \"Water\" layer. This means it won't work with height readback operations", "Fix", () =>
{
component.gameObject.layer = LayerMask.NameToLayer("Water");
}, MessageType.Warning);
EditorGUILayout.LabelField("References (Read only)", EditorStyles.boldLabel);
EditorGUI.BeginDisabledGroup(true);
{
EditorGUILayout.PropertyField(material);
EditorGUILayout.PropertyField(meshFilter);
EditorGUILayout.PropertyField(meshRenderer);
}
EditorGUI.EndDisabledGroup();
//In case the material was changed on the attached Mesh Renderer, reflect the change
foreach (Object currentTarget in targets)
{
WaterObject water = (WaterObject)currentTarget;
water.FetchWaterMaterial();
}
if (WaterObject.Instances.Count > 1)
{
EditorGUILayout.Space();
showInstances = EditorGUILayout.BeginFoldoutHeaderGroup(showInstances, $"Instances ({WaterObject.Instances.Count})");
if (showInstances)
{
this.Repaint();
using (new EditorGUILayout.VerticalScope(EditorStyles.textArea))
{
foreach (WaterObject obj in WaterObject.Instances)
{
var rect = EditorGUILayout.BeginHorizontal(EditorStyles.miniLabel);
if (rect.Contains(Event.current.mousePosition))
{
EditorGUIUtility.AddCursorRect(new Rect(Event.current.mousePosition.x, Event.current.mousePosition.y, 27, 27), MouseCursor.Link);
EditorGUI.DrawRect(rect, Color.gray * (EditorGUIUtility.isProSkin ? 0.66f : 0.20f));
}
if (GUILayout.Button(new GUIContent(" " + obj.name, icon), EditorStyles.miniLabel, GUILayout.Height(20f)))
{
EditorGUIUtility.PingObject(obj);
Selection.activeGameObject = obj.gameObject;
}
EditorGUILayout.EndHorizontal();
}
}
}
EditorGUILayout.EndFoldoutHeaderGroup();
}
}
}
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 9bef468d6b3e196468eb63fc634d8dca
timeCreated: 1685014300
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/Inspectors/WaterObjectInspector.cs
uploadId: 895866
@@ -0,0 +1,381 @@
// Stylized Water 3 by Staggart Creations (http://staggart.xyz)
// COPYRIGHT PROTECTED UNDER THE UNITY ASSET STORE EULA (https://unity.com/legal/as-terms)
// • Copying or referencing source code for the production of new asset store, or public, content is strictly prohibited!
// • Uploading this file to a public repository will subject it to an automated DMCA takedown request.
using System.IO;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
using UnityEditor.AssetImporters;
namespace StylizedWater3
{
[CustomEditor(typeof(WaterShaderImporter))]
[CanEditMultipleObjects]
public class WaterShaderImporterEditor : ScriptedImporterEditor
{
private WaterShaderImporter importer;
private SerializedProperty template;
private SerializedProperty settings;
private SerializedProperty shaderName;
private SerializedProperty hidden;
private SerializedProperty type;
private SerializedProperty autoIntegration;
private SerializedProperty fogIntegration;
private SerializedProperty lightCookies;
private SerializedProperty additionalLightCaustics;
private SerializedProperty additionalLightTranslucency;
private SerializedProperty singleCausticsLayers;
private SerializedProperty customIncludeDirectives;
private SerializedProperty additionalPasses;
private SerializedProperty configurationState;
private bool underwaterRenderingInstalled;
private bool dynamicEffectsInstalled;
private FogIntegration.Integration firstIntegration;
private bool curvedWorldInstalled;
private bool showDependencies;
private ShaderData shaderData;
public override void OnEnable()
{
base.OnEnable();
underwaterRenderingInstalled = StylizedWaterEditor.UnderwaterRenderingInstalled();
dynamicEffectsInstalled = StylizedWaterEditor.DynamicEffectsInstalled();
firstIntegration = FogIntegration.GetFirstInstalled();
curvedWorldInstalled = StylizedWaterEditor.CurvedWorldInstalled(out var _);
importer = (WaterShaderImporter)target;
template = serializedObject.FindProperty("template");
settings = serializedObject.FindProperty("settings");
//settings.isExpanded = true;
shaderName = settings.FindPropertyRelative("shaderName");
hidden = settings.FindPropertyRelative("hidden");
type = settings.FindPropertyRelative("type");
lightCookies = settings.FindPropertyRelative("lightCookies");
additionalLightCaustics = settings.FindPropertyRelative("additionalLightCaustics");
additionalLightTranslucency = settings.FindPropertyRelative("additionalLightTranslucency");
singleCausticsLayers = settings.FindPropertyRelative("singleCausticsLayer");
autoIntegration = settings.FindPropertyRelative("autoIntegration");
fogIntegration = settings.FindPropertyRelative("fogIntegration");
customIncludeDirectives = settings.FindPropertyRelative("customIncludeDirectives");
additionalPasses = settings.FindPropertyRelative("additionalPasses");
configurationState = serializedObject.FindProperty("configurationState");
Shader shader = importer.GetShader();
if (shader != null)
{
shaderData = ShaderUtil.GetShaderData(shader);
}
}
public override bool HasPreviewGUI()
{
//Hide the useless sphere preview :)
return false;
}
public override void OnInspectorGUI()
{
//base.OnInspectorGUI();
Color defaultColor = GUI.contentColor;
UI.DrawHeader();
Shader shader = AssetDatabase.LoadAssetAtPath<Shader>(importer.assetPath);
if (shader == null)
{
UI.DrawNotification("Shader failed to compile, try to manually recompile it now.", MessageType.Error);
}
UI.DrawNotification(EditorSettings.asyncShaderCompilation == false, "Asynchronous shader compilation is disabled in the Editor settings." +
"\n\n" +
"This will very likely cause the editor to crash when trying to compile this shader (D3D11 Swapchain error).", "Enable", () =>
{
EditorSettings.asyncShaderCompilation = true;
}, MessageType.Error);
if (GUILayout.Button(new GUIContent(" Recompile", EditorGUIUtility.IconContent("RotateTool").image), GUILayout.MinHeight(30f)))
{
importer.Reimport();
return;
}
GUILayout.Space(-2f);
using (new EditorGUILayout.HorizontalScope())
{
using (new EditorGUI.DisabledGroupScope(shader == null))
{
if (GUILayout.Button(new GUIContent(" Show Generated Code", EditorGUIUtility.IconContent("align_horizontally_left_active").image), EditorStyles.miniButtonLeft, GUILayout.Height(28f)))
{
GenericMenu menu = new GenericMenu();
menu.AddItem(new GUIContent("With tessellation"), false, () => OpenGeneratedCode(true));
menu.AddItem(new GUIContent("Without tessellation"), false, () => OpenGeneratedCode(false));
menu.ShowAsContext();
}
if (GUILayout.Button(new GUIContent("Clear cache", "Unity's shader compiler will cache the compiled shader, and internally use that." +
"\n\nThis may result in seemingly false-positive shader errors. Such as in the case of importing the shader, before the URP shader libraries are." +
"\n\nClearing the cache gives the compiler a kick, and makes the shader properly represent the current state of the project/dependencies."), EditorStyles.miniButtonRight, GUILayout.Height(28f)))
{
importer.ClearCache();
}
}
}
EditorGUILayout.Space();
serializedObject.Update();
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(template);
if (template.objectReferenceValue == null) EditorGUILayout.HelpBox("• Template is assumed to be in the contents of the file itself", MessageType.None);
//EditorGUILayout.LabelField(importer.GetTemplatePath(), EditorStyles.miniLabel);
EditorGUILayout.Space();
EditorGUILayout.LabelField("Settings", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(shaderName);
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(hidden);
EditorGUI.indentLevel--;
EditorGUILayout.PropertyField(type);
if (type.intValue == (int)WaterShaderImporter.WaterShaderSettings.ShaderType.WaterSurface)
{
EditorGUILayout.Space();
EditorGUILayout.LabelField("Integrations", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(autoIntegration, new GUIContent("Automatic detection", autoIntegration.tooltip));
if (autoIntegration.boolValue)
{
using (new EditorGUILayout.HorizontalScope())
{
EditorGUI.indentLevel++;
EditorGUILayout.LabelField("Fog post-processing", GUILayout.MaxWidth(EditorGUIUtility.labelWidth));
EditorGUI.indentLevel--;
using (new EditorGUILayout.HorizontalScope(EditorStyles.textField))
{
GUI.contentColor = Color.green;
EditorGUILayout.LabelField(firstIntegration.name);
GUI.contentColor = defaultColor;
}
}
if (curvedWorldInstalled)
{
using (new EditorGUILayout.HorizontalScope())
{
EditorGUI.indentLevel++;
EditorGUILayout.LabelField("Curved World 2020", GUILayout.MaxWidth(EditorGUIUtility.labelWidth));
EditorGUI.indentLevel--;
using (new EditorGUILayout.HorizontalScope(EditorStyles.textField))
{
GUI.contentColor = Color.green;
EditorGUILayout.LabelField("Installed");
GUI.contentColor = defaultColor;
}
}
}
}
else
{
EditorGUILayout.PropertyField(fogIntegration);
}
if (curvedWorldInstalled) EditorGUILayout.HelpBox("Curved World integration must be manually activated through minor code changes, see documentation.", MessageType.Info);
EditorGUILayout.Space();
EditorGUILayout.LabelField("Functionality support", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(lightCookies);
EditorGUILayout.PropertyField(additionalLightCaustics);
EditorGUILayout.PropertyField(additionalLightTranslucency);
EditorGUILayout.PropertyField(singleCausticsLayers);
}
EditorGUILayout.Space();
EditorGUILayout.LabelField("Extensions", EditorStyles.boldLabel);
using (new EditorGUILayout.HorizontalScope())
{
EditorGUILayout.LabelField("Underwater Rendering", GUILayout.MaxWidth(EditorGUIUtility.labelWidth));
using (new EditorGUILayout.HorizontalScope(EditorStyles.textField))
{
if (underwaterRenderingInstalled)
{
GUI.contentColor = Color.green;
EditorGUILayout.LabelField("Installed");
}
else
{
GUI.contentColor = new Color(1f, 0.65f, 0f);
EditorGUILayout.LabelField("(Not installed)");
}
GUI.contentColor = defaultColor;
}
}
using (new EditorGUILayout.HorizontalScope())
{
EditorGUILayout.LabelField("Dynamic Effects", GUILayout.MaxWidth(EditorGUIUtility.labelWidth));
using (new EditorGUILayout.HorizontalScope(EditorStyles.textField))
{
if (dynamicEffectsInstalled)
{
GUI.contentColor = Color.green;
EditorGUILayout.LabelField("Installed");
}
else
{
GUI.contentColor = new Color(1f, 0.65f, 0f);
EditorGUILayout.LabelField("(Not installed)");
}
GUI.contentColor = defaultColor;
}
}
EditorGUILayout.Space();
EditorGUILayout.PropertyField(customIncludeDirectives);
if (customIncludeDirectives.isExpanded)
{
EditorGUILayout.HelpBox("These are defined in a HLSLINCLUDE block and apply to all passes" +
"\nMay be used to insert custom code.", MessageType.Info);
}
EditorGUILayout.PropertyField(additionalPasses);
if (additionalPasses.isExpanded)
{
EditorGUILayout.LabelField("Compiled passes:", EditorStyles.miniBoldLabel);
if (shaderData != null)
{
ShaderData.Subshader subShader = shaderData.GetSubshader(0);
int passCount = subShader.PassCount;
for (int i = 0; i < passCount; i++)
{
EditorGUILayout.LabelField($"{i}: {subShader.GetPass(i).Name}", EditorStyles.miniLabel);
}
}
}
if (EditorGUI.EndChangeCheck())
{
//Force the parameter to a matching value.
//This way, if the "auto-integration" option is used, the .meta file will be changed when using the shader in a package, spanning different projects.
//When switching a different project, the file will be seen as changed and will be re-imported, in turn applying the project-specific integration.
if (autoIntegration.boolValue)
{
fogIntegration.intValue = (int)firstIntegration.asset;
}
serializedObject.ApplyModifiedProperties();
}
this.ApplyRevertGUI();
showDependencies = EditorGUILayout.BeginFoldoutHeaderGroup(showDependencies, $"Dependencies ({importer.dependencies.Count})");
if (showDependencies)
{
this.Repaint();
using (new EditorGUILayout.VerticalScope(EditorStyles.textArea))
{
foreach (string dependency in importer.dependencies)
{
var rect = EditorGUILayout.BeginHorizontal(EditorStyles.miniLabel);
if (rect.Contains(Event.current.mousePosition))
{
EditorGUIUtility.AddCursorRect(new Rect(Event.current.mousePosition.x, Event.current.mousePosition.y, 27, 27), MouseCursor.Link);
EditorGUI.DrawRect(rect, Color.gray * (EditorGUIUtility.isProSkin ? 0.66f : 0.20f));
}
if (GUILayout.Button(dependency == string.Empty ? new GUIContent(" (Missing)", EditorGUIUtility.IconContent("console.warnicon.sml").image) : new GUIContent(" " + dependency, EditorGUIUtility.IconContent("TextAsset Icon").image),
EditorStyles.miniLabel, GUILayout.Height(20f)))
{
if (dependency != string.Empty)
{
TextAsset file = AssetDatabase.LoadAssetAtPath<TextAsset>(dependency);
EditorGUIUtility.PingObject(file);
}
}
EditorGUILayout.EndHorizontal();
}
}
EditorGUILayout.HelpBox("Should any of these files be modified/moved/deleted, this shader will also re-import", MessageType.Info);
}
EditorGUILayout.EndFoldoutHeaderGroup();
//EditorGUILayout.PropertyField(configurationState);
UI.DrawFooter();
if (shader)
{
UI.DrawNotification(ShaderUtil.ShaderHasError(shader), "Errors may be false-positives due to caching", "Clear cache", () => importer.ClearCache(true), MessageType.Warning);
}
}
void OpenGeneratedCode(bool tessellation)
{
importer = (WaterShaderImporter)target;
string filePath = $"{Application.dataPath.Replace("Assets", string.Empty)}Temp/{importer.settings.shaderName}(Generated Code).shader";
string templatePath = importer.GetTemplatePath();
string[] lines = File.ReadAllLines(templatePath);
string code = TemplateParser.CreateShaderCode(importer.GetTemplatePath(), ref lines, importer, tessellation);
File.WriteAllText(filePath, code);
if (!File.Exists(filePath))
{
Debug.LogError(string.Format("Path {0} doesn't exists", filePath));
return;
}
string externalScriptEditor = ScriptEditorUtility.GetExternalScriptEditor();
if (externalScriptEditor != "internal")
{
InternalEditorUtility.OpenFileAtLineExternal(filePath, 0);
}
else
{
Application.OpenURL("file://" + filePath);
}
}
}
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: e59f1c83d0548634b871a63644021f94
timeCreated: 1691138447
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/Inspectors/WaterShaderImporterEditor.cs
uploadId: 895866
@@ -0,0 +1,731 @@
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEditor.PackageManager;
using UnityEditor.PackageManager.Requests;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
using PackageInfo = UnityEditor.PackageManager.PackageInfo;
namespace StylizedWater3
{
//Verifies any and all project settings and states
public static class Installer
{
public class SetupItem
{
public MessageType state = MessageType.None;
public string name;
public string description;
public string actionName;
public Action action;
public SetupItem(string name)
{
this.name = name;
}
public SetupItem(string name, MessageType state)
{
this.name = name;
this.state = state;
}
public void ExecuteAction()
{
action.Invoke();
action = null;
if (state == MessageType.Error)
{
m_errorCount--;
}
else if (state == MessageType.Warning)
{
m_warningCount--;
}
state = MessageType.None;
Installer.Initialize();
}
}
public static List<SetupItem> SetupItems = new List<SetupItem>();
public static int ErrorCount
{
get => m_errorCount;
}
private static int m_errorCount;
public static int WarningCount
{
get => m_warningCount;
}
private static int m_warningCount;
public static bool HasError => ErrorCount > 0;
private static void AddItem(SetupItem item)
{
if (item.state == MessageType.Error) m_errorCount++;
else if (item.state == MessageType.Warning) m_warningCount++;
SetupItems.Add(item);
}
public static void Initialize()
{
SetupItems.Clear();
m_errorCount = 0;
m_warningCount = 0;
SetupItem unityVersion = new SetupItem(AssetInfo.VersionChecking.GetUnityVersion());
{
AssetInfo.VersionChecking.CheckUnityVersion();
unityVersion.state = MessageType.None;
unityVersion.description = $"Likely compatible and supported Unity version";
//Too old
if (AssetInfo.VersionChecking.compatibleVersion == false || AssetInfo.VersionChecking.supportedPatchVersion == false)
{
unityVersion.state = MessageType.Error;
unityVersion.description = $"This version of Unity is not compatible and is not subject to support. Update to at least <b>{AssetInfo.VersionChecking.MinRequiredUnityVersion}</b>. Errors and issues need to be resolved locally";
}
else
{
//Too broken
if (AssetInfo.VersionChecking.unityVersionType != AssetInfo.VersionChecking.UnityVersionType.Release)
{
unityVersion.state = MessageType.Warning;
unityVersion.description = "Alpha/preview versions of Unity are not supported. Shader/script errors or warnings may occur depending on which weekly-version you are using." +
"\n\n" +
"After the release version becomes available, compatibility will be verified and an update may follow with the necessary fixes/changes.";
}
//Too new
if (AssetInfo.VersionChecking.supportedMajorVersion == false)
{
unityVersion.state = MessageType.Warning;
unityVersion.description = $"This version of Unity is not supported. An upgrade version of this asset that does support this may be available. See the documentation for up-to-date information.";
}
}
}
AddItem(unityVersion);
AssetInfo.VersionChecking.CheckForUpdate();
SetupItem assetVersion = new SetupItem($"Asset version ({AssetInfo.INSTALLED_VERSION})");
{
//Testing
//AssetInfo.VersionChecking.compatibleVersion = false;
//AssetInfo.VersionChecking.alphaVersion = true;
//AssetInfo.VersionChecking.UPDATE_AVAILABLE = false;
if (AssetInfo.VersionChecking.UPDATE_AVAILABLE)
{
assetVersion.state = MessageType.Info;
assetVersion.description = $"An updated version is available (v{AssetInfo.VersionChecking.LATEST_VERSION})" +
"\n\n" +
"Asset can be updated through the Package Manager. Please update any extensions as well!";
assetVersion.actionName = "Open Package Manager";
assetVersion.action = AssetInfo.OpenInPackageManager;
}
else
{
assetVersion.state = MessageType.None;
assetVersion.description = "Installed version is the latest";
}
}
AddItem(assetVersion);
SetupItem graphicsAPI = new SetupItem($"Graphics API ({PlayerSettings.GetGraphicsAPIs(EditorUserBuildSettings.activeBuildTarget)[0].ToString()})");
{
graphicsAPI.state = MessageType.None;
graphicsAPI.description = $"Compatible";
}
AddItem(graphicsAPI);
SetupItem colorSpace = new SetupItem($"Color space ({PlayerSettings.colorSpace.ToString()})");
{
if (PlayerSettings.colorSpace == ColorSpace.Linear)
{
colorSpace.state = MessageType.None;
colorSpace.description = $"Linear";
}
else
{
colorSpace.state = MessageType.Warning;
colorSpace.description = $"All content is authored for the Linear color space, water colors will not look as advertised.";
}
}
AddItem(colorSpace);
/*
//Also counts non-script related errors!
SetupItem compileErrors = new SetupItem("Script compilation");
{
ConsoleWindowUtility.GetConsoleLogCounts(out var errors, out var _, out var _);
if (errors > 0)
{
compileErrors.state = MessageType.Error;
compileErrors.description = "Your project has one or more script compilation errors. These can prevent the water shader from working, or components from being available!";
}
else
{
compileErrors.state = MessageType.None;
compileErrors.description = "Project is free of script compilation errors";
}
AddItem(compileErrors);
}
*/
SetupItem shaderCompiler = new SetupItem("Shader Compiler");
{
Shader defaultShader = ShaderConfigurator.GetDefaultShader();
var shaderCompiled = defaultShader != null;
shaderCompiler.state = shaderCompiled ? MessageType.Error : MessageType.None;
//Shader object created
if (shaderCompiled)
{
shaderCompiler.state = MessageType.None;
shaderCompiler.description = "Shader compiled without any errors";
ShaderMessage[] shaderErrors = ShaderConfigurator.GetErrorMessages(defaultShader);
//Compiled with errors
if (shaderErrors != null && shaderErrors.Length > 0)
{
shaderCompiler.state = MessageType.Error;
shaderCompiler.description = "Water shader has one or more critical errors:\n";
for (int i = 0; i < shaderErrors.Length; i++)
{
shaderCompiler.description += "\n• " + $"{shaderErrors[i].message} (line:{shaderErrors[i].line})";
}
shaderCompiler.description += "\n\nThese messages may provide a clue as to what went wrong";
shaderCompiler.actionName = "Try recompiling";
shaderCompiler.action = () =>
{
string defaultShaderPath = AssetDatabase.GUIDToAssetPath(ShaderConfigurator.DEFAULT_SHADER_GUID);
AssetDatabase.ImportAsset(defaultShaderPath);
};
}
//Success
else
{
WaterShaderImporter importer = WaterShaderImporter.GetForShader(defaultShader);
bool requiresRecompile = importer.RequiresRecompilation(out var recompileMessage);
if (requiresRecompile)
{
shaderCompiler.state = MessageType.Warning;
shaderCompiler.description = "Water shader needs to be recompiled:" +
"\n" +
recompileMessage +
"\n";
shaderCompiler.actionName = "Recompile";
shaderCompiler.action = () =>
{
importer.Reimport();
};
}
//Shader is valid, but also check if any water meshes have a pink shader
{
Shader errorShader = Shader.Find("Hidden/InternalErrorShader");
List<Material> brokenWaterMaterials = new List<Material>();
foreach (WaterObject obj in WaterObject.Instances)
{
if(obj.material == null) continue;
if (obj.material.shader == null)
{
brokenWaterMaterials.Add(obj.material);
}
else if (obj.material.shader == errorShader)
{
brokenWaterMaterials.Add(obj.material);
}
}
//Remove duplicates
brokenWaterMaterials = brokenWaterMaterials.Distinct().ToList();
if (brokenWaterMaterials.Count > 0)
{
SetupItem waterObjectShaderError = new SetupItem("Water Objects with invalid material");
waterObjectShaderError.state = MessageType.Error;
waterObjectShaderError.description = "One or more water objects in the scene have an invalid material and likely render as pink:";
for (int i = 0; i < brokenWaterMaterials.Count; i++)
{
waterObjectShaderError.description += $"\n• {brokenWaterMaterials[i].name}";
}
waterObjectShaderError.description += "\n\nIt could be that the shader wasn't able to compile at some point and Unity assigned these materials the error-shader.";
waterObjectShaderError.actionName = "Fix";
waterObjectShaderError.action = () =>
{
for (int i = 0; i < brokenWaterMaterials.Count; i++)
{
brokenWaterMaterials[i].shader = defaultShader;
EditorUtility.SetDirty(brokenWaterMaterials[i]);
}
};
AddItem(waterObjectShaderError);
}
}
}
}
else
{
shaderCompiler.state = MessageType.Error;
shaderCompiler.description = "Shader failed to compile. Please ensure that there are no unresolved scripting compilation errors in the project." +
"\n\n" +
"After resolving them, re-import this asset";
}
AddItem(shaderCompiler);
}
SetupItem renderFeature = new SetupItem("Render Feature");
{
PipelineUtilities.RenderFeatureMissing<StylizedWaterRenderFeature>(out ScriptableRendererData[] renderers);
if (renderers.Length > 0)
{
renderFeature.state = MessageType.Error;
renderFeature.description = "The Stylized Water render feature hasn't been added to these renderers:";
for (int i = 0; i < renderers.Length; i++)
{
renderFeature.description += $"\n• {renderers[i].name}";
}
renderFeature.description += "\n\nThe following functionality will be unavailable if they are active:\n" +
"\n• Directional caustics" +
"\n• Screen-space Reflections" +
"\n• Water Decals" +
"\n• Height query system" +
"\n• Dynamic Effects (if installed)" +
"\n• Underwater Rendering (if installed)";
renderFeature.description += "\n\nFor some use cases this is intentional and this warning can be ignored";
renderFeature.actionName = "Add to renderers";
renderFeature.action = () =>
{
for (int i = 0; i < renderers.Length; i++)
{
PipelineUtilities.AddRenderFeature<StylizedWaterRenderFeature>(renderers[i]);
}
};
}
else
{
renderFeature.state = MessageType.None;
renderFeature.description = "Render feature has been set up on all renderers";
SetupItem renderGraph = new SetupItem("Render Graph", PipelineUtilities.RenderGraphEnabled() ? MessageType.None : MessageType.Error);
{
if (renderGraph.state == MessageType.Error)
{
renderGraph.description = "Disabled (Backwards Compatibility mode). The render feature (and its functionality) will be unavailable!";
renderGraph.actionName = "Enable";
renderGraph.action = () =>
{
PipelineUtilities.SetRenderGraphCompatibilityMode(false);
};
}
else
{
renderGraph.state = MessageType.None;
renderGraph.description = "Render Graph is enabled";
}
AddItem(renderGraph);
}
SetupItem heightPrePass = new SetupItem("Height Pre-Pass");
{
StylizedWaterRenderFeature currentRenderFeature = StylizedWaterRenderFeature.GetDefault();
if (currentRenderFeature.heightPrePassSettings.enable)
{
heightPrePass.state = MessageType.None;
heightPrePass.description = "Enabled on the default renderer";
}
else
{
heightPrePass.state = MessageType.Warning;
heightPrePass.description = "Disabled on the default renderer. This makes the following functionality unavailable:" +
"\n • Water Decals" +
"\n • GPU-based height readback";
heightPrePass.actionName = "Enable";
heightPrePass.action = () =>
{
currentRenderFeature = StylizedWaterRenderFeature.GetDefault();
currentRenderFeature.heightPrePassSettings.enable = true;
EditorUtility.SetDirty(currentRenderFeature);
};
}
AddItem(heightPrePass);
}
}
AddItem(renderFeature);
}
SetupItem depthTexture = new SetupItem("Depth texture");
{
depthTexture.state = PipelineUtilities.IsDepthTextureOptionDisabledAnywhere(out var depthLessRenderers) ? MessageType.Warning : MessageType.None;
if (depthTexture.state == MessageType.Warning)
{
depthTexture.description = "Depth texture option is disabled these renderers:\n";
for (int i = 0; i < depthLessRenderers.Count; i++)
{
depthTexture.description += "• " + depthLessRenderers[i].name + "\n";
}
depthTexture.description += "\nThis will cause depth-based effects (when enabled) such as underwater fog, caustics or refraction not to render on certain quality levels or platforms. On Android the water will turn invisible!";
depthTexture.actionName = "Enable";
depthTexture.action = () =>
{
PipelineUtilities.SetDepthTextureOnAllAssets(true);
};
}
else
{
depthTexture.description = "Enabled on all renderers";
}
AddItem(depthTexture);
}
SetupItem opaqueTexture = new SetupItem("Refraction support");
{
opaqueTexture.state = PipelineUtilities.IsOpaqueTextureOptionDisabledAnywhere(out var opaqueLessRenderers) ? MessageType.Warning : MessageType.None;
if (opaqueTexture.state == MessageType.Warning)
{
opaqueTexture.description = "Opaque texture option is disabled these renderers:\n";
for (int i = 0; i < opaqueLessRenderers.Count; i++)
{
opaqueTexture.description += "• " + opaqueLessRenderers[i].name + "\n";
}
opaqueTexture.description += "\nThis will cause water materials with Refraction enabled to have a gray tint and not show any color of submerged geometry!";
opaqueTexture.actionName = "Enable";
opaqueTexture.action = () =>
{
PipelineUtilities.SetOpaqueTextureOnAllAssets(true);
};
}
else
{
opaqueTexture.description = "Opaque texture option is enabled on all renderers";
SetupItem opaqueDownsampled = new SetupItem("Opaque texture resolution");
{
opaqueDownsampled.state = PipelineUtilities.IsOpaqueDownSampled(out var downsampledRenderers) ? MessageType.Warning : MessageType.None;
if (opaqueDownsampled.state == MessageType.Warning)
{
opaqueDownsampled.description = "Opaque texture resolution is halved on these renderers:\n";
for (int i = 0; i < downsampledRenderers.Count; i++)
{
opaqueDownsampled.description += "• " + downsampledRenderers[i].name + "\n";
}
opaqueDownsampled.description += "\nThis will cause water materials with Refraction enabled to appear blurry!";
opaqueDownsampled.description += "\n\nUnderwater rendering will also appear blurred with visible outlines around geometry!";
opaqueDownsampled.actionName = "Switch to full resolution";
opaqueDownsampled.action = () =>
{
PipelineUtilities.DisableOpaqueDownsampling(downsampledRenderers);
};
}
else
{
opaqueDownsampled.description = "Opaque texture is rendering at full resolution";
}
AddItem(opaqueDownsampled);
}
}
AddItem(opaqueTexture);
}
SetupItem depthMode = new SetupItem("Depth mode");
{
bool hasIncorrectRenderers = PipelineUtilities.IsDepthAfterTransparents(out List<UniversalRendererData> renderers);
if (hasIncorrectRenderers)
{
depthMode.state = MessageType.Warning;
depthMode.description = "The depth texture is configured to render AFTER transparent materials on these renderers:";
for (int i = 0; i < renderers.Count; i++)
{
depthMode.description += $"\n• {renderers[i].name}";
}
depthMode.description += "\n\nThis can cause the water to appear semi-transparent, or the depth information to lag behind one frame.";
depthMode.actionName = "Set to render before";
depthMode.action = () =>
{
for (int i = 0; i < renderers.Count; i++)
{
renderers[i].copyDepthMode = CopyDepthMode.AfterOpaques;
EditorUtility.SetDirty(renderers[i]);
}
};
}
else
{
depthMode.state = MessageType.None;
depthMode.description = "The depth texture renders before transparent materials do.";
}
AddItem(depthMode);
}
if (StylizedWaterEditor.DynamicEffectsInstalled())
{
SetupItem splinesPackage = new SetupItem("Splines Package");
var splinesInstalled = true;
#if !SPLINES
splinesInstalled = false;
#endif
if (splinesInstalled)
{
splinesPackage.state = MessageType.None;
splinesPackage.description = "Installed";
}
else
{
splinesPackage.state = MessageType.Warning;
splinesPackage.description = "Splines package not installed. Some functionality won't be available.";
splinesPackage.actionName = "Install";
splinesPackage.action = () =>
{
InstallPackage("com.unity.splines");
};
}
AddItem(splinesPackage);
}
SetupItem reflectionProbes = new SetupItem("Reflection Probes");
{
if (QualitySettings.realtimeReflectionProbes)
{
reflectionProbes.state = MessageType.None;
reflectionProbes.description = "Realtime reflection probes are supported.";
}
else
{
reflectionProbes.state = MessageType.Warning;
reflectionProbes.description = "Realtime reflection probes are disabled in Quality Settings. Water reflections may appear black in demo scenes.";
reflectionProbes.actionName = "Enable";
reflectionProbes.action = () =>
{
QualitySettings.realtimeReflectionProbes = true;
};
}
AddItem(reflectionProbes);
}
SetupItem asyncShaderCompilation = new SetupItem("Asynchronous Shader Compilation");
{
if (EditorSettings.asyncShaderCompilation)
{
asyncShaderCompilation.state = MessageType.None;
asyncShaderCompilation.description = "Enabled in project settings";
}
else
{
asyncShaderCompilation.state = MessageType.Error;
asyncShaderCompilation.description = "Disabled in project settings. This will cause the editor to crash when attempting to compile the water shader";
asyncShaderCompilation.actionName = "Enable";
asyncShaderCompilation.action = () =>
{
EditorSettings.asyncShaderCompilation = true;
};
}
AddItem(asyncShaderCompilation);
}
if (WaterObject.Instances.Count > 0)
{
SetupItem waterLayer = new SetupItem("Objects on the \"Water\" layer");
{
int waterLayerIndex = LayerMask.NameToLayer("Water");
List<WaterObject> invalidObjects = new List<WaterObject>();
foreach (var obj in WaterObject.Instances)
{
if (obj.gameObject.layer != waterLayerIndex)
{
invalidObjects.Add(obj);
}
}
var invalidObjCount = invalidObjects.Count;
if (invalidObjCount > 0)
{
waterLayer.state = MessageType.Warning;
waterLayer.description = $"{invalidObjCount} water object(s) are not on the \"Water\" layer:";
foreach (var obj in invalidObjects)
{
waterLayer.description += $"\n• {obj.name}";
}
waterLayer.description += "\n\n This will result in them not being accessible for height queries";
waterLayer.actionName = "Fix";
waterLayer.action = () =>
{
foreach (var obj in invalidObjects)
{
obj.gameObject.layer = waterLayerIndex;
EditorUtility.SetDirty(obj);
}
};
}
else
{
waterLayer.state = MessageType.None;
waterLayer.description = "All water objects in the scene are on the Water layer";
}
AddItem(waterLayer);
}
}
if (SceneView.lastActiveSceneView)
{
SetupItem sceneViewAnimations = new SetupItem("Scene view animations");
if (SceneView.lastActiveSceneView.sceneViewState.alwaysRefreshEnabled == false)
{
sceneViewAnimations.state = MessageType.Warning;
sceneViewAnimations.description = "The \"Always Refresh\" option is disabled in the scene view. Water surface animations will appear to be jumpy";
sceneViewAnimations.actionName = "Enable";
sceneViewAnimations.action = () =>
{
SceneView.lastActiveSceneView.sceneViewState.alwaysRefresh = true;
};
AddItem(sceneViewAnimations);
}
}
/*
//Test formatting
SetupItem error = new SetupItem("Error");
{
error.state = MessageType.Error;
error.description = "An error has occured";
error.actionName = "Fix";
error.action = () =>
{
};
AddItem(error);
}
SetupItem warnings = new SetupItem("Warning");
{
warnings.state = MessageType.Warning;
warnings.description = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.";
warnings.actionName = "Enable";
warnings.action = () =>
{
};
AddItem(warnings);
}
*/
//Sort to display errors first, then warnings.
SetupItems = SetupItems.OrderBy(o=> (o.state == MessageType.Info || o.state
== MessageType.None)).ToList();
}
public static void OpenWindowIfNeeded()
{
if (m_errorCount > 0 && Application.isBatchMode == false && BuildPipeline.isBuildingPlayer == false)
{
HelpWindow.ShowWindow(true);
}
}
public static void InstallPackage(string id)
{
SearchRequest request = Client.Search(id, false);
while (request.Status == StatusCode.InProgress)
{
/* Waiting... */
}
if (request.IsCompleted)
{
if (request.Result == null)
{
Debug.LogError($"Searching for package {id} failed");
return;
}
PackageInfo packageInfo = request.Result[0];
string packageName = packageInfo.name;
//Installed in project?
bool installed = packageInfo.resolvedPath != string.Empty;
if (installed)
{
Debug.Log($"{packageName} is already installed");
return;
}
Debug.Log($"Installation of package \"{packageName}\" will start in a moment...");
AddRequest addRequest = Client.Add(packageInfo.name + "@" + packageInfo.versions.latestCompatible);
}
}
}
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 758e43dd4bbd4106af8f4817e1dc4832
timeCreated: 1731943756
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/Installer.cs
uploadId: 895866
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 80efacfdc732f144aa910ee5c422e086
timeCreated: 1716196788
@@ -0,0 +1,205 @@
// Stylized Water 3 by Staggart Creations (http://staggart.xyz)
// COPYRIGHT PROTECTED UNDER THE UNITY ASSET STORE EULA (https://unity.com/legal/as-terms)
// • Copying or referencing source code for the production of new asset store, or public, content is strictly prohibited!
// • Uploading this file to a public repository will subject it to an automated DMCA takedown request.
using UnityEngine;
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine.UIElements;
namespace StylizedWater3
{
[CustomPropertyDrawer(typeof(HeightQuerySystem.Interface))]
public class HeightInterfaceDrawer : PropertyDrawer
{
private bool waveProfileMismatch;
private bool renderFeatureSetup;
private bool enabled;
private void OnEnable()
{
enabled = true;
CheckRenderFeature();
}
private void CheckRenderFeature()
{
renderFeatureSetup = StylizedWaterEditor.IsRenderFeatureSetup();
}
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
if(!enabled) OnEnable();
GUILayout.Space(-GetPropertyHeight(property, label));
EditorGUILayout.LabelField("Water Height Interface", EditorStyles.boldLabel);
var methodProperty = property.FindPropertyRelative("method");
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(methodProperty);
if (EditorGUI.EndChangeCheck())
{
CheckRenderFeature();
}
if (methodProperty.intValue == (int)HeightQuerySystem.Interface.Method.CPU)
{
EditorGUILayout.Separator();
EditorGUI.BeginChangeCheck();
EditorGUI.indentLevel++;
var waterObject = property.FindPropertyRelative("waterObject");
var autoFind = property.FindPropertyRelative("autoFind");
using (new EditorGUI.DisabledScope(autoFind.boolValue))
{
EditorGUILayout.PropertyField(waterObject);
}
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(autoFind);
EditorGUI.indentLevel--;
var waveProfile = property.FindPropertyRelative("waveProfile");
EditorGUILayout.PropertyField(waveProfile);
if (waveProfile.objectReferenceValue == null)
{
if (waterObject.objectReferenceValue)
{
UI.DrawNotification(true, "A wave profile must assigned", "Try get", () =>
{
waveProfile.objectReferenceValue = WaveProfileEditor.LoadFromWaterObject(waterObject.objectReferenceValue as WaterObject);
}, MessageType.Error);
}
else
{
UI.DrawNotification("A wave profile must assigned", MessageType.Error);
}
}
else
{
if (waveProfileMismatch)
{
UI.DrawNotification(true, "The wave profile does not match the one used on the water material." +
"\n\nWave animations will likely appear out of sync", "Attempt fix",() =>
{
WaterObject obj = (WaterObject)waterObject.objectReferenceValue;
waveProfile.objectReferenceValue = WaveProfileEditor.LoadFromMaterial(obj.material);
}, MessageType.Warning);
}
}
var waterLevelSource = property.FindPropertyRelative("waterLevelSource");
EditorGUILayout.PropertyField(waterLevelSource);
if (waterLevelSource.intValue == (int)HeightQuerySystem.Interface.WaterLevelSource.FixedValue)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(property.FindPropertyRelative("waterLevel"));
EditorGUI.indentLevel--;
}
EditorGUI.indentLevel--;
if (EditorGUI.EndChangeCheck())
{
waveProfileMismatch = false;
if (waveProfile.objectReferenceValue && waterObject.objectReferenceValue)
{
WaveProfile profile = (WaveProfile)waveProfile.objectReferenceValue;
WaterObject obj = (WaterObject)waterObject.objectReferenceValue;
WaveProfile materialProfile = WaveProfileEditor.LoadFromMaterial(obj.material);
waveProfileMismatch = materialProfile != profile;
}
}
}
else
{
#if UNITY_WEBGL
UI.DrawNotification("This technique is not supported on the WebGL/WebGPU platform." +
"\n\n" +
"It does not support asynchronous compute shaders, which this functionality relies on.", MessageType.Error);
#endif
UI.DrawRenderFeatureSetupError(ref renderFeatureSetup);
if (Application.isPlaying == false && HeightQuerySystem.DISABLE_IN_EDIT_MODE)
{
UI.DrawNotification("GPU height queries have been disabled while in edit mode. You'll find this option on the render feature", MessageType.Warning);
}
if (Application.isPlaying && Camera.main == null)
{
UI.DrawNotification("No main camera found, water height will not be correct. Ensure a camera has the \"MainCamera\" tag.", MessageType.Error);
}
using (new EditorGUILayout.HorizontalScope())
{
EditorGUILayout.LabelField("");
if (GUILayout.Button(new GUIContent(" Inspect Queries", EditorGUIUtility.FindTexture("_Help"))))
{
HeightQuerySystemEditor.HeightQueryInspector.Open();
}
}
}
}
/*
private PropertyField waterObjectField;
private PropertyField waveProfileField;
public override VisualElement CreatePropertyGUI(SerializedProperty property)
{
// Create property container element.
var container = new VisualElement();
Label headerLabel = new Label("Height interface");
container.Add(headerLabel);
var methodProperty = property.FindPropertyRelative("method");
// Create property fields.
var methodField = new PropertyField(methodProperty);
methodField.RegisterValueChangeCallback(OnMethodChange);
waterObjectField = new PropertyField(property.FindPropertyRelative("waterObject"));
var autoFindProperty = property.FindPropertyRelative("autoFind");
var autoFind = new PropertyField(autoFindProperty, "Auto find");
waveProfileField = new PropertyField(property.FindPropertyRelative("waveProfile"));
autoFind.RegisterValueChangeCallback(OnAutoFindChange);
// Add fields to the container.
container.Add(methodField);
container.Add(waterObjectField);
container.Add(autoFind);
container.Add(waveProfileField);
container.Add(new PropertyField(property.FindPropertyRelative("waterLevelSource")));
container.Add(new PropertyField(property.FindPropertyRelative("waterLevel")));
return container;
}
private void OnMethodChange(SerializedPropertyChangeEvent evt)
{
HeightQuerySystem.Interface.Method method = (HeightQuerySystem.Interface.Method)evt.changedProperty.intValue;
waterObjectField.visible = method == HeightQuerySystem.Interface.Method.CPU;
waveProfileField.visible = method == HeightQuerySystem.Interface.Method.CPU;
}
private void OnAutoFindChange(SerializedPropertyChangeEvent evt)
{
waterObjectField.SetEnabled(!evt.changedProperty.boolValue);
}
*/
}
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 76d63d50bd644766b0f1ad187f4492e7
timeCreated: 1719918895
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/PropertyDrawers/HeightInterfaceDrawer.cs
uploadId: 895866
@@ -0,0 +1,66 @@
// Stylized Water 3 by Staggart Creations (http://staggart.xyz)
// COPYRIGHT PROTECTED UNDER THE UNITY ASSET STORE EULA (https://unity.com/legal/as-terms)
// • Copying or referencing source code for the production of new asset store, or public, content is strictly prohibited!
// • Uploading this file to a public repository will subject it to an automated DMCA takedown request.
using UnityEditor;
using UnityEngine;
namespace StylizedWater3
{
//Use as "[MinMaxSlider(0, 5)]" on a material property. Proper should be a Vector type
public class MinMaxSliderDrawer : MaterialPropertyDrawer
{
private readonly float min;
private readonly float max;
private Rect minFieldRect;
private Rect sliderFieldRect;
private Rect maxFieldRect;
public MinMaxSliderDrawer(float min, float max)
{
this.min = min;
this.max = max;
}
public override void OnGUI(Rect position, MaterialProperty prop, GUIContent label, MaterialEditor editor)
{
MaterialEditor.BeginProperty(prop);
float minVal = prop.vectorValue.x;
float maxVal = prop.vectorValue.y;
EditorGUI.BeginChangeCheck();
EditorGUI.showMixedValue = prop.hasMixedValue;
Rect labelRect = position;
labelRect.width = EditorGUIUtility.labelWidth;
EditorGUI.LabelField(labelRect, label);
minFieldRect = labelRect;
minFieldRect.x = labelRect.x + labelRect.width;
minFieldRect.width = EditorGUIUtility.fieldWidth;
minVal = EditorGUI.FloatField(minFieldRect, minVal);
sliderFieldRect = labelRect;
sliderFieldRect.x = minFieldRect.x + minFieldRect.width + 5f;
sliderFieldRect.width = position.width - (EditorGUIUtility.fieldWidth * 2f) - labelRect.width - 10f;
EditorGUI.MinMaxSlider(sliderFieldRect, ref minVal, ref maxVal, min, max);
maxFieldRect = labelRect;
maxFieldRect.x = sliderFieldRect.x + sliderFieldRect.width + 5f;
maxFieldRect.width = EditorGUIUtility.fieldWidth;
maxVal = EditorGUI.FloatField(maxFieldRect, maxVal);
if (EditorGUI.EndChangeCheck())
{
prop.vectorValue = new Vector4(minVal, maxVal);
}
EditorGUI.showMixedValue = false;
MaterialEditor.EndProperty();
}
}
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: cf68eb48df7045e6ab979eeb7dd25215
timeCreated: 1718782193
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/PropertyDrawers/MinMaxSlider.cs
uploadId: 895866
@@ -0,0 +1,53 @@
// Stylized Water 3 by Staggart Creations (http://staggart.xyz)
// COPYRIGHT PROTECTED UNDER THE UNITY ASSET STORE EULA (https://unity.com/legal/as-terms)
// • Copying or referencing source code for the production of new asset store, or public, content is strictly prohibited!
// • Uploading this file to a public repository will subject it to an automated DMCA takedown request.
using System;
using UnityEditor;
using UnityEngine;
namespace StylizedWater3
{
public class WaveProfileDrawer : MaterialPropertyDrawer
{
private const float EDIT_BTN_WIDTH = 50f;
public override void OnGUI (Rect position, MaterialProperty prop, String label, MaterialEditor editor)
{
MaterialEditor.BeginProperty(prop);
// Setup
WaveProfile profile = WaveProfileEditor.LoadFromLUT(prop.textureValue);
EditorGUI.BeginChangeCheck();
EditorGUI.showMixedValue = prop.hasMixedValue;
Rect labelRect = position;
labelRect.width = EditorGUIUtility.labelWidth + 37;
EditorGUI.LabelField(labelRect, label);
Rect fieldRect = position;
fieldRect.x = labelRect.width;
fieldRect.width = (EditorGUIUtility.fieldWidth * 4f) - EDIT_BTN_WIDTH;
profile = (WaveProfile)EditorGUI.ObjectField(fieldRect, profile, typeof(WaveProfile), false);
Rect editBtnRect = position;
editBtnRect.x = fieldRect.x + fieldRect.width;
editBtnRect.width = EDIT_BTN_WIDTH;
if (GUI.Button(editBtnRect, "Edit"))
{
Selection.activeObject = WaveProfileEditor.LoadFromLUT(prop.textureValue);
}
EditorGUI.showMixedValue = false;
if (EditorGUI.EndChangeCheck())
{
prop.textureValue = profile.shaderParametersLUT;
}
MaterialEditor.EndProperty();
}
}
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 4d2ada3c8d25ab44ebe13baf27cd9427
timeCreated: 1716196796
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/PropertyDrawers/WaveProfileDrawer.cs
uploadId: 895866
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c930fe87ed5a85d4fbeabe2b7c876659
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

@@ -0,0 +1,154 @@
fileFormatVersion: 2
guid: 22661e393f063dd4085f7fe57377fbc7
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 1
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/Resources/water-object-icon.png
uploadId: 895866
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

@@ -0,0 +1,154 @@
fileFormatVersion: 2
guid: 6029dbabe4690f0489934aee6b44ec4a
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 1
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/Resources/water-shader-icon.png
uploadId: 895866
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

@@ -0,0 +1,124 @@
fileFormatVersion: 2
guid: 0c0ecf1cb80894043a5dd86626f73513
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/Resources/wave-profile-icon.png
uploadId: 895866
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 224b51d419be4102913e055f9be99871
timeCreated: 1729855785
File diff suppressed because one or more lines are too long
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 3a3be5417b7946088b3cbec887cf0dfe
timeCreated: 1729855911
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/Shader/FogIntegration.cs
uploadId: 895866
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: f6df0d541f8b14642985c92afdb9f538
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/Shader/MaterialUI.cs
uploadId: 895866
@@ -0,0 +1,327 @@
// Stylized Water 3 by Staggart Creations (http://staggart.xyz)
// COPYRIGHT PROTECTED UNDER THE UNITY ASSET STORE EULA (https://unity.com/legal/as-terms)
// • Copying or referencing source code for the production of new asset store, or public, content is strictly prohibited!
// • Uploading this file to a public repository will subject it to an automated DMCA takedown request.
#if SWS_DEV
#define ENABLE_SHADER_STRIPPING_LOG
#endif
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Rendering;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Serialization;
using Debug = UnityEngine.Debug;
using Object = UnityEngine.Object;
using Random = UnityEngine.Random;
#if URP
using UnityEngine.Rendering.Universal;
#endif
namespace StylizedWater3
{
public static class ShaderConfigurator
{
public const string DEFAULT_SHADER_GUID = "823f6b206953b674a9a64f9e3ec57752";
public static Shader GetDefaultShader()
{
string defaultShaderPath = AssetDatabase.GUIDToAssetPath(DEFAULT_SHADER_GUID);
Shader defaultShader = AssetDatabase.LoadAssetAtPath<Shader>(defaultShaderPath);
return defaultShader;
}
public static ShaderMessage[] GetErrorMessages(Shader shader)
{
ShaderMessage[] messages = null;
int n = ShaderUtil.GetShaderMessageCount(shader);
if (n < 1) return messages;
messages = ShaderUtil.GetShaderMessages(shader);
//Filter for errors
messages = messages.Where(x => x.severity == ShaderCompilerMessageSeverity.Error).ToArray();
return messages;
}
#if URP
//Strips keywords from the shader for features belonging to newer URP versions.
private class KeywordStripper : IPreprocessShaders
{
private const string LOG_FILEPATH = "Logs/Stylized Water 3 Compilation.log";
#if ENABLE_SHADER_STRIPPING_LOG
private System.Diagnostics.Stopwatch m_stripTimer = new System.Diagnostics.Stopwatch();
#endif
private List<ShaderKeyword> StrippedKeywords = new List<ShaderKeyword>();
//URP 18+
private readonly ShaderKeyword _TEST = new ShaderKeyword("_TEST");
private readonly bool heightPrePassEnabled;
#if SWS_DEV
[MenuItem("SWS/Debug/HeightPrePassEnabled")]
#endif
private static bool HeightPrePassEnabled()
{
bool state = false;
if (StylizedWaterRenderFeature.RequireHeightPrePass) return true;
//Check if the displacement pre-pass is enabled anywhere
for (int i = 0; i < GraphicsSettings.allConfiguredRenderPipelines.Length; i++)
{
UniversalRenderPipelineAsset pipeline = (UniversalRenderPipelineAsset)GraphicsSettings.allConfiguredRenderPipelines[i];
ScriptableRendererData[] renderers = PipelineUtilities.GetRenderDataList(pipeline);
for (int j = 0; j < renderers.Length; j++)
{
StylizedWaterRenderFeature renderFeature = (StylizedWaterRenderFeature)PipelineUtilities.GetRenderFeature<StylizedWaterRenderFeature>(renderers[j]);
if (renderFeature)
{
state |= renderFeature.heightPrePassSettings.enable;
#if SWS_DEV
//Debug.Log($"{renderers[j].name}. Enable?:{renderFeature.heightPrePassSettings.enable}");
#endif
}
}
}
#if SWS_DEV
//Debug.Log("Height pre-pass enabled somewhere: " + state);
#endif
return state;
}
//Note: Constructor is called once, when building starts
public KeywordStripper()
{
if (PlayerSettings.GetGraphicsAPIs(EditorUserBuildSettings.activeBuildTarget)[0] == GraphicsDeviceType.OpenGLES3)
{
if (UniversalRenderPipeline.asset.msaaSampleCount > 1)
{
Debug.LogWarning("[Stylized Water 3] You are deploying a build using the OpenGLES 3.0 graphics API with MSAA enabled (in your URP pipeline asset). Due to a bug in some graphics chips, transparent materials (including the water) will not render. " +
"Disable MSAA, or use the Vulkan graphics API", UniversalRenderPipeline.asset);
}
}
#if UNITY_6000_1_OR_NEWER
if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.WebGL && UniversalRenderPipeline.asset.lightProbeSystem == LightProbeSystem.ProbeVolumes)
{
if (PlayerSettings.GetGraphicsAPIs(EditorUserBuildSettings.activeBuildTarget)[0] ==
GraphicsDeviceType.WebGPU)
{
Debug.LogWarning("[Stylized Water 3] WebGL builds using the WebGPU graphics API do not support Adaptive Probe Volumes. Shader will fall back to standard SH/Light Probes.");
}
}
#endif
//Check if the displacement pre-pass is enabled anywhere
heightPrePassEnabled = HeightPrePassEnabled();
StrippedKeywords.Clear();
if (!heightPrePassEnabled)
{
StrippedKeywords.Add(new ShaderKeyword(ShaderParams.Keywords.WaterHeightPass));
}
//Note: Keywords for extensions are only injected through the shader generator. Hence they don't need to be stripped
#if !UNITY_6000_0_OR_NEWER
StrippedKeywords.Add(_TEST);
#endif
LogInitialization();
}
public int callbackOrder => 0;
public void OnProcessShader(Shader shader, ShaderSnippetData snippet, IList<ShaderCompilerData> compilerDataList)
{
#if URP
if (UniversalRenderPipeline.asset == null || compilerDataList == null || compilerDataList.Count == 0) return;
//Only run for specific shaders
if (shader.name.Contains("Stylized Water 3") == false) return;
LogStart(shader, snippet, compilerDataList);
var inputShaderVariantCount = compilerDataList.Count;
for (int i = 0; i < inputShaderVariantCount;)
{
//If any of the excluded keywords are enabled in this variant, strip it
bool removeInput = StripUnused(shader, compilerDataList[i], snippet);
// Remove at swap back
if (removeInput)
compilerDataList[i] = compilerDataList[--inputShaderVariantCount];
else
++i;
}
if (compilerDataList is List<ShaderCompilerData> inputDataList)
{
inputDataList.RemoveRange(inputShaderVariantCount, inputDataList.Count - inputShaderVariantCount);
}
else
{
for (int i = compilerDataList.Count - 1; i >= inputShaderVariantCount; --i)
compilerDataList.RemoveAt(i);
}
LogStrippingEnd(compilerDataList.Count);
#endif
}
private bool StripUnused(Shader shader, ShaderCompilerData compilerData, ShaderSnippetData snippet)
{
if (StripPass(shader, snippet))
{
return true;
}
foreach (var keyword in StrippedKeywords)
{
if (StripKeyword(shader, keyword, compilerData, snippet))
{
return true;
}
}
return false;
}
private bool StripPass(Shader shader, ShaderSnippetData snippet)
{
if (heightPrePassEnabled == false && snippet.passName == ShaderParams.Passes.HeightPrePass)
{
Log($"- Stripped Pass {snippet.passName} ({shader.name}) (Stage: {snippet.shaderType})");
return true;
}
return false;
}
private bool StripKeyword(Shader shader, ShaderKeyword keyword, ShaderCompilerData compilerData, ShaderSnippetData snippet)
{
if (compilerData.shaderKeywordSet.IsEnabled(keyword))
{
LogStripping(shader, keyword, snippet);
return true;
}
return false;
}
#region Logging
struct StrippingLog
{
public Shader shader;
public ShaderKeyword keyword;
public string passName;
public ShaderType shaderType;
}
private void LogInitialization()
{
#if ENABLE_SHADER_STRIPPING_LOG
//Clear log file first
File.WriteAllLines(LOG_FILEPATH, new string[] {});
Log("KeywordStripper initialized...", true);
Log(string.Empty);
Log($"Displacement Pre-pass enabled in build: {heightPrePassEnabled}", true);
Log(string.Empty);
for (int i = 0; i < StrippedKeywords.Count; i++)
{
Log($"• {StrippedKeywords[i].name} keyword to be stripped");
}
Log($"{StrippedKeywords.Count} total keywords to be stripped");
#endif
}
private void LogStart(Shader shader, ShaderSnippetData snippet, IList<ShaderCompilerData> compilerDataList)
{
#if ENABLE_SHADER_STRIPPING_LOG
m_stripTimer.Start();
var text = $"OnProcessShader running for {shader.name}. (Pass: {snippet.passName}) (Stage: {snippet.shaderType}). Num variants: {compilerDataList.Count}";
Log(text, true);
#endif
}
StrippingLog prevLog;
private void LogStripping(Shader shader, ShaderKeyword keyword, ShaderSnippetData snippet)
{
#if ENABLE_SHADER_STRIPPING_LOG
//Try to avoid spamming the log with duplicates, this otherwise slows down compilation to a crawl
if (prevLog.keyword.index == keyword.index && prevLog.shader == shader && prevLog.passName == snippet.passName && prevLog.shaderType == snippet.shaderType)
{
//File.AppendAllText(LOG_FILEPATH, "- Skipping log!\n" );
return;
}
prevLog.shader = shader;
prevLog.keyword = keyword;
prevLog.passName = snippet.passName;
prevLog.shaderType = snippet.shaderType;
var text = $"- Stripped {keyword.name} ({shader.name}) variant. (Pass {snippet.passName}) (Stage: {snippet.shaderType})";
Log(text);
#endif
}
private void LogStrippingEnd(int count)
{
#if ENABLE_SHADER_STRIPPING_LOG
m_stripTimer.Stop();
System.TimeSpan stripTimespan = m_stripTimer.Elapsed;
var text = $"Stripping took {stripTimespan.Minutes}m{stripTimespan.Seconds}s ({stripTimespan.Milliseconds}ms). Remaining variants to compile: {count}";
Log(text);
m_stripTimer.Reset();
#endif
}
private void Log(string text, bool newLine = false)
{
#if ENABLE_SHADER_STRIPPING_LOG
File.AppendAllText(LOG_FILEPATH, (newLine ? "\n" : "") + text + "\n");
#endif
}
#endregion
}
#endif
}
}
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: c05c2f42980e1b649a1c2cd783b30b58
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/Shader/ShaderConfigurator.cs
uploadId: 895866
@@ -0,0 +1,484 @@
// Stylized Water 3 by Staggart Creations (http://staggart.xyz)
// COPYRIGHT PROTECTED UNDER THE UNITY ASSET STORE EULA (https://unity.com/legal/as-terms)
// • Copying or referencing source code for the production of new asset store, or public, content is strictly prohibited!
// • Uploading this file to a public repository will subject it to an automated DMCA takedown request.
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using UnityEditor;
using Object = UnityEngine.Object;
namespace StylizedWater3
{
public static class TemplateParser
{
public const int SHADER_GENERATOR_VERSION_MAJOR = 5;
public const int SHADER_GENERATOR_MINOR = 1;
public const int SHADER_GENERATOR_PATCH = 3;
//Stencil mask used by water shader. Currently used for underwater rendering
//Values 1-65 are used by deferred rendering
public const int STENCIL_REF = 65;
//Converts relative include paths such as (../../Libraries/File.hlsl) to an absolute path
//Supports the source file being part of a package
public static string RelativeToAbsoluteIncludePath(string filePath, string relativePath)
{
string fileDir = Path.GetDirectoryName(filePath);
//Count how many folders should be traversed up
int levels = relativePath.Split(new[]
{
".."
}, StringSplitOptions.None).Length - 1;
string traveledPath = fileDir;
if (levels > 0)
{
for (int i = 0; i < levels; i++)
{
//Remove the number of needed sub-directories needed to reach the destination
int strimStart = traveledPath.LastIndexOf(Path.DirectorySeparatorChar);
traveledPath = traveledPath.Remove(strimStart);
}
}
//The directory without the "up" navigators
string relativeFolder = relativePath.Replace("../", string.Empty);
//Concatenate them together
string absolutePath = traveledPath + "/" + relativeFolder;
//Convert back- to forward slashes
absolutePath = absolutePath.Replace("\\", "/");
return absolutePath;
}
//Pre-process the template to inject additional template contents into it
private static void ModifyTemplate(ref string[] lines, WaterShaderImporter importer)
{
StringBuilder templateBuilder = new StringBuilder();
for (int i = 0; i < lines.Length; i++)
{
string line = lines[i];
//Inject additional passes into template
if (line.Contains("%passes%"))
{
List<Object> passes = new List<Object>(importer.settings.additionalPasses);
if (StylizedWaterEditor.UnderwaterRenderingInstalled())
{
string maskPassGUID = "46c22cecd601401a875ca4554695986f";
string maskPassPath = AssetDatabase.GUIDToAssetPath(maskPassGUID);;
Object underwaterMaskPass = AssetDatabase.LoadAssetAtPath<Object>(maskPassPath);
passes.Add(underwaterMaskPass);
}
int passCount = passes.Count;
for (int j = 0; j < passCount; j++)
{
if (passes[j] != null)
{
string filePath = AssetDatabase.GetAssetPath(passes[j]);
importer.RegisterDependency(filePath);
string[] passContexts = File.ReadAllLines(filePath);
for (int k = 0; k < passContexts.Length; k++)
{
templateBuilder.AppendLine(passContexts[k]);
}
}
}
continue;
}
templateBuilder.AppendLine(lines[i]);
}
lines = templateBuilder.ToString().Split(new[] { Environment.NewLine }, StringSplitOptions.None);
}
public static string CreateShaderCode(string templatePath, ref string[] lines, WaterShaderImporter importer, bool tessellation = false)
{
if (importer == null)
{
throw new Exception("Failed to compile shader from template code. The importer is invalid, this should not even be possible. Whatever you did, undo it...");
}
//Extension installation states
var underwaterInstalled = StylizedWaterEditor.UnderwaterRenderingInstalled();
var dynamicEffectsInstalled = StylizedWaterEditor.DynamicEffectsInstalled();
FogIntegration.Integration fogIntegration = importer.GetFogIntegration();
AssetInfo.VersionChecking.CheckUnityVersion();
//Shader name
string prefix = importer.settings.hidden ? "Hidden/" : string.Empty;
string suffix = tessellation ? ShaderParams.ShaderNames.TESSELLATION_NAME_SUFFIX : string.Empty;
string shaderName = $"{prefix}{AssetInfo.ASSET_NAME}/{importer.settings.shaderName}";
string shaderPath = importer.assetPath;
ModifyTemplate(ref lines, importer);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < lines.Length; i++)
{
//Ignore blank lines and comments for analysis
if (string.IsNullOrWhiteSpace(lines[i]) || lines[i].StartsWith("//"))
{
sb.AppendLine(lines[i]);
continue;
}
//First non-space character
int indent = System.Text.RegularExpressions.Regex.Match(lines[i], "[^-\\s]").Index;
string whitespace = lines[i].Replace(lines[i].Substring(indent), "");
//AppendLine using previous line's white spacing
void AddLine(string source)
{
sb.AppendLine(source.Insert(0, whitespace));
}
//Remove whitespaces
string line = lines[i].Remove(0, indent);
bool Matches(string source) { return string.CompareOrdinal(source, line) == 0; }
if (Matches("%asset_version%"))
{
AddLine($"//Asset version {AssetInfo.INSTALLED_VERSION}");
continue;
}
if (Matches("%compiler_version%"))
{
AddLine($"//Shader generator version: {new Version(SHADER_GENERATOR_VERSION_MAJOR, SHADER_GENERATOR_MINOR, SHADER_GENERATOR_PATCH)}");
continue;
}
if (Matches("%unity_version%"))
{
AddLine($"//Unity version: {AssetInfo.VersionChecking.GetUnityVersion()}");
continue;
}
if (Matches("%shader_name%"))
{
AddLine($"Shader \"{shaderName}{suffix}\"");
continue;
}
if (Matches("%custom_directives%"))
{
foreach (WaterShaderImporter.Directive directive in importer.settings.customIncludeDirectives)
{
if(directive.enabled == false) continue;
string directivePrefix = string.Empty;
switch (directive.type)
{
case WaterShaderImporter.Directive.Type.define:
directivePrefix = "#define ";
break;
case WaterShaderImporter.Directive.Type.include:
directivePrefix = "#include ";
break;
case WaterShaderImporter.Directive.Type.include_with_pragmas:
directivePrefix = "#include_with_pragmas ";
break;
case WaterShaderImporter.Directive.Type.pragma:
directivePrefix = "#pragma ";
break;
}
if (directive.value != string.Empty) AddLine($"{directivePrefix}{directive.value}");
}
continue;
}
if (Matches("%global_defines%"))
{
if (importer.settings.singleCausticsLayer)
{
AddLine("#define CAUSTICS_SINGLE_LAYER");
}
continue;
}
if (Matches("%pragma_target%"))
{
if (tessellation)
{
AddLine("#pragma target 4.6");
}
else
{
AddLine("#pragma target 3.0");
}
continue;
}
if (Matches("%pragma_renderers%"))
{
if (tessellation)
{
AddLine("#pragma exclude_renderers gles");
}
continue;
}
if (line.StartsWith("Fallback"))
{
if (tessellation)
{
//Fallback to non-tessellation variant (with without suffix)
AddLine($"Fallback \"{shaderName}\"");
//Test, disable fallback
//AddLine(line);
}
else
{
//Leave as is
AddLine(line);
}
continue;
}
if (Matches("%tessellation_properties%"))
{
if (tessellation)
{
AddLine("_TessValue(\"Max subdivisions\", Range(1, 64)) = 16");
AddLine("_TessMin(\"Start Distance\", Float) = 0");
AddLine("_TessMax(\"End Distance\", Float) = 15");
}
continue;
}
if (Matches("%tessellation_directives%"))
{
if (tessellation)
{
AddLine("#define TESSELLATION_ON");
AddLine("#pragma require tessellation tessHW");
AddLine("#pragma hull Hull");
AddLine("#pragma domain Domain");
}
continue;
}
if (line.Contains("%stencilID%"))
{
int stencilID = STENCIL_REF;
if (importer.settings.fogIntegration == FogIntegration.Assets.COZY)
{
}
line = line.Replace("%stencilID%", stencilID.ToString());
AddLine(line);
continue;
}
if (Matches("%stencil%"))
{
continue;
}
if (Matches("%multi_compile_light_cookies%"))
{
if (importer.settings.lightCookies)
{
AddLine("#pragma multi_compile_fragment _ _LIGHT_COOKIES");
}
continue;
}
if (line.Contains("%render_queue_offset%"))
{
int offset = 0;
switch (fogIntegration.asset)
{
//case FogIntegration.Assets.COZY: offset = 2;
//break;
//case Fog.Assets.AtmosphericHeightFog : offset = 2; //Should actually render after the fog sphere, but asset inherently relies on double fog shading it seems?
//break;
default: offset = 0;
break;
}
line = line.Replace("%render_queue_offset%", offset.ToString());
AddLine(line);
continue;
}
if (Matches("%defines%"))
{
if (importer.settings.additionalLightCaustics)
{
AddLine("#define _ADDITIONAL_LIGHT_CAUSTICS");
}
if (importer.settings.additionalLightTranslucency)
{
AddLine("#define _ADDITIONAL_LIGHT_TRANSLUCENCY");
}
continue;
}
if (Matches("%multi_compile underwater rendering%"))
{
if (underwaterInstalled)
{
importer.configurationState.underwaterRendering = true;
AddLine($"#pragma multi_compile_fragment _ {ShaderParams.Keywords.UnderwaterRendering}");
}
continue;
}
if (Matches("%multi_compile_vertex dynamic effects%"))
{
if (dynamicEffectsInstalled)
{
importer.configurationState.dynamicEffects = true;
AddLine($"#pragma multi_compile_vertex _ {ShaderParams.Keywords.DynamicEffects}");
}
continue;
}
if (Matches("%multi_compile dynamic effects%"))
{
if (dynamicEffectsInstalled)
{
importer.configurationState.dynamicEffects = true;
AddLine($"#pragma multi_compile _ {ShaderParams.Keywords.DynamicEffects}");
}
continue;
}
if (line.StartsWith("#include "))
{
string includePath = line.Replace("#include ", string.Empty);
//Remove parenthesis
includePath = includePath.Replace("\"", string.Empty);
importer.RegisterDependency(includePath);
}
if (importer.settings.type == WaterShaderImporter.WaterShaderSettings.ShaderType.WaterSurface)
{
if (Matches("%define_fog_integration%"))
{
AddLine($"#define {fogIntegration.asset.ToString()}");
if (fogIntegration.asset == FogIntegration.Assets.UnityFog)
{
AddLine("#pragma multi_compile_fog");
}
continue;
}
/* include FogLibrary */
if (Matches("%include_fog_integration_library%"))
{
//Default until otherwise valid
line = string.Empty;
//Mark the asset integration as being compiled in
importer.configurationState.fogIntegration = fogIntegration;
if (fogIntegration.asset != FogIntegration.Assets.None && fogIntegration.asset != FogIntegration.Assets.UnityFog)
{
string includePath = AssetDatabase.GUIDToAssetPath(fogIntegration.libraryGUID);
importer.RegisterDependency(includePath);
//Not found error
if (includePath == string.Empty)
{
if (EditorUtility.DisplayDialog(AssetInfo.ASSET_NAME,
fogIntegration.name + " fog shader library could not be found with the GUID \"" + fogIntegration.libraryGUID + "\".\n\n" +
"This means it was changed by the author (rare!), you deleted the \".meta\" file at some point, or the asset simply isn't installed.", "Ok"))
{
}
}
else
{
var pragma = fogIntegration.includeWithPragmas ? "include_with_pragmas" : "include";
line = $"#{pragma} \"{includePath}\"";
AddLine(line);
continue;
}
}
}
}
//Shaders created using "ShaderUtil.CreateShaderAsset" don't exist in a literal sense. Hence any relative file paths are invalid
//Convert them to absolute file paths
//Bonus: moving a shader file (or its folder) triggers it to re-import, thus always keeping the file path up-to-date
if (line.StartsWith("#include_library"))
{
string relativePath = line.Replace("#include_library ", string.Empty);
//Remove parenthesis
relativePath = relativePath.Replace("\"", string.Empty);
string includePath = RelativeToAbsoluteIncludePath(shaderPath, relativePath);
line = $"#include \"{includePath}\"";
importer.RegisterDependency(includePath);
AddLine(line);
continue;
}
//Insert whitespace back in
line = line.Insert(0, whitespace);
//Nothing special, keep whatever line this is
sb.AppendLine(line);
}
//Convert to separate lines again
lines = sb.ToString().Split(new[] { Environment.NewLine }, StringSplitOptions.None);
//Convert to single string, respecting line breaks and spacing.
return String.Join(Environment.NewLine, lines);
}
}
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 14c82c38120d418bbd44cd7c0df0778d
timeCreated: 1729855802
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/Shader/TemplateParser.cs
uploadId: 895866
@@ -0,0 +1,371 @@
// Stylized Water 3 by Staggart Creations (http://staggart.xyz)
// COPYRIGHT PROTECTED UNDER THE UNITY ASSET STORE EULA (https://unity.com/legal/as-terms)
// • Copying or referencing source code for the production of new asset store, or public, content is strictly prohibited!
// • Uploading this file to a public repository will subject it to an automated DMCA takedown request.
using UnityEditor.AssetImporters;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using UnityEditor;
using UnityEditor.Rendering;
using UnityEditorInternal;
using UnityEngine;
using UnityEngine.Rendering.Universal;
using UnityEngine.Serialization;
using Debug = UnityEngine.Debug;
using Object = UnityEngine.Object;
namespace StylizedWater3
{
[ScriptedImporter(TemplateParser.SHADER_GENERATOR_VERSION_MAJOR + TemplateParser.SHADER_GENERATOR_MINOR + TemplateParser.SHADER_GENERATOR_PATCH, TARGET_FILE_EXTENSION, 0)]
public class WaterShaderImporter : ScriptedImporter
{
private const string TARGET_FILE_EXTENSION = "watershader3";
private const string ICON_NAME = "water-shader-icon";
[Tooltip("Rather than storing the template in this file, it can be sourced from an external text file" +
"\nUse this if you intent to duplicate this asset, and need only minor modifications to its import settings")]
[SerializeField] public LazyLoadReference<Object> template;
[Space]
public WaterShaderSettings settings = new WaterShaderSettings();
/// <summary>
/// File paths of any file this shader depends on. This list will be populated with any "#include" paths present in the template
/// Registering these as dependencies is required to trigger the shader to recompile when these files are changed
/// </summary>
//[NonSerialized] //Want to keep these serialized. Will differ per-project, which also causes the file to appear as changed for every project when updating the asset (this triggers a re-import)
public List<string> dependencies = new List<string>();
[Serializable]
//Keep track of what was being compiled in
//Used to detect discrepencies between the project state, and the compiled shader
public class ConfigurationState
{
public bool underwaterRendering;
public bool dynamicEffects;
public FogIntegration.Integration fogIntegration;
public void Reset()
{
underwaterRendering = false;
dynamicEffects = false;
fogIntegration = FogIntegration.GetIntegration(FogIntegration.Assets.None);
}
}
public ConfigurationState configurationState = new ConfigurationState();
public string GetTemplatePath()
{
return template.isSet ? AssetDatabase.GetAssetPath(template.asset) : assetPath;
}
private void OnValidate()
{
if(settings.shaderName == string.Empty) settings.shaderName = $"{Application.productName} ({DateTime.Now.Ticks})";
}
public override void OnImportAsset(AssetImportContext context)
{
Shader shader = AssetDatabase.LoadAssetAtPath<Shader>(context.assetPath);
//if (shader != null) ShaderUtil.ClearShaderMessages(shader);
string templatePath = GetTemplatePath();
if (templatePath == string.Empty)
{
Debug.LogError("Failed to import water shader, template file path is null. It possibly hasn't been imported first?", shader);
return;
}
#if SWS_DEV
Stopwatch sw = new Stopwatch();
sw.Start();
#endif
string[] lines = File.ReadAllLines(templatePath);
if (lines.Length == 0)
{
Debug.LogError("Failed to generated water shader. Template or file content is empty (or wasn't yet imported)...");
return;
}
dependencies.Clear();
configurationState.Reset();
string shaderLab = TemplateParser.CreateShaderCode(context.assetPath, ref lines, this, false);
Shader shaderAsset = ShaderUtil.CreateShaderAsset(shaderLab, true);
int passCount = shaderAsset.passCount;
ShaderInfo shaderInfo = ShaderUtil.GetShaderInfo(shaderAsset);
ShaderData shaderData = ShaderUtil.GetShaderData(shaderAsset);
//Unity will always create 3 base passes: Unnamed, DepthNormalsOnly & DepthOnly
if (shaderInfo.hasErrors && shaderData.GetSubshader(0).GetPass(0).Name.Contains("Unnamed"))
{
Debug.LogError($"Failed to compile water shader at {context.assetPath}. It contains no passes. " +
$"This may happen if the shader file was imported while one or more script compile errors were present, or moving the Stylized Water 3 folder, or the meta-file was deleted. Resulting in all configurations getting wiped. To resolve this, re-import the file from the Package Manager.");
return;
}
ShaderUtil.RegisterShader(shaderAsset);
Texture2D thumbnail = Resources.Load<Texture2D>(ICON_NAME);
if(!thumbnail) thumbnail = EditorGUIUtility.IconContent("ShaderImporter Icon").image as Texture2D;
context.AddObjectToAsset("MainAsset", shaderAsset, thumbnail);
context.SetMainObject(shaderAsset);
//Do not attempt to create a tessellation variant for the underwater post-effect shaders
if (settings.type == WaterShaderSettings.ShaderType.WaterSurface)
{
//Re-read the original template again
lines = File.ReadAllLines(templatePath);
shaderLab = TemplateParser.CreateShaderCode(context.assetPath, ref lines, this, true);
Shader tessellation = ShaderUtil.CreateShaderAsset(shaderLab, true);
//ShaderUtil.RegisterShader(tessellation);
context.AddObjectToAsset("Tessellation", (Object)tessellation, thumbnail);
}
//Set up dependency, so that changes to the template triggers shaders to regenerate
if (template.isSet && AssetDatabase.TryGetGUIDAndLocalFileIdentifier(template, out var guid, out long _))
{
//Note: this strictly only works when adding the file path!
//context.DependsOnArtifact(guid);
dependencies.Insert(0, AssetDatabase.GUIDToAssetPath(guid));
}
//Dependencies are populated during the template parsing phase.
foreach (string dependency in dependencies)
{
context.DependsOnSourceAsset(dependency);
}
#if SWS_DEV
sw.Stop();
//Debug.Log($"Imported \"{Path.GetFileNameWithoutExtension(assetPath)}\" water shader in {sw.Elapsed.Milliseconds}ms. With {dependencies.Count} dependencies.", shader);
#endif
}
public bool RequiresRecompilation(out string message)
{
bool isValid = true;
var underwaterInstalled = configurationState.underwaterRendering == StylizedWaterEditor.UnderwaterRenderingInstalled();
var dynamicEffectsInstalled = configurationState.dynamicEffects == StylizedWaterEditor.DynamicEffectsInstalled();
var fogIntegration = configurationState.fogIntegration.asset == GetFogIntegration().asset;
isValid = underwaterInstalled & dynamicEffectsInstalled & fogIntegration;
message = string.Empty;
if (isValid == false)
{
if (!underwaterInstalled) message += "\nUnderwater Rendering extension installed, but not activated";
if (!dynamicEffectsInstalled) message += "\nDynamic Effects extension installed, but not activated";
if (!fogIntegration) message += $"\nFog integration does not match.\nInstalled: {configurationState.fogIntegration.name} - Detected in project: {GetFogIntegration().name}";
}
return !isValid;
}
public void Reimport()
{
this.SaveAndReimport();
}
public void ClearCache(bool recompile = false)
{
var objs = AssetDatabase.LoadAllAssetsAtPath(assetPath);
foreach (var obj in objs)
{
if (obj is Shader)
{
ShaderUtil.ClearShaderMessages((Shader)obj);
ShaderUtil.ClearCachedData((Shader)obj);
if(recompile) AssetDatabase.ImportAsset(assetPath);
#if SWS_DEV
Debug.Log($"Cleared cache for {obj.name}");
#endif
}
}
}
public void RegisterDependency(string dependencyAssetPath)
{
if (dependencyAssetPath.StartsWith("Packages/") == false)
{
string guid = AssetDatabase.AssetPathToGUID(dependencyAssetPath);
if (guid == string.Empty)
{
//Also throws an error for things like '#include_library "SurfaceModifiers/SurfaceModifiers.hlsl"', which are wrapped in an #ifdef. That's a false positive
//Debug.LogException(new Exception($"Tried to import \"{this.assetPath}\" with an missing dependency, supposedly at path: {dependencyAssetPath}."));
return;
}
}
//Tessellation variant pass may run, causing the same dependencies to be registered twice, hence check first
if(dependencies.Contains(dependencyAssetPath) == false) dependencies.Add(dependencyAssetPath);
}
//Handles correct behaviour when double-clicking a .watershader asset. Should open in the IDE
[UnityEditor.Callbacks.OnOpenAsset]
#if UNITY_6000_4_OR_NEWER
public static bool OnOpenAsset(EntityId instanceID, int line)
#else
public static bool OnOpenAsset(int instanceID, int line)
#endif
{
#if UNITY_6000_3_OR_NEWER
Object target = EditorUtility.EntityIdToObject(instanceID);
EntityId id = (EntityId)instanceID;
#else
Object target = EditorUtility.InstanceIDToObject(instanceID);
int id = instanceID;
#endif
if (target is Shader)
{
var path = AssetDatabase.GetAssetPath(id);
if (Path.GetExtension(path) != "." + TARGET_FILE_EXTENSION) return false;
string externalScriptEditor = ScriptEditorUtility.GetExternalScriptEditor();
if (externalScriptEditor != "internal" && externalScriptEditor != string.Empty)
{
InternalEditorUtility.OpenFileAtLineExternal(path, 0);
}
else
{
Application.OpenURL("file://" + path);
}
return true;
}
return false;
}
public static WaterShaderImporter GetForShader(Shader shader)
{
return AssetImporter.GetAtPath(AssetDatabase.GetAssetOrScenePath(shader)) as WaterShaderImporter;
}
public Shader GetShader()
{
return AssetDatabase.LoadAssetAtPath<Shader>(assetPath);
}
[Serializable]
public class Directive
{
public enum Type
{
[InspectorName("(no prefix)")]
custom,
[InspectorName("#include")]
include,
[InspectorName("#pragma")]
pragma,
[InspectorName("#include_with_pragmas")]
include_with_pragmas,
[InspectorName("#define")]
define
}
public bool enabled = true;
public Type type;
public string value;
public Directive(Type _type, string _value)
{
this.type = _type;
this.value = _value;
}
}
public static string[] FindAllAssets()
{
DirectoryInfo directoryInfo = new DirectoryInfo(Application.dataPath);
FileInfo[] fileInfos = directoryInfo.GetFiles("*." + TARGET_FILE_EXTENSION, SearchOption.AllDirectories);
#if SWS_DEV
//Debug.Log($"{fileInfos.Length} .{TARGET_FILE_EXTENSION} assets found");
#endif
string[] filePaths = new string[fileInfos.Length];
for (int i = 0; i < filePaths.Length; i++)
{
filePaths[i] = fileInfos[i].FullName.Replace(@"\", "/").Replace(Application.dataPath, "Assets");
}
return filePaths;
}
#if SWS_DEV
[MenuItem("SWS/Reimport water shaders")]
#endif
public static void ReimportAll()
{
string[] filePaths = FindAllAssets();
foreach (var filePath in filePaths)
{
#if SWS_DEV
//Debug.Log($"Reimporting: {filePath}");
#endif
AssetDatabase.ImportAsset(filePath);
}
}
public FogIntegration.Integration GetFogIntegration()
{
return settings != null && settings.autoIntegration ? FogIntegration.GetFirstInstalled() : FogIntegration.GetIntegration(settings.fogIntegration);
}
[Serializable]
public class WaterShaderSettings
{
[Tooltip("How it will appear in the selection menu")]
public string shaderName;
[Tooltip("Hide the shader in the selection menu. Yet still make it findable with Shader.Find()")]
public bool hidden;
public enum ShaderType
{
WaterSurface,
PostProcessing
}
public ShaderType type;
[Tooltip("Before compiling the shader, check whichever asset is present in the project and activate its integration")]
public bool autoIntegration = true;
public FogIntegration.Assets fogIntegration = FogIntegration.Assets.UnityFog;
[Tooltip("Add support for native light cookies. Disabled by default to allow for cookies to act as caustics projectors that ignore the water surface")]
public bool lightCookies = false;
[Tooltip("Point and spot lights add caustics")]
public bool additionalLightCaustics = false;
public bool additionalLightTranslucency = true;
[Tooltip("When disabled, two caustics textures are cross-animated. Disable this when using a flipbook caustics texture!")]
public bool singleCausticsLayer;
public List<Directive> customIncludeDirectives = new List<Directive>();
[FormerlySerializedAs("passes")]
[Tooltip("Pass blocks that are to be added to the shader template")]
public Object[] additionalPasses = new Object[0];
}
}
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: fb104378e2fbf2942ae8b66abb7a1d57
timeCreated: 1678979614
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/Shader/WaterShaderImporter.cs
uploadId: 895866
@@ -0,0 +1,347 @@
// Stylized Water 3 by Staggart Creations (http://staggart.xyz)
// COPYRIGHT PROTECTED UNDER THE UNITY ASSET STORE EULA (https://unity.com/legal/as-terms)
// • Copying or referencing source code for the production of new asset store, or public, content is strictly prohibited!
// • Uploading this file to a public repository will subject it to an automated DMCA takedown request.
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.Rendering;
#if URP
using System.Collections.Generic;
using UnityEngine.Rendering.Universal;
using UnityEngine.SceneManagement;
#endif
namespace StylizedWater3
{
public class StylizedWaterEditor : Editor
{
#if URP
[MenuItem("GameObject/3D Object/Water/Single Object", false, 0)]
public static void CreateWaterObject()
{
Material mat = AssetDatabase.LoadAssetAtPath<Material>(AssetDatabase.GUIDToAssetPath("e8333e151973f1c4188ff534979c823b"));
Mesh mesh = AssetDatabase.LoadAssetAtPath<Mesh>(AssetDatabase.GUIDToAssetPath("d0abf58b1088fc044aaa6d97c5d51d65"));
WaterObject obj = WaterObject.New(mat, mesh);
//Position in view
if (SceneView.lastActiveSceneView)
{
obj.transform.position = SceneView.lastActiveSceneView.camera.transform.position + (SceneView.lastActiveSceneView.camera.transform.forward * (Mathf.Max(mesh.bounds.size.x, mesh.bounds.size.z)) * 0.5f);
}
if (Selection.activeGameObject) obj.transform.parent = Selection.activeGameObject.transform;
Selection.activeObject = obj;
if(Application.isPlaying == false) EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
}
[MenuItem("GameObject/3D Object/Water/Grid", false, 1)]
public static void CreateWaterGrid()
{
GameObject obj = new GameObject("Water Grid", typeof(WaterGrid));
Undo.RegisterCreatedObjectUndo(obj, "Created Water Grid");
obj.layer = LayerMask.NameToLayer("Water");
WaterGrid grid = obj.GetComponent<WaterGrid>();
grid.Recreate();
if (Selection.activeGameObject) obj.transform.parent = Selection.activeGameObject.transform;
Selection.activeObject = obj;
//Position in view
if (SceneView.lastActiveSceneView)
{
Vector3 position = SceneView.lastActiveSceneView.camera.transform.position + (SceneView.lastActiveSceneView.camera.transform.forward * grid.scale * 0.5f);
position.y = 0f;
grid.transform.position = position;
}
if(Application.isPlaying == false) EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
}
private const string OCEAN_PREFAB_GUID = "3b290065ab77e714d91b7f9e02c830d7";
[MenuItem("GameObject/3D Object/Water/Ocean", false, 2)]
public static void CreateOcean()
{
string prefabPath = AssetDatabase.GUIDToAssetPath(OCEAN_PREFAB_GUID);
if (prefabPath == string.Empty)
{
Debug.LogError("Failed to find the Ocean prefab with the GUID " + OCEAN_PREFAB_GUID);
return;
}
Object prefab = AssetDatabase.LoadAssetAtPath(prefabPath, typeof(Object));
GameObject obj = PrefabUtility.InstantiatePrefab(prefab, Selection.activeGameObject ? Selection.activeGameObject.scene : EditorSceneManager.GetActiveScene()) as GameObject;
Undo.RegisterCreatedObjectUndo(obj, "Ocean");
if (Selection.activeGameObject) obj.transform.parent = Selection.activeGameObject.transform;
Selection.activeObject = obj;
if(Application.isPlaying == false) EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
}
[MenuItem("Window/Stylized Water 3/Set up render feature", true, 3000)]
public static bool SetupRenderFeatureValidate()
{
return IsRenderFeatureSetup() == false;
}
[MenuItem("Window/Stylized Water 3/Set up render feature", false, 3000)]
public static void SetupRenderFeature()
{
List<ScriptableRendererData> renderers = PipelineUtilities.SetupRenderFeature<StylizedWaterRenderFeature>("Stylized Water 3");
Debug.Log($"Added the Stylized Water 3 render feature to {renderers.Count} renderers");
}
[MenuItem("GameObject/3D Object/Water/Planar Reflections Renderer", false, 1000)]
public static void CreatePlanarReflectionRenderer()
{
GameObject obj = new GameObject("Planar Reflections Renderer", typeof(PlanarReflectionRenderer));
Undo.RegisterCreatedObjectUndo(obj, "Created PlanarReflectionRenderer");
PlanarReflectionRenderer r = obj.GetComponent<PlanarReflectionRenderer>();
r.ApplyToAllWaterInstances();
Selection.activeObject = obj;
if(Application.isPlaying == false) EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
}
[MenuItem("Window/Stylized Water 3/Create default reflection probe", false, 2000)]
public static void CreateDefaultReflectionProbe()
{
GameObject obj = new GameObject("Skybox Reflection", typeof(ReflectionProbe));
Undo.RegisterCreatedObjectUndo(obj, "Created Skybox Reflection");
ReflectionProbe probe = obj.GetComponent<ReflectionProbe>();
probe.mode = ReflectionProbeMode.Realtime;
probe.size = Vector3.one * 10000f;
probe.cullingMask = 0;
probe.shadowDistance = 0;
probe.RenderProbe();
//Selection.activeObject = obj;
if(Application.isPlaying == false) EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
}
[MenuItem("Window/Stylized Water 3/Open demo scene", false, 2000)]
public static void OpenDemoScene()
{
string path = AssetDatabase.GUIDToAssetPath("2477c7e727bfe2f4bba7e621f08fd50b");
Scene scene = SceneManager.GetSceneByPath(path);
EditorSceneManager.OpenScene(path);
}
#endif
[MenuItem("Assets/Create/Water/Mesh")]
private static void CreateWaterPlaneAsset()
{
var fileName = "New Watermesh.watermesh";
#if UNITY_6000_4_OR_NEWER
ProjectWindowUtil.CreateAssetWithTextContent(fileName, "");
#else
ProjectWindowUtil.CreateAssetWithContent(fileName, "");
#endif
}
[MenuItem("CONTEXT/Transform/Align To Water")]
private static void AddAlignToWater(MenuCommand cmd)
{
Transform t = (Transform)cmd.context;
if (!t.gameObject.GetComponent<AlignToWater>())
{
Undo.AddComponent<AlignToWater>(t.gameObject);
EditorUtility.SetDirty(t);
}
}
public class PopUpMaterialEditor : EditorWindow
{
private Object target;
private MaterialEditor editor;
public static void Create(Object asset)
{
var window = CreateWindow<PopUpMaterialEditor>($"{asset.name} | {asset.GetType().Name}");
window.target = asset;
window.editor = (MaterialEditor)Editor.CreateEditor(asset, typeof(MaterialEditor));
//window.editor.OnEnable();
//window.editor.target = asset as Material;
window.Show();
}
private void OnGUI()
{
EditorGUI.BeginDisabledGroup(true);
target = EditorGUILayout.ObjectField("Asset", target, typeof(Material), false);
EditorGUI.EndDisabledGroup();
//editor.OnInspectorGUI();
editor.PropertiesGUI();
}
}
public class PopUpAssetEditor : EditorWindow
{
private Object target;
private Editor editor;
public static void Create(Object asset)
{
var window = CreateWindow<PopUpAssetEditor>($"{asset.name} | {asset.GetType().Name}");
window.target = asset;
window.editor = Editor.CreateEditor(asset);
window.editor.target = asset;
window.ShowModalUtility();
}
private void OnGUI()
{
EditorGUI.BeginDisabledGroup(true);
target = EditorGUILayout.ObjectField("Asset", target, target.GetType(), false);
EditorGUI.EndDisabledGroup();
editor.OnInspectorGUI();
}
}
public static bool IsRenderFeatureSetup()
{
return PipelineUtilities.RenderFeatureAdded<StylizedWaterRenderFeature>();
}
public static bool UnderwaterRenderingInstalled()
{
//Checking for Extension.UnderwaterRenderer.cs meta file
string path = AssetDatabase.GUIDToAssetPath("f8689f15308f4e6da4c0bb17b8b3af04");
return AssetDatabase.LoadMainAssetAtPath(path);
}
public static bool DynamicEffectsInstalled()
{
//Checking for the RenderFeature.DynamicEffects.cs meta file
string path = AssetDatabase.GUIDToAssetPath("4f5bfefce00aeb5479fc940fb8e61837");
return AssetDatabase.LoadMainAssetAtPath(path);
}
public static bool CurvedWorldInstalled(out string libraryPath)
{
//Checking for "CurvedWorldTransform.cginc"
libraryPath = AssetDatabase.GUIDToAssetPath("208a98c9ab72b9f4bb8735c6a229e807");
return libraryPath != string.Empty;
}
public static void OpenGraphicsSettings()
{
SettingsService.OpenProjectSettings("Project/Graphics");
}
public static void SelectForwardRenderer()
{
#if URP
if (!UniversalRenderPipeline.asset) return;
Selection.activeObject = PipelineUtilities.GetDefaultRenderer();
#endif
}
public static void EnableDepthTexture()
{
#if URP
if (!UniversalRenderPipeline.asset) return;
UniversalRenderPipeline.asset.supportsCameraDepthTexture = true;
EditorUtility.SetDirty(UniversalRenderPipeline.asset);
PipelineUtilities.IsDepthTextureOptionDisabledAnywhere(out var renderers);
if (renderers.Count > 0)
{
string[] rendererNames = new string[renderers.Count];
for (int i = 0; i < rendererNames.Length; i++)
{
rendererNames[i] = "• " + renderers[i].name;
}
if (EditorUtility.DisplayDialog(AssetInfo.ASSET_NAME, "The Depth Texture option is still disabled on other pipeline assets (likely for other quality levels):\n\n" +
System.String.Join(System.Environment.NewLine, rendererNames) +
"\n\nWould you like to enable it on those as well?", "OK", "Cancel"))
{
PipelineUtilities.SetDepthTextureOnAllAssets(true);
}
}
#endif
}
public static void EnableOpaqueTexture()
{
#if URP
if (!UniversalRenderPipeline.asset) return;
UniversalRenderPipeline.asset.supportsCameraOpaqueTexture = true;
EditorUtility.SetDirty(UniversalRenderPipeline.asset);
PipelineUtilities.IsOpaqueTextureOptionDisabledAnywhere(out var renderers);
if (renderers.Count > 0)
{
string[] rendererNames = new string[renderers.Count];
for (int i = 0; i < rendererNames.Length; i++)
{
rendererNames[i] = "• " + renderers[i].name;
}
if (EditorUtility.DisplayDialog(AssetInfo.ASSET_NAME, "The Opaque Texture option is still disabled on other pipeline assets (likely for other quality levels):\n\n" +
System.String.Join(System.Environment.NewLine, rendererNames) +
"\n\nWould you like to enable it on those as well?", "OK", "Cancel"))
{
PipelineUtilities.SetOpaqueTextureOnAllAssets(true);
}
}
#endif
}
/// <summary>
/// Configures the assigned water material to render as double-sided, which is required for underwater rendering
/// </summary>
public static void DisableCullingForMaterial(Material material)
{
if (!material) return;
material.SetInt("_Cull", (int)UnityEngine.Rendering.CullMode.Off);
EditorUtility.SetDirty(material);
}
#if !SPLINES
[MenuItem("Window/Stylized Water 3/Install Splines package", false, 3000)]
private static void InstallSplines()
{
UnityEditor.PackageManager.Client.Add($"com.unity.splines");
Debug.Log("The Splines package will be installed in a moment...");
}
#endif
}
}
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: c533cb37af7224547ae4fa71f337c480
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/StylizedWaterEditor.cs
uploadId: 895866
File diff suppressed because one or more lines are too long
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 1f73882fe8e77ab4381fd27e07ec7d0f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/UI.cs
uploadId: 895866
@@ -0,0 +1,61 @@
// Stylized Water 3 by Staggart Creations (http://staggart.xyz)
// COPYRIGHT PROTECTED UNDER THE UNITY ASSET STORE EULA (https://unity.com/legal/as-terms)
// • Copying or referencing source code for the production of new asset store, or public, content is strictly prohibited!
// • Uploading this file to a public repository will subject it to an automated DMCA takedown request.
using UnityEditor.AssetImporters;
using System;
using System.IO;
using UnityEngine;
using UnityEditor;
using Object = UnityEngine.Object;
namespace StylizedWater3
{
[ScriptedImporter(3, FILE_EXTENSION, -1)]
public class WaterMeshImporter : ScriptedImporter
{
private const string FILE_EXTENSION = "watermesh";
[SerializeField] public WaterMesh waterMesh = new WaterMesh();
public override void OnImportAsset(AssetImportContext context)
{
waterMesh.Rebuild();
context.AddObjectToAsset("mesh", waterMesh.mesh);
context.SetMainObject(waterMesh.mesh);
}
//Handles correct behaviour when double-clicking a .watermesh asset assigned to a field
//Otherwise the OS prompts to open it
[UnityEditor.Callbacks.OnOpenAsset]
#if UNITY_6000_4_OR_NEWER
public static bool OnOpenAsset(EntityId instanceID, int line)
#else
public static bool OnOpenAsset(int instanceID, int line)
#endif
{
#if UNITY_6000_3_OR_NEWER
Object target = EditorUtility.EntityIdToObject(instanceID);
EntityId id = (EntityId)instanceID;
#else
Object target = EditorUtility.InstanceIDToObject(instanceID);
int id = instanceID;
#endif
if (target is Mesh)
{
var path = AssetDatabase.GetAssetPath(id);
if (Path.GetExtension(path) != "." + FILE_EXTENSION) return false;
Selection.activeObject = target;
return true;
}
return false;
}
}
}
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: b045ca0db52e8094dbdc7923faa70590
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/WaterMeshImporter.cs
uploadId: 895866
@@ -0,0 +1,404 @@
// Stylized Water 3 by Staggart Creations (http://staggart.xyz)
// COPYRIGHT PROTECTED UNDER THE UNITY ASSET STORE EULA (https://unity.com/legal/as-terms)
// • Copying or referencing source code for the production of new asset store, or public, content is strictly prohibited!
// • Uploading this file to a public repository will subject it to an automated DMCA takedown request.
using System;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
using Random = UnityEngine.Random;
namespace StylizedWater3
{
[CustomEditor(typeof(WaveProfile))]
public class WaveProfileEditor: Editor
{
private SerializedProperty amplitudeMultiplier;
private SerializedProperty waveLengthMultiplier;
private SerializedProperty steepnessMultiplier;
private SerializedProperty waveLengthCurve;
private SerializedProperty amplitudeCurve;
private SerializedProperty steepnessCurve;
private SerializedProperty steepnessClamping;
private SerializedProperty layers;
public void OnEnable()
{
amplitudeMultiplier = serializedObject.FindProperty("amplitudeMultiplier");
waveLengthMultiplier = serializedObject.FindProperty("waveLengthMultiplier");
steepnessMultiplier = serializedObject.FindProperty("steepnessMultiplier");
waveLengthCurve = serializedObject.FindProperty("waveLengthCurve");
amplitudeCurve = serializedObject.FindProperty("amplitudeCurve");
steepnessCurve = serializedObject.FindProperty("steepnessCurve");
steepnessClamping = serializedObject.FindProperty("steepnessClamping");
layers = serializedObject.FindProperty("layers");
}
private string iconPrefix => EditorGUIUtility.isProSkin ? "d_" : "";
private bool expandLayers = true;
public override void OnInspectorGUI()
{
UI.DrawHeader();
serializedObject.Update();
EditorGUI.BeginChangeCheck();
WaveProfile instance = (WaveProfile)target;
using (new EditorGUILayout.HorizontalScope())
{
GUILayout.FlexibleSpace();
UI.ExpandTooltips = GUILayout.Toggle(UI.ExpandTooltips, new GUIContent(" Toggle tooltips", EditorGUIUtility.IconContent(UI.iconPrefix + (UI.ExpandTooltips ? "animationvisibilitytoggleon" : "animationvisibilitytoggleoff")).image), "Button");
}
EditorGUILayout.Space();
EditorGUILayout.LabelField("Multipliers", EditorStyles.boldLabel);
using (new EditorGUILayout.HorizontalScope())
{
UI.PropertyField(waveLengthMultiplier);
if (GUILayout.Button("Apply", EditorStyles.miniButton))
{
for (int i = 0; i < layers.arraySize; i++)
{
SerializedProperty layer = layers.GetArrayElementAtIndex(i);
SerializedProperty waveLength = layer.FindPropertyRelative("waveLength");
waveLength.floatValue *= waveLengthMultiplier.floatValue;
}
waveLengthMultiplier.floatValue = 1f;
}
}
using (new EditorGUILayout.HorizontalScope())
{
UI.PropertyField(amplitudeMultiplier);
if (GUILayout.Button("Apply", EditorStyles.miniButton))
{
for (int i = 0; i < layers.arraySize; i++)
{
SerializedProperty layer = layers.GetArrayElementAtIndex(i);
SerializedProperty amp = layer.FindPropertyRelative("amplitude");
amp.floatValue *= amplitudeMultiplier.floatValue;
}
amplitudeMultiplier.floatValue = 1f;
}
}
using (new EditorGUILayout.HorizontalScope())
{
UI.PropertyField(steepnessMultiplier);
if (GUILayout.Button("Apply", EditorStyles.miniButton))
{
for (int i = 0; i < layers.arraySize; i++)
{
SerializedProperty layer = layers.GetArrayElementAtIndex(i);
SerializedProperty steepness = layer.FindPropertyRelative("steepness");
steepness.floatValue *= steepnessMultiplier.floatValue;
}
steepnessMultiplier.floatValue = 1f;
}
}
UI.PropertyField(waveLengthCurve);
UI.PropertyField(amplitudeCurve);
UI.PropertyField(steepnessCurve);
EditorGUILayout.Space();
UI.PropertyField(steepnessClamping);
EditorGUILayout.Space();
if (GUILayout.Button("Open procedural editor"))
{
WizardWindow window = EditorWindow.CreateWindow<WizardWindow>("Wave creation wizard");
window.target = instance;
window.Show();
}
EditorGUILayout.Space();
expandLayers = EditorGUILayout.BeginFoldoutHeaderGroup(expandLayers, $"Layers ({layers.arraySize})");
if (expandLayers)
{
using (new EditorGUILayout.HorizontalScope())
{
GUILayout.Space(EditorGUIUtility.labelWidth);
if (GUILayout.Button("Enable all", EditorStyles.miniButtonLeft))
{
SetEnabledStateForAllLayers(true);
}
if (GUILayout.Button("Disable all", EditorStyles.miniButtonRight))
{
SetEnabledStateForAllLayers(false);
}
}
for (int i = 0; i < layers.arraySize; i++)
{
SerializedProperty layer = layers.GetArrayElementAtIndex(i);
SerializedProperty enabled = layer.FindPropertyRelative("enabled");
using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar))
{
enabled.boolValue = EditorGUILayout.ToggleLeft($" Layer #{i+1}", enabled.boolValue, EditorStyles.boldLabel);
if (GUILayout.Button(new GUIContent("", EditorGUIUtility.IconContent("d_TreeEditor.Trash").image, "Remove"), EditorStyles.miniButtonRight, GUILayout.MaxWidth(50f)))
{
layers.DeleteArrayElementAtIndex(i);
break;
}
}
if (enabled.boolValue)
{
using (new EditorGUILayout.VerticalScope())
{
EditorGUILayout.Space(1f);
EditorGUI.indentLevel++;
UI.PropertyField(layer.FindPropertyRelative("waveLength"));
UI.PropertyField(layer.FindPropertyRelative("amplitude"));
UI.PropertyField(layer.FindPropertyRelative("steepness"));
EditorGUILayout.Space();
SerializedProperty mode = layer.FindPropertyRelative("mode");
UI.PropertyField(mode);
if (mode.intValue == (int)WaveProfile.Wave.Mode.Directional)
{
UI.PropertyField(layer.FindPropertyRelative("direction"));
}
else
{
UI.PropertyField(layer.FindPropertyRelative("origin"));
}
EditorGUI.indentLevel--;
EditorGUILayout.Space(10f);
}
}
}
}
using (new EditorGUILayout.HorizontalScope())
{
GUILayout.FlexibleSpace();
if (GUILayout.Button(new GUIContent("Add", EditorGUIUtility.IconContent(iconPrefix + "Toolbar Plus").image, "Add new item"), GUILayout.Width(60f)))
{
layers.InsertArrayElementAtIndex(layers.arraySize);
SerializedProperty layer = layers.GetArrayElementAtIndex(layers.arraySize-1);
layer.FindPropertyRelative("waveLength").floatValue -= 1;
layer.FindPropertyRelative("direction").floatValue -= 45;
}
}
EditorGUILayout.EndFoldoutHeaderGroup();
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
instance.UpdateShaderParameters();
instance.RecalculateAverages();
}
/*
EditorGUILayout.LabelField("Average steepness: " + instance.averageSteepness);
EditorGUILayout.LabelField("Average amplitude: " + instance.averageAmplitude);
if (instance.shaderParametersLUT)
{
Rect r = EditorGUILayout.GetControlRect();
//r.width = 8 * 4;
//r.height = r.width * (2f / layers.arraySize);
r.height *= 2f;
EditorGUI.DrawPreviewTexture(r, instance.shaderParametersLUT);
//GUI.DrawTexture(r, instance.shaderParametersLUT);
}
*/
}
private void SetEnabledStateForAllLayers(bool state)
{
serializedObject.Update();
EditorGUI.BeginChangeCheck();
for (int i = 0; i < layers.arraySize; i++)
{
SerializedProperty layer = layers.GetArrayElementAtIndex(i);
SerializedProperty enabled = layer.FindPropertyRelative("enabled");
enabled.boolValue = state;
}
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
}
}
//Handles correct behaviour when double-clicking an asset assigned to a field
//Otherwise the OS prompts to open it
[UnityEditor.Callbacks.OnOpenAsset]
#if UNITY_6000_4_OR_NEWER
public static bool OnOpenAsset(EntityId instanceID, int line)
#else
public static bool OnOpenAsset(int instanceID, int line)
#endif
{
#if UNITY_6000_3_OR_NEWER
Object target = EditorUtility.EntityIdToObject(instanceID);
EntityId id = (EntityId)instanceID;
#else
Object target = EditorUtility.InstanceIDToObject(instanceID);
int id = instanceID;
#endif
if (target is WaveProfile)
{
Selection.activeObject = target;
return true;
}
if (target is Texture2D)
{
var path = AssetDatabase.GetAssetPath(id);
Object asset = AssetDatabase.LoadMainAssetAtPath(path);
if (asset is WaveProfile)
{
Selection.activeObject = target;
return true;
}
}
return false;
}
[MenuItem("Assets/Create/Water/Wave Profile")]
private static void CreateAsset()
{
WaveProfile asset = ScriptableObject.CreateInstance<WaveProfile>();
ProjectWindowUtil.CreateAsset(asset, "New Wave Profile.asset");
asset.UpdateShaderParameters();
}
public static WaveProfile LoadFromLUT(Texture lut)
{
if (lut == null) return null;
string assetPath = AssetDatabase.GetAssetPath(lut);
//Debug.Log($"Wave profile loaded: {assetPath}");
return (WaveProfile)AssetDatabase.LoadMainAssetAtPath(assetPath);
}
public static WaveProfile LoadFromMaterial(Material material)
{
Texture lut = material.GetTexture("_WaveProfile");
return LoadFromLUT(lut);
}
public static WaveProfile LoadFromWaterObject(WaterObject waterObject)
{
return LoadFromMaterial(waterObject.material);
}
public override bool HasPreviewGUI()
{
return false;
}
public static WaveProfile GetDefault()
{
string assetPath = AssetDatabase.GUIDToAssetPath("1ca4610f5bf9e2f4bb39535503a79eeb");
return (WaveProfile)AssetDatabase.LoadMainAssetAtPath(assetPath);
}
class WizardWindow : EditorWindow
{
public WaveProfile target;
private SerializedObject serializedObject;
private SerializedProperty proceduralSettings;
private void Initialize()
{
initialized = true;
if(!target) Debug.LogError("Created null");
serializedObject = new SerializedObject(target);
proceduralSettings = serializedObject.FindProperty("proceduralSettings");
}
[NonSerialized]
private bool initialized;
private void OnGUI()
{
if (!initialized) Initialize();
EditorGUILayout.ObjectField("Editing: ", target, typeof(WaveProfile), false);
if (!target) return;
EditorGUILayout.LabelField("Procedural parameters", EditorStyles.boldLabel);
serializedObject.Update();
EditorGUI.BeginChangeCheck();
UI.PropertyField(proceduralSettings);
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
Apply(target.proceduralSettings);
}
/*
if (target.shaderParametersLUT)
{
EditorGUILayout.Space();
EditorGUILayout.LabelField("Output LUT (visualized)", EditorStyles.boldLabel);
Rect r = EditorGUILayout.GetControlRect();
//r.width = 8 * 4;
r.height = 37;
EditorGUI.DrawPreviewTexture(r, target.shaderParametersLUT);
}
*/
}
private void Apply(WaveProfile.ProceduralSettings settings)
{
Undo.RecordObject(target, "Randomized wave profile");
settings.Apply((WaveProfile)target);
EditorUtility.SetDirty(target);
}
}
}
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: faca6b16b24385e46b7ac937e7bf4a48
timeCreated: 1715773877
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/WaveProfileEditor.cs
uploadId: 895866
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 2008754729f6447f9e7941b58df654fc
timeCreated: 1717592404
@@ -0,0 +1,224 @@
// Stylized Water 3 by Staggart Creations (http://staggart.xyz)
// COPYRIGHT PROTECTED UNDER THE UNITY ASSET STORE EULA (https://unity.com/legal/as-terms)
// • Copying or referencing source code for the production of new asset store, or public, content is strictly prohibited!
// • Uploading this file to a public repository will subject it to an automated DMCA takedown request.
using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace StylizedWater3
{
public static class HeightQuerySystemEditor
{
public class HeightQueryInspector : EditorWindow
{
[MenuItem("Window/Analysis/Stylized Water 3/Height Query Inspector", false, 0)]
public static void Open()
{
HeightQueryInspector window = GetWindow<HeightQueryInspector>(false);
window.titleContent = new GUIContent("Height Query Inspector", EditorGUIUtility.IconContent("ComputeShader Icon").image);
window.autoRepaintOnSceneChange = true;
window.minSize = new Vector2(1200f, 200f);
window.Show();
}
private Vector2 scrollPos;
private Vector2 outputScrollPos;
private int selectedQueryIndex;
private int requestIndex;
private int highlightedRequest = -1;
//private bool showOutput = false;
private bool showIndices = false;
[SerializeField]
private GUIStyle labelStyle;
private GUIStyle labelStyleSelected;
private Color GetUniqueColor(int i)
{
UnityEngine.Random.InitState(i);
return Color.HSVToRGB(UnityEngine.Random.value, 0.75f, 1f);
}
private readonly Color lineColor = new Color(0,0,0, 0.5f);
private void OnGUI()
{
labelStyle = new GUIStyle(EditorStyles.label);
labelStyle.richText = true;
labelStyleSelected = new GUIStyle(EditorStyles.selectionRect);
labelStyleSelected.richText = true;
labelStyleSelected.onFocused = new GUIStyleState();
labelStyleSelected.onFocused.background = Texture2D.grayTexture;
this.Repaint();
var queryCount = HeightQuerySystem.QueryCount;
if (queryCount == 0)
{
EditorGUILayout.HelpBox("No water height queries are currently enqueued", MessageType.Info);
return;
}
//showOutput = EditorGUILayout.Toggle("Show output", showOutput);
using (new EditorGUILayout.HorizontalScope(GUILayout.MaxWidth(200f)))
{
EditorGUILayout.LabelField($"Query ({queryCount}):", EditorStyles.boldLabel, GUILayout.MaxWidth(100f));
GUIContent[] content = new GUIContent[queryCount];
for (int i = 0; i < content.Length; i++)
{
content[i] = new GUIContent(i.ToString());
}
selectedQueryIndex = GUILayout.Toolbar(selectedQueryIndex, content);
}
selectedQueryIndex = Mathf.Min(selectedQueryIndex, queryCount);
int queryIndex = 0;
foreach (HeightQuerySystem.Query query in HeightQuerySystem.queries)
{
if (selectedQueryIndex == queryIndex)
{
EditorGUILayout.LabelField($"Capacity: {query.sampleCount}/{HeightQuerySystem.Query.MAX_SIZE}", EditorStyles.boldLabel);
Rect rect = EditorGUILayout.GetControlRect();
rect.width -= 5f;
//EditorGUI.DrawRect(rect, Color.grey);
float cellWidth = rect.width / (float)HeightQuerySystem.Query.MAX_SIZE;
//Draw available indices
for (int i = 0; i < query.availableIndices.Count; i++)
{
float x = rect.x + (float)(query.availableIndices[i] * cellWidth);
Rect cellRect = new Rect(x, rect.y, cellWidth, rect.height);
EditorGUI.DrawRect(cellRect, Color.grey * 0.6f);
}
//Draw occupied indices
requestIndex = 0;
highlightedRequest = -1;
foreach (KeyValuePair<int, HeightQuerySystem.AsyncRequest> request in query.requests)
{
Color color = GetUniqueColor(request.Key);
for (int i = 0; i < request.Value.indices.Count; i++)
{
int sampleIndex = request.Value.indices[i];
float x = rect.x + (float)(sampleIndex * cellWidth);
Rect cellRect = new Rect(x, rect.y, cellWidth, rect.height);
EditorGUI.DrawRect(cellRect, color);
if (cellRect.Contains(Event.current.mousePosition))
{
highlightedRequest = requestIndex;
GUIContent tooltip = new GUIContent($"[{sampleIndex.ToString()}] {request.Value.label}");
Rect tooltipRect = cellRect;
tooltipRect.y -= tooltipRect.height + 5f;
tooltipRect.width = EditorStyles.label.CalcSize(tooltip).x;
EditorGUI.HelpBox(tooltipRect, tooltip);
}
}
requestIndex++;
}
//Draw overlay lines
for (int i = 0; i < HeightQuerySystem.Query.MAX_SIZE; i++)
{
float x = rect.x + (float)(i * cellWidth);
Rect lineRect = new Rect(x, rect.y, 1f, rect.height);
EditorGUI.DrawRect(lineRect, lineColor);
}
showIndices = EditorGUILayout.ToggleLeft("Show available indices", showIndices);
if (showIndices)
{
using (new EditorGUILayout.HorizontalScope(EditorStyles.textArea))
{
string indicesString = "";
for (int i = 0; i < query.availableIndices.Count; i++)
{
indicesString += $"{query.availableIndices[i].ToString()}, ";
}
EditorGUILayout.LabelField(indicesString, EditorStyles.miniLabel);
}
}
EditorGUILayout.LabelField($"Requests ({query.requests.Count}):", EditorStyles.boldLabel);
using (new EditorGUILayout.VerticalScope(EditorStyles.textArea))
{
scrollPos = EditorGUILayout.BeginScrollView(scrollPos, true, true);
requestIndex = 0;
foreach (KeyValuePair<int, HeightQuerySystem.AsyncRequest> request in query.requests)
{
using (new EditorGUILayout.HorizontalScope())
{
Rect iconRect = EditorGUILayout.GetControlRect(GUILayout.MaxWidth(10f));
iconRect.width = 10f;
iconRect.height = 10f;
iconRect.y += 5f;
EditorGUI.DrawRect(iconRect, GetUniqueColor(request.Key));
GUILayout.Space(5f);
bool selected = highlightedRequest == requestIndex;
EditorGUILayout.LabelField($"<b>Label:</b> {request.Value.label}", selected ? labelStyleSelected : labelStyle, GUILayout.Width(200f));
EditorGUILayout.LabelField($"<b>ID:</b> {request.Value.hashCode}", selected ? labelStyleSelected : labelStyle, GUILayout.Width(75f));
EditorGUILayout.LabelField($"<b>Samples:</b> {request.Value.SampleCount}", selected ? labelStyleSelected : labelStyle, GUILayout.Width(100f));
string indicesString = "{ ";
for (int i = 0; i < request.Value.indices.Count; i++)
{
indicesString += $"{request.Value.indices[i].ToString()}, ";
}
indicesString += " }";
EditorGUILayout.LabelField($"<b>Indices:</b> {indicesString}", selected ? labelStyleSelected : labelStyle, GUILayout.MaxWidth(250f));
string heightsString = "{ ";
for (int i = 0; i < request.Value.sampler.heightValues.Length; i++)
{
heightsString += $"{Math.Round(request.Value.sampler.heightValues[i], 3)}, ";
}
heightsString += " }";
EditorGUILayout.LabelField($"<b>Heights:</b> {heightsString}", selected ? labelStyleSelected : labelStyle);
}
/*
if (showOutput)
{
EditorGUILayout.LabelField("Outputs");
using (new EditorGUILayout.VerticalScope(EditorStyles.textArea, GUILayout.MaxHeight(200f)))
{
//outputScrollPos = EditorGUILayout.BeginScrollView(outputScrollPos);
for (int i = 0; i < request.Value.indices.Count; i++)
{
int index = request.Value.indices[i];
EditorGUILayout.LabelField(index + ": " + query.outputOffsets[index], EditorStyles.miniLabel);
}
//EditorGUILayout.EndScrollView();
}
}
*/
requestIndex++;
}
EditorGUILayout.EndScrollView();
}
}
queryIndex++;
}
}
}
}
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 59dec72c64294028996963ed7821a007
timeCreated: 1717758709
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/Windows/HeightQuerySystemEditor.cs
uploadId: 895866
File diff suppressed because one or more lines are too long
@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: e6d03cdf323bbdf43a0cfb24ab918b8b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/Windows/HelpWindow.cs
uploadId: 895866
@@ -0,0 +1,162 @@
// Stylized Water 3 by Staggart Creations (http://staggart.xyz)
// COPYRIGHT PROTECTED UNDER THE UNITY ASSET STORE EULA (https://unity.com/legal/as-terms)
// • Copying or referencing source code for the production of new asset store, or public, content is strictly prohibited!
// • Uploading this file to a public repository will subject it to an automated DMCA takedown request.
using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.Rendering;
namespace StylizedWater3
{
public class RenderTargetDebuggerWindow : EditorWindow
{
private const int m_width = 550;
private const int m_height = 300;
[MenuItem("Window/Analysis/Stylized Water 3/Render targets", false, 0)]
private static void OpenDebugger()
{
RenderTargetDebuggerWindow.Open();
}
#if SWS_DEV
[MenuItem("SWS/Debug/Render Targets")]
#endif
public static void Open()
{
RenderTargetDebuggerWindow window = GetWindow<RenderTargetDebuggerWindow>(false);
window.titleContent = new GUIContent("Water Render Buffer Inspector");
window.autoRepaintOnSceneChange = true;
window.minSize = new Vector2(m_width, m_height);
//window.maxSize = new Vector2(m_width, m_height);
window.Show();
}
private float width = 300f;
private Vector2 scrollPos;
private ColorWriteMask colorMask = ColorWriteMask.All;
private int colorChannel = 1;
private int renderTargetIndex;
private float exposure = 1f;
private int mipmap = 0;
private void OnEnable()
{
RenderTargetDebugger.Initialize();
}
private void OnDisable()
{
RenderTargetDebugger.Cleanup();
}
private void OnGUI()
{
Repaint();
if (RenderTargetDebugger.renderTargetNames.Length < 5)
{
renderTargetIndex = GUILayout.Toolbar(renderTargetIndex, RenderTargetDebugger.renderTargetNames);
}
else
{
renderTargetIndex = EditorGUILayout.Popup($"Render target ({RenderTargetDebugger.renderTargets.Count})", renderTargetIndex, RenderTargetDebugger.renderTargetNames);
}
EditorGUILayout.LabelField($"Active camera: {RenderTargetDebugger.CurrentCameraName}", EditorStyles.miniLabel);
width = (Mathf.Min(this.position.height, this.position.width) * 1f) - 15f;
scrollPos = EditorGUILayout.BeginScrollView(scrollPos);
//EditorGUILayout.LabelField($"RenderTargetInspector.InspectedProperty: {RenderTargetInspector.InspectedProperty}");
//EditorGUILayout.LabelField($"RenderTargetInspector.CurrentRT: {RenderTargetInspector.CurrentRT}");
int currentTarget = 0;
foreach (var renderTarget in RenderTargetDebugger.renderTargets)
{
if(renderTargetIndex == currentTarget)
{
//mark as current!
RenderTargetDebugger.InspectedProperty = renderTarget.propertyID;
using (new EditorGUILayout.HorizontalScope())
{
using (new EditorGUILayout.VerticalScope())
{
DrawTexture(renderTarget);
}
}
}
currentTarget++;
}
EditorGUILayout.EndScrollView();
}
private void DrawTexture(RenderTargetDebugger.RenderTarget renderTarget)
{
if (RenderTargetDebugger.CurrentRT == null || renderTarget == null)
{
EditorGUILayout.HelpBox($"Render target \"{renderTarget.textureName}\" couldn't be found, or it is not bound." +
$"\n\nThe related render pass may be disabled, or not render for the current view (scene/game view not open)", MessageType.Info);
return;
}
//Null at the very first frame
if (RenderTargetDebugger.CurrentRT.rt == null) return;
EditorGUILayout.LabelField($"\"{renderTarget.textureName}\" {RenderTargetDebugger.CurrentRT.rt.descriptor.graphicsFormat} {RenderTargetDebugger.CurrentRT.rt.width}x{RenderTargetDebugger.CurrentRT.rt.height}px @ {(UnityEngine.Profiling.Profiler.GetRuntimeMemorySizeLong(RenderTargetDebugger.CurrentRT) / 1024f / 1024f).ToString("F2")}mb", EditorStyles.boldLabel);
if (renderTarget.description != string.Empty) EditorGUILayout.HelpBox(renderTarget.description, MessageType.Info);
Rect rect = EditorGUILayout.GetControlRect();
Rect position = EditorGUI.PrefixLabel(rect, GUIUtility.GetControlID(FocusType.Passive), GUIContent.none);
position.width = width;
//colorChannel = EditorGUI.Popup(position, "Channel mask", colorChannel, new string[] { "RGB", "R", "G", "B", "A" });
colorChannel = (int)GUI.Toolbar(position, colorChannel, new GUIContent[] { new GUIContent("RGBA"), new GUIContent("RGB"), new GUIContent("R"), new GUIContent("G"), new GUIContent("B"), new GUIContent("A") });
switch (colorChannel)
{
case 1: colorMask = ColorWriteMask.All;
break;
case 2: colorMask = ColorWriteMask.Red;
break;
case 3: colorMask = ColorWriteMask.Green;
break;
case 4: colorMask = ColorWriteMask.Blue;
break;
case 5: colorMask = ColorWriteMask.Alpha;
break;
}
rect.y += 21f;
rect.width = width;
float aspect = (RenderTargetDebugger.CurrentRT.rt.height / RenderTargetDebugger.CurrentRT.rt.width);
rect.height = rect.width;
if (colorChannel == 0) //RGBA
{
EditorGUI.DrawTextureTransparent(rect, RenderTargetDebugger.CurrentRT, ScaleMode.ScaleToFit, aspect);
}
else if (colorMask == ColorWriteMask.Alpha)
{
EditorGUI.DrawTextureAlpha(rect, RenderTargetDebugger.CurrentRT, ScaleMode.ScaleToFit, aspect, mipmap);
}
else
{
EditorGUI.DrawPreviewTexture(rect, RenderTargetDebugger.CurrentRT, null, ScaleMode.ScaleToFit, aspect, mipmap, colorMask, exposure);
}
GUILayout.Space(rect.height + 10f);
mipmap = EditorGUILayout.IntSlider("Mipmap", mipmap, 0, 8);
exposure = EditorGUILayout.Slider("Exposure", exposure, 1f, 16f);
}
}
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: c6271584fb7f40cab8c6fcf351bd5372
timeCreated: 1717592416
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/Windows/RenderTargetDebuggerWindow.cs
uploadId: 895866
@@ -0,0 +1,47 @@
{
"name": "sc.stylizedwater3.editor",
"rootNamespace": "",
"references": [
"GUID:4fd586483f5d4a24491f09604d74752b",
"GUID:15fc0a57446b3144c949da3e2b9737a9",
"GUID:4fd6538c1c56b409fb53fdf0183170ec",
"GUID:df380645f10b7bc4b97d4f5eb6303d95",
"GUID:3eae0364be2026648bf74846acb8a731",
"GUID:e40ba710768534012815d3193fa296cb",
"GUID:f9fe0089ec81f4079af78eb2287a6163",
"GUID:75ecb28acc33857438e533566abcb3be",
"GUID:d8b63aba1907145bea998dd612889d6b"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [
{
"name": "com.unity.xr.management",
"expression": "3.2.10",
"define": "XR"
},
{
"name": "com.unity.render-pipelines.universal",
"expression": "17.0.3",
"define": "URP"
},
{
"name": "com.unity.visualeffectgraph",
"expression": "17.0.3",
"define": "VFX_GRAPH"
},
{
"name": "com.unity.splines",
"expression": "2.4.0",
"define": "SPLINES"
}
],
"noEngineReferences": false
}
@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: ac93d6f2df7cddd4eac8f96ebd47ee37
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Editor/sc.stylizedwater3.editor.asmdef
uploadId: 895866
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: deb122f1b69a0c14ea648bcb2897e785
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d086144747bdc1f4eb7d97e0368d84f6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1625660177ce6704e8e36a0bad90bedc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 21788edd4e6eeb248bb013c13e4d6c96
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 MiB

@@ -0,0 +1,122 @@
fileFormatVersion: 2
guid: 8e38e48ea1eb3ec419a26404fafba4a5
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Materials/Effects/Decals/Textures/Decal_Duckweed_Albedo.png
uploadId: 895866
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

@@ -0,0 +1,122 @@
fileFormatVersion: 2
guid: 4c9ea1582510bd64390da0954df9ba78
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 1
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Materials/Effects/Decals/Textures/Decal_Duckweed_Normal.png
uploadId: 895866
Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

@@ -0,0 +1,150 @@
fileFormatVersion: 2
guid: 160b537c0a446194a8eafd77ad66f213
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Win64
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Materials/Effects/Decals/Textures/Decal_Foam.png
uploadId: 895866
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

@@ -0,0 +1,122 @@
fileFormatVersion: 2
guid: bde8e2bee22b8da4a9f17b2aa71bb078
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Materials/Effects/Decals/Textures/Decal_Lillypads_albedo.png
uploadId: 895866
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

@@ -0,0 +1,122 @@
fileFormatVersion: 2
guid: 0d6741e2bcf2ad3488b320b99873d262
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 1
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Materials/Effects/Decals/Textures/Decal_Lillypads_normal.png
uploadId: 895866
Binary file not shown.

After

Width:  |  Height:  |  Size: 821 KiB

@@ -0,0 +1,122 @@
fileFormatVersion: 2
guid: d659c0971294eff4bb817b27629a8ffb
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 2
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Materials/Effects/Decals/Textures/Decal_OilSlick.png
uploadId: 895866
Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

@@ -0,0 +1,122 @@
fileFormatVersion: 2
guid: 8ab22c07dc4ce1946ad2c01b0e067a8f
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 1
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Materials/Effects/Decals/Textures/Decal_OilSlick_normal.png
uploadId: 895866
Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

@@ -0,0 +1,122 @@
fileFormatVersion: 2
guid: 071d6ffaa8978624380c121b564b4767
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Materials/Effects/Decals/Textures/Decal_OilSpill.png
uploadId: 895866
Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

@@ -0,0 +1,137 @@
fileFormatVersion: 2
guid: 701a0762a3e06c64683ec5df2e26d6ae
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Materials/Effects/Decals/Textures/Decal_Reticle.png
uploadId: 895866
@@ -0,0 +1,101 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-2558126863425172776
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 10
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 32
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Water Decal Duckweed
m_Shader: {fileID: -6465566751694194690, guid: c5da8e34fcbc64721b185986ff6d6d02, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _ALIGN_TO_WATER
- _ALPHATEST_ON
- _SURFACE_TYPE_TRANSPARENT
m_InvalidKeywords:
- _EMISSION
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3001
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- MOTIONVECTORS
- SHADOWCASTER
- DepthOnly
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: 8e38e48ea1eb3ec419a26404fafba4a5, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 2800000, guid: 4c9ea1582510bd64390da0954df9ba78, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Mask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _ALIGN_TO_WATER: 1
- _AlphaClip: 1
- _AlphaToMask: 0
- _Alpha_Clip_Threshold: 0.5
- _Blend: 0
- _BlendModePreserveSpecular: 0
- _CastShadows: 0
- _Cull: 2
- _DstBlend: 10
- _DstBlendAlpha: 10
- _Metalicness: 0
- _Offset: 0.05
- _QueueControl: 0
- _QueueOffset: 1
- _ReceiveShadows: 1
- _Smoothness: 0.258
- _SrcBlend: 5
- _SrcBlendAlpha: 1
- _Surface: 1
- _Use_Vertex_Color_Alpha: 0
- _WorkflowMode: 1
- _ZTest: 4
- _ZWrite: 0
- _ZWriteControl: 2
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Specular_Color: {r: 0.20754719, g: 0.20754719, b: 0.20754719, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
@@ -0,0 +1,15 @@
fileFormatVersion: 2
guid: 40af100a238bec94e9287e88c28360c3
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Materials/Effects/Decals/Water Decal Duckweed.mat
uploadId: 895866
@@ -0,0 +1,99 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-2558126863425172776
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 10
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 32
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Water Decal Foam
m_Shader: {fileID: -6465566751694194690, guid: c5da8e34fcbc64721b185986ff6d6d02, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _ALIGN_TO_WATER
- _SPECULAR_SETUP
- _SURFACE_TYPE_TRANSPARENT
m_InvalidKeywords:
- _EMISSION
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3003
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- MOTIONVECTORS
- SHADOWCASTER
- DepthOnly
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: 160b537c0a446194a8eafd77ad66f213, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Mask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _ALIGN_TO_WATER: 1
- _AlphaClip: 0
- _AlphaToMask: 0
- _Alpha_Clip_Threshold: 0.5
- _Blend: 0
- _BlendModePreserveSpecular: 0
- _CastShadows: 0
- _Cull: 2
- _DstBlend: 10
- _Metalicness: 0
- _Offset: 0.57
- _QueueControl: 0
- _QueueOffset: 3
- _ReceiveShadows: 1
- _Smoothness: 0
- _SrcBlend: 5
- _Surface: 1
- _Use_Vertex_Color_Alpha: 0
- _WorkflowMode: 0
- _ZTest: 4
- _ZWrite: 0
- _ZWriteControl: 2
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Specular_Color: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
@@ -0,0 +1,15 @@
fileFormatVersion: 2
guid: 9a539774adc6357439cb795e206e517b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Materials/Effects/Decals/Water Decal Foam.mat
uploadId: 895866
@@ -0,0 +1,101 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-2558126863425172776
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 10
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 32
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Water Decal Lillypads
m_Shader: {fileID: -6465566751694194690, guid: c5da8e34fcbc64721b185986ff6d6d02, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _ALIGN_TO_WATER
- _ALPHATEST_ON
- _SURFACE_TYPE_TRANSPARENT
m_InvalidKeywords:
- _EMISSION
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3001
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- MOTIONVECTORS
- SHADOWCASTER
- DepthOnly
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: bde8e2bee22b8da4a9f17b2aa71bb078, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 2800000, guid: 0d6741e2bcf2ad3488b320b99873d262, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Mask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _ALIGN_TO_WATER: 1
- _AlphaClip: 1
- _AlphaToMask: 0
- _Alpha_Clip_Threshold: 0.5
- _Blend: 0
- _BlendModePreserveSpecular: 0
- _CastShadows: 0
- _Cull: 2
- _DstBlend: 10
- _DstBlendAlpha: 10
- _Metalicness: 0
- _Offset: 0.01
- _QueueControl: 0
- _QueueOffset: 1
- _ReceiveShadows: 1
- _Smoothness: 0.225
- _SrcBlend: 5
- _SrcBlendAlpha: 1
- _Surface: 1
- _Use_Vertex_Color_Alpha: 0
- _WorkflowMode: 1
- _ZTest: 4
- _ZWrite: 0
- _ZWriteControl: 2
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Specular_Color: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
@@ -0,0 +1,15 @@
fileFormatVersion: 2
guid: eaece4f6e40049e42a8e8572185e9dda
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Materials/Effects/Decals/Water Decal Lillypads.mat
uploadId: 895866
@@ -0,0 +1,100 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-2558126863425172776
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 10
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 32
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Water Decal Oil Slick
m_Shader: {fileID: -6465566751694194690, guid: c5da8e34fcbc64721b185986ff6d6d02, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _ALIGN_TO_WATER
- _SPECULAR_SETUP
- _SURFACE_TYPE_TRANSPARENT
m_InvalidKeywords:
- _EMISSION
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3001
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- MOTIONVECTORS
- SHADOWCASTER
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: d659c0971294eff4bb817b27629a8ffb, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 2800000, guid: 8ab22c07dc4ce1946ad2c01b0e067a8f, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Mask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _ALIGN_TO_WATER: 1
- _AlphaClip: 0
- _AlphaToMask: 0
- _Alpha_Clip_Threshold: 0.5
- _Blend: 0
- _BlendModePreserveSpecular: 0
- _CastShadows: 0
- _Cull: 2
- _DstBlend: 10
- _DstBlendAlpha: 10
- _Metalicness: 1
- _Offset: 0.45
- _QueueControl: 0
- _QueueOffset: 1
- _ReceiveShadows: 1
- _Smoothness: 0.906
- _SrcBlend: 5
- _SrcBlendAlpha: 1
- _Surface: 1
- _Use_Vertex_Color_Alpha: 0
- _WorkflowMode: 0
- _ZTest: 4
- _ZWrite: 1
- _ZWriteControl: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 0.59607846}
- _Specular_Color: {r: 0.20754719, g: 0.20754719, b: 0.20754719, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
@@ -0,0 +1,15 @@
fileFormatVersion: 2
guid: e3f310d4285af984b832bd0fff985fb8
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Materials/Effects/Decals/Water Decal Oil Slick.mat
uploadId: 895866
@@ -0,0 +1,101 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-2558126863425172776
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 10
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 32
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Water Decal Oil Spill
m_Shader: {fileID: -6465566751694194690, guid: c5da8e34fcbc64721b185986ff6d6d02, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _ALIGN_TO_WATER
- _SPECULAR_SETUP
- _SURFACE_TYPE_TRANSPARENT
m_InvalidKeywords:
- _EMISSION
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3001
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- MOTIONVECTORS
- SHADOWCASTER
- DepthOnly
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: 071d6ffaa8978624380c121b564b4767, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Mask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _ALIGN_TO_WATER: 1
- _AlphaClip: 0
- _AlphaToMask: 0
- _Alpha_Clip_Threshold: 0.5
- _Blend: 0
- _BlendModePreserveSpecular: 0
- _CastShadows: 0
- _Cull: 2
- _DstBlend: 10
- _DstBlendAlpha: 10
- _Metalicness: 1
- _Offset: 0.5
- _QueueControl: 0
- _QueueOffset: 1
- _ReceiveShadows: 1
- _Smoothness: 0.285
- _SrcBlend: 5
- _SrcBlendAlpha: 1
- _Surface: 1
- _Use_Vertex_Color_Alpha: 0
- _WorkflowMode: 0
- _ZTest: 4
- _ZWrite: 0
- _ZWriteControl: 2
m_Colors:
- _BaseColor: {r: 0.122641504, g: 0.054977227, b: 0, a: 1}
- _Specular_Color: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1
@@ -0,0 +1,15 @@
fileFormatVersion: 2
guid: be608986acd5ad84da0ba695afb3d3cd
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 287769
packageName: Stylized Water 3
packageVersion: 3.2.6
assetPath: Assets/Stylized Water 3/Materials/Effects/Decals/Water Decal Oil Spill.mat
uploadId: 895866

Some files were not shown because too many files have changed in this diff Show More