Add water system package
This commit is contained in:
@@ -0,0 +1,139 @@
|
||||
Shader "Hidden/BoatAttack/Caustics"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
//Vector1_F3303B3C("Speed", Float) = 0.5
|
||||
_Size("Size", Float) = 0.5
|
||||
[NoScaleOffset]_CausticMap("Caustics", 2D) = "white" {}
|
||||
_WaterLevel("WaterLevel", Float) = 0
|
||||
_BlendDistance("BlendDistance", Float) = 3
|
||||
//Vector1_CD857B77("CausticsRGB Split", Float) = 2
|
||||
|
||||
//Color blends
|
||||
[HideInInspector] _SrcBlend("__src", Float) = 2.0
|
||||
[HideInInspector] _DstBlend("__dst", Float) = 0.0
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
ZWrite Off
|
||||
|
||||
Pass
|
||||
{
|
||||
Blend [_SrcBlend] [_DstBlend], One Zero
|
||||
|
||||
HLSLPROGRAM
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
|
||||
|
||||
#pragma multi_compile _ _DEBUG
|
||||
#pragma multi_compile _ _STATIC_SHADER
|
||||
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
struct Attributes
|
||||
{
|
||||
float4 positionOS : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct Varyings
|
||||
{
|
||||
float4 screenpos : TEXCOORD0;
|
||||
float4 positionCS : SV_POSITION;
|
||||
};
|
||||
|
||||
TEXTURE2D(_CausticMap); SAMPLER(sampler_CausticMap);
|
||||
TEXTURE2D(_AbsorptionScatteringRamp); SAMPLER(sampler_AbsorptionScatteringRamp);
|
||||
|
||||
half _Size;
|
||||
half _WaterLevel;
|
||||
half _MaxDepth;
|
||||
half _BlendDistance;
|
||||
half4x4 _MainLightDir;
|
||||
|
||||
// World Posision reconstriction
|
||||
float3 ReconstructWorldPos(half2 screenPos, float depth)
|
||||
{
|
||||
float4x4 mat = UNITY_MATRIX_I_VP;
|
||||
#if UNITY_REVERSED_Z
|
||||
mat._12_22_32_42 = -mat._12_22_32_42;
|
||||
#else
|
||||
depth = depth * 2 - 1;
|
||||
#endif
|
||||
float4 raw = mul(mat, float4(screenPos * 2 - 1, depth, 1));
|
||||
float3 worldPos = raw.rgb / raw.a;
|
||||
return worldPos;
|
||||
}
|
||||
|
||||
// Can be done per-vertex
|
||||
float2 CausticUVs(float2 rawUV, float2 offset)
|
||||
{
|
||||
float2 uv = rawUV * _Size;
|
||||
return uv + offset * 0.1;
|
||||
}
|
||||
|
||||
Varyings vert (Attributes input)
|
||||
{
|
||||
Varyings output;
|
||||
|
||||
VertexPositionInputs vertexInput = GetVertexPositionInputs(input.positionOS.xyz);
|
||||
output.positionCS = vertexInput.positionCS;
|
||||
output.screenpos = ComputeScreenPos(output.positionCS);
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
real4 frag (Varyings input) : SV_Target
|
||||
{
|
||||
float4 screenPos = input.screenpos / input.screenpos.w;
|
||||
|
||||
// Get depth
|
||||
real depth = SampleSceneDepth(screenPos.xy);
|
||||
|
||||
// Get main light
|
||||
Light MainLight = GetMainLight();
|
||||
|
||||
// Reconstruct Position of objects in depth map
|
||||
float4 WorldPos = ReconstructWorldPos(screenPos.xy, depth).xyzz;
|
||||
|
||||
// Get light direction and use it to rotate the world position
|
||||
float3 LightUVs = mul(WorldPos, _MainLightDir).xyz;
|
||||
|
||||
#if defined(_STATIC_SHADER)
|
||||
float time = 0;
|
||||
#else
|
||||
float time = _Time.x;
|
||||
#endif
|
||||
|
||||
// Read wave texture for noise to offset cautics UVs
|
||||
float2 uv = WorldPos.xz * 0.025 + time * 0.25;
|
||||
float waveOffset = SAMPLE_TEXTURE2D(_CausticMap, sampler_CausticMap, uv).w - 0.5;
|
||||
|
||||
float2 causticUV = CausticUVs(LightUVs.xy, waveOffset);
|
||||
|
||||
float LodLevel = abs(WorldPos.y - _WaterLevel) * 4 / _BlendDistance;
|
||||
float4 A = SAMPLE_TEXTURE2D_LOD(_CausticMap, sampler_CausticMap, causticUV + time, LodLevel);
|
||||
float4 B = SAMPLE_TEXTURE2D_LOD(_CausticMap, sampler_CausticMap, causticUV * 2.0, LodLevel);
|
||||
|
||||
float CausticsDriver = (A.z * B.z) * 10 + A.z + B.z;
|
||||
|
||||
// Mask caustics from above water and fade below
|
||||
half upperMask = saturate(-WorldPos.y + _WaterLevel);
|
||||
half lowerMask = saturate((WorldPos.y - _WaterLevel) / _BlendDistance + _BlendDistance);
|
||||
CausticsDriver *= min(upperMask, lowerMask);
|
||||
|
||||
// Fake light dispersion
|
||||
half3 Caustics = CausticsDriver * half3(A.w * 0.5, B.w * 0.75, B.x) * MainLight.color;
|
||||
|
||||
#ifdef _DEBUG
|
||||
return real4(Caustics, 1.0);
|
||||
#endif
|
||||
// Add 1 for blending level to work nicely
|
||||
return real4(Caustics + 1.0, 1.0);
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 90939d2e4b62841d29c136c866715501
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures:
|
||||
- _CausticMap: {instanceID: 0}
|
||||
nonModifiableTextures: []
|
||||
preprocessorOverride: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,49 @@
|
||||
#ifndef COMMON_UTILITIES_INCLUDED
|
||||
#define COMMON_UTILITIES_INCLUDED
|
||||
|
||||
// remaps a value based on a in:min/max and out:min/max
|
||||
// value = value to be remapped
|
||||
// remap = x = min in, y = max in, z = min out, w = max out
|
||||
float Remap(half value, half4 remap)
|
||||
{
|
||||
return remap.z + (value - remap.x) * (remap.w - remap.z) / (remap.y - remap.x);
|
||||
}
|
||||
|
||||
// Converts greyscale height to normal
|
||||
// _tex = input texture(separate from a sampler)
|
||||
// _sampler = the sampler to use
|
||||
// _uv = uv coordinates
|
||||
// _intensity = intensity of the effect
|
||||
float3 HeightToNormal(Texture2D _tex, SamplerState _sampler, float2 _uv, half _intensity)
|
||||
{
|
||||
float3 bumpSamples;
|
||||
bumpSamples.x = _tex.Sample(_sampler, _uv).x; // Sample center
|
||||
bumpSamples.y = _tex.Sample(_sampler, float2(_uv.x + _intensity / _ScreenParams.x, _uv.y)).x; // Sample U
|
||||
bumpSamples.z = _tex.Sample(_sampler, float2(_uv.x, _uv.y + _intensity / _ScreenParams.y)).x; // Sample V
|
||||
half dHdU = bumpSamples.z - bumpSamples.x;//bump U offset
|
||||
half dHdV = bumpSamples.y - bumpSamples.x;//bump V offset
|
||||
return float3(-dHdU, dHdV, 0.5);//return tangent normal
|
||||
}
|
||||
|
||||
// Simple noise from thebookofshaders.com
|
||||
// 2D Random
|
||||
float2 random(float2 st){
|
||||
st = float2( dot(st,float2(127.1,311.7)), dot(st,float2(269.5,183.3)) );
|
||||
return -1.0 + 2.0 * frac(sin(st) * 43758.5453123);
|
||||
}
|
||||
|
||||
// 2D Noise based on Morgan McGuire @morgan3d
|
||||
// https://www.shadertoy.com/view/4dS3Wd
|
||||
float noise (float2 st) {
|
||||
float2 i = floor(st);
|
||||
float2 f = frac(st);
|
||||
|
||||
float2 u = f*f*(3.0-2.0*f);
|
||||
|
||||
return lerp( lerp( dot( random(i), f),
|
||||
dot( random(i + float2(1.0,0.0) ), f - float2(1.0,0.0) ), u.x),
|
||||
lerp( dot( random(i + float2(0.0,1.0) ), f - float2(0.0,1.0) ),
|
||||
dot( random(i + float2(1.0,1.0) ), f - float2(1.0,1.0) ), u.x), u.y);
|
||||
}
|
||||
|
||||
#endif // COMMON_UTILITIES_INCLUDED
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 74c950d64fbb9465c9dd5b5d9800f9f5
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,108 @@
|
||||
#ifndef GERSTNER_WAVES_INCLUDED
|
||||
#define GERSTNER_WAVES_INCLUDED
|
||||
|
||||
uniform uint _WaveCount; // how many waves, set via the water component
|
||||
|
||||
struct Wave
|
||||
{
|
||||
float amplitude;
|
||||
float direction;
|
||||
float wavelength;
|
||||
float2 origin;
|
||||
float omni;
|
||||
};
|
||||
|
||||
#if defined(USE_STRUCTURED_BUFFER)
|
||||
StructuredBuffer<Wave> _WaveDataBuffer;
|
||||
#else
|
||||
half4 waveData[20]; // 0-9 amplitude, direction, wavelength, omni, 10-19 origin.xy
|
||||
#endif
|
||||
|
||||
struct WaveStruct
|
||||
{
|
||||
float3 position;
|
||||
float3 normal;
|
||||
};
|
||||
|
||||
WaveStruct GerstnerWave(half2 pos, float waveCountMulti, half amplitude, half direction, half wavelength, half omni, half2 omniPos)
|
||||
{
|
||||
WaveStruct waveOut;
|
||||
#if defined(_STATIC_SHADER)
|
||||
float time = 0;
|
||||
#else
|
||||
float time = _Time.y;
|
||||
#endif
|
||||
|
||||
////////////////////////////////wave value calculations//////////////////////////
|
||||
half3 wave = 0; // wave vector
|
||||
half w = 6.28318 / wavelength; // 2pi over wavelength(hardcoded)
|
||||
half wSpeed = sqrt(9.8 * w); // frequency of the wave based off wavelength
|
||||
half peak = 1.5; // peak value, 1 is the sharpest peaks
|
||||
half qi = peak / (amplitude * w * _WaveCount);
|
||||
|
||||
direction = radians(direction); // convert the incoming degrees to radians, for directional waves
|
||||
half2 dirWaveInput = half2(sin(direction), cos(direction)) * (1 - omni);
|
||||
half2 omniWaveInput = (pos - omniPos) * omni;
|
||||
|
||||
half2 windDir = normalize(dirWaveInput + omniWaveInput); // calculate wind direction
|
||||
half dir = dot(windDir, pos - (omniPos * omni)); // calculate a gradient along the wind direction
|
||||
|
||||
////////////////////////////position output calculations/////////////////////////
|
||||
half calc = dir * w + -time * wSpeed; // the wave calculation
|
||||
half cosCalc = cos(calc); // cosine version(used for horizontal undulation)
|
||||
half sinCalc = sin(calc); // sin version(used for vertical undulation)
|
||||
|
||||
// calculate the offsets for the current point
|
||||
wave.xz = qi * amplitude * windDir.xy * cosCalc;
|
||||
wave.y = ((sinCalc * amplitude)) * waveCountMulti;// the height is divided by the number of waves
|
||||
|
||||
////////////////////////////normal output calculations/////////////////////////
|
||||
half wa = w * amplitude;
|
||||
// normal vector
|
||||
half3 n = half3(-(windDir.xy * wa * cosCalc),
|
||||
1-(qi * wa * sinCalc));
|
||||
|
||||
////////////////////////////////assign to output///////////////////////////////
|
||||
waveOut.position = wave * saturate(amplitude * 10000);
|
||||
waveOut.normal = (n.xzy * waveCountMulti);
|
||||
|
||||
return waveOut;
|
||||
}
|
||||
|
||||
inline void SampleWaves(float3 position, half opacity, out WaveStruct waveOut)
|
||||
{
|
||||
half2 pos = position.xz;
|
||||
waveOut.position = 0;
|
||||
waveOut.normal = 0;
|
||||
half waveCountMulti = 1.0 / _WaveCount;
|
||||
half3 opacityMask = saturate(half3(3, 3, 1) * opacity);
|
||||
|
||||
UNITY_LOOP
|
||||
for(uint i = 0; i < _WaveCount; i++)
|
||||
{
|
||||
#if defined(USE_STRUCTURED_BUFFER)
|
||||
Wave w = _WaveDataBuffer[i];
|
||||
#else
|
||||
Wave w;
|
||||
w.amplitude = waveData[i].x;
|
||||
w.direction = waveData[i].y;
|
||||
w.wavelength = waveData[i].z;
|
||||
w.omni = waveData[i].w;
|
||||
w.origin = waveData[i + 10].xy;
|
||||
#endif
|
||||
WaveStruct wave = GerstnerWave(pos,
|
||||
waveCountMulti,
|
||||
w.amplitude,
|
||||
w.direction,
|
||||
w.wavelength,
|
||||
w.omni,
|
||||
w.origin); // calculate the wave
|
||||
|
||||
waveOut.position += wave.position; // add the position
|
||||
waveOut.normal += wave.normal; // add the normal
|
||||
}
|
||||
waveOut.position *= opacityMask;
|
||||
waveOut.normal *= half3(opacity, 1, opacity);
|
||||
}
|
||||
|
||||
#endif // GERSTNER_WAVES_INCLUDED
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 218546c4603ef4cbd9ebc00e80bf714d
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 88513df6dcc2e42048817fd8a57904b9
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,109 @@
|
||||
{
|
||||
"m_SerializedProperties": [
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.Vector2ShaderProperty"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_Name\": \"Vector 2\",\n \"m_GeneratePropertyBlock\": true,\n \"m_Guid\": {\n \"m_GuidSerialized\": \"88b7efb8-be5d-4496-ba09-4d430fc6423b\"\n },\n \"m_DefaultReferenceName\": \"Vector2_BC829BCE\",\n \"m_OverrideReferenceName\": \"\",\n \"m_Value\": {\n \"x\": 0.0,\n \"y\": 0.0,\n \"z\": 0.0,\n \"w\": 0.0\n },\n \"m_Hidden\": false\n}"
|
||||
}
|
||||
],
|
||||
"m_GUID": {
|
||||
"m_GuidSerialized": "86ffa601-7695-4f3f-b4a5-8ad0731529eb"
|
||||
},
|
||||
"m_SerializableNodes": [
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.SubGraphOutputNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"c3ddab77-2275-442d-881c-6e7df36e94e2\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"SubGraphOutputs\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 652.0,\n \"y\": -12.0,\n \"width\": 208.0,\n \"height\": 351.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector4MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Output 1\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Output1\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.SineNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"484819f3-bc05-4dd6-8c34-db0b85970eb9\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Sine\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -35.49995422363281,\n \"y\": -102.0,\n \"width\": 126.0,\n \"height\": 94.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"In\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"In\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_PreviewExpanded\": false\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.CosineNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"e37d3a70-615a-442f-b583-732e50988715\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Cosine\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -37.49992370605469,\n \"y\": 8.0,\n \"width\": 126.0,\n \"height\": 94.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"In\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"In\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_PreviewExpanded\": false\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.SplitNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"41d89d3e-4071-4778-8334-db448d97cda0\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Split\",\n \"m_DrawState\": {\n \"m_Expanded\": false,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -221.50003051757813,\n \"y\": -75.0,\n \"width\": 115.00000762939453,\n \"height\": 149.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"In\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"In\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"R\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"R\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"G\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"G\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 3,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 4,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.CombineNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"3d525ca4-def9-4fa4-9ce5-b816e075cd5a\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Combine\",\n \"m_DrawState\": {\n \"m_Expanded\": false,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 116.50001525878906,\n \"y\": -61.0,\n \"width\": 95.0,\n \"height\": 118.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"R\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"R\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"G\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"G\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 3,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector4MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 4,\\n \\\"m_DisplayName\\\": \\\"RGBA\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"RGBA\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector3MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 5,\\n \\\"m_DisplayName\\\": \\\"RGB\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"RGB\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector2MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 6,\\n \\\"m_DisplayName\\\": \\\"RG\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"RG\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\"\\n ]\\n}\"\n }\n ],\n \"m_PreviewExpanded\": false\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.PropertyNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"5d612b30-4cac-4be9-85fb-7ad6c3299a29\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Property\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -466.0,\n \"y\": -41.0,\n \"width\": 115.0,\n \"height\": 34.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector2MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Vector 2\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\"\\n ]\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true,\n \"m_PropertyGuidSerialized\": \"88b7efb8-be5d-4496-ba09-4d430fc6423b\"\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.NormalizeNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"6f0285e7-475c-45f4-b17b-610704bed243\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Normalize\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 332.0,\n \"y\": 33.0,\n \"width\": 208.0,\n \"height\": 278.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"In\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"In\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true\n}"
|
||||
}
|
||||
],
|
||||
"m_Groups": [],
|
||||
"m_SerializableEdges": [
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"41d89d3e-4071-4778-8334-db448d97cda0\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"484819f3-bc05-4dd6-8c34-db0b85970eb9\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"484819f3-bc05-4dd6-8c34-db0b85970eb9\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"3d525ca4-def9-4fa4-9ce5-b816e075cd5a\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"41d89d3e-4071-4778-8334-db448d97cda0\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"e37d3a70-615a-442f-b583-732e50988715\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"e37d3a70-615a-442f-b583-732e50988715\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"3d525ca4-def9-4fa4-9ce5-b816e075cd5a\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"5d612b30-4cac-4be9-85fb-7ad6c3299a29\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"41d89d3e-4071-4778-8334-db448d97cda0\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 6,\n \"m_NodeGUIDSerialized\": \"3d525ca4-def9-4fa4-9ce5-b816e075cd5a\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"6f0285e7-475c-45f4-b17b-610704bed243\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"6f0285e7-475c-45f4-b17b-610704bed243\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"c3ddab77-2275-442d-881c-6e7df36e94e2\"\n }\n}"
|
||||
}
|
||||
],
|
||||
"m_PreviewData": {
|
||||
"serializedMesh": {
|
||||
"m_SerializedMesh": "",
|
||||
"m_Guid": ""
|
||||
}
|
||||
},
|
||||
"m_Path": "Sub Graphs"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b736aebad82ef413a938600669d91b16
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3}
|
||||
@@ -0,0 +1,272 @@
|
||||
{
|
||||
"m_SerializedProperties": [
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.Vector2ShaderProperty"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_Name\": \"PositionWS\",\n \"m_GeneratePropertyBlock\": true,\n \"m_Guid\": {\n \"m_GuidSerialized\": \"aeefdbaf-8e06-4609-a30f-f67419e845a7\"\n },\n \"m_DefaultReferenceName\": \"Vector2_84DBE9C3\",\n \"m_OverrideReferenceName\": \"_PositionWS\",\n \"m_Value\": {\n \"x\": 0.0,\n \"y\": 0.0,\n \"z\": 0.0,\n \"w\": 0.0\n },\n \"m_Hidden\": false\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.Vector1ShaderProperty"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_Name\": \"WaveSpeed\",\n \"m_GeneratePropertyBlock\": true,\n \"m_Guid\": {\n \"m_GuidSerialized\": \"8f63cb42-bf59-43eb-ba27-5d049864a1b7\"\n },\n \"m_DefaultReferenceName\": \"Vector1_CA0C9FBC\",\n \"m_OverrideReferenceName\": \"_WaveSpeed\",\n \"m_Value\": 1.0,\n \"m_FloatType\": 0,\n \"m_RangeValues\": {\n \"x\": 0.0,\n \"y\": 1.0\n },\n \"m_Hidden\": false\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.Vector2ShaderProperty"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_Name\": \"Direction\",\n \"m_GeneratePropertyBlock\": true,\n \"m_Guid\": {\n \"m_GuidSerialized\": \"d67ebba8-8192-4475-b3e0-2ea7f568875f\"\n },\n \"m_DefaultReferenceName\": \"Vector2_E2C1429D\",\n \"m_OverrideReferenceName\": \"_WaveDirection\",\n \"m_Value\": {\n \"x\": 0.0,\n \"y\": 1.0,\n \"z\": 0.0,\n \"w\": 0.0\n },\n \"m_Hidden\": false\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.Vector1ShaderProperty"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_Name\": \"Wavelength\",\n \"m_GeneratePropertyBlock\": true,\n \"m_Guid\": {\n \"m_GuidSerialized\": \"6e16ae66-da50-4bd7-8271-2cd58482d131\"\n },\n \"m_DefaultReferenceName\": \"Vector1_7F170A2F\",\n \"m_OverrideReferenceName\": \"\",\n \"m_Value\": 5.0,\n \"m_FloatType\": 0,\n \"m_RangeValues\": {\n \"x\": 0.0,\n \"y\": 1.0\n },\n \"m_Hidden\": false\n}"
|
||||
}
|
||||
],
|
||||
"m_GUID": {
|
||||
"m_GuidSerialized": "0aa03c24-2568-4410-b173-f1f1b1423bc7"
|
||||
},
|
||||
"m_SerializableNodes": [
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.SubGraphOutputNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"f40aece3-7622-466f-8d20-8878977bde6c\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"SubGraphOutputs\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 804.0,\n \"y\": 116.0,\n \"width\": 208.0,\n \"height\": 352.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector4MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Output 1\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Output1\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.DotProductNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"81b6e165-ee60-4b75-b79f-ecebc2bc6f47\",\n \"m_GroupGuidSerialized\": \"e1cad54c-ed2c-4ec2-9ca4-8ab28b699bb6\",\n \"m_Name\": \"Dot Product\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -182.9999237060547,\n \"y\": 176.00003051757813,\n \"width\": 122.0,\n \"height\": 118.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 1.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n }\n ],\n \"m_PreviewExpanded\": false\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.MultiplyNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"51e152d7-3931-4d7a-bfcd-bc25dc9a89e9\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Multiply\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 151.0000457763672,\n \"y\": 124.99995422363281,\n \"width\": 122.0,\n \"height\": 118.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 0.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 0.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 0.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 2.0,\\n \\\"e02\\\": 2.0,\\n \\\"e03\\\": 2.0,\\n \\\"e10\\\": 2.0,\\n \\\"e11\\\": 2.0,\\n \\\"e12\\\": 2.0,\\n \\\"e13\\\": 2.0,\\n \\\"e20\\\": 2.0,\\n \\\"e21\\\": 2.0,\\n \\\"e22\\\": 2.0,\\n \\\"e23\\\": 2.0,\\n \\\"e30\\\": 2.0,\\n \\\"e31\\\": 2.0,\\n \\\"e32\\\": 2.0,\\n \\\"e33\\\": 2.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 0.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 0.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 0.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n }\n ],\n \"m_PreviewExpanded\": false\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.TimeNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"38cdda13-6816-454d-a834-035268698849\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Time\",\n \"m_DrawState\": {\n \"m_Expanded\": false,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 48.00003433227539,\n \"y\": 108.99995422363281,\n \"width\": 75.0,\n \"height\": 77.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Time\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Time\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Sine Time\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Sine Time\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"Cosine Time\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Cosine Time\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 3,\\n \\\"m_DisplayName\\\": \\\"Delta Time\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Delta Time\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 4,\\n \\\"m_DisplayName\\\": \\\"Smooth Delta\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Smooth Delta\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.AddNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"bc7444dc-8505-4e77-a28b-6dbe95f7a238\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Add\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 317.0,\n \"y\": 263.0,\n \"width\": 122.0,\n \"height\": 118.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_PreviewExpanded\": false\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.SineNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"1b303909-07bc-4de9-8d41-8b4d762ad743\",\n \"m_GroupGuidSerialized\": \"41c12357-62d5-420d-bbf0-186ea48337b1\",\n \"m_Name\": \"Sine\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -847.0,\n \"y\": 2.0000252723693849,\n \"width\": 123.00000762939453,\n \"height\": 94.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"In\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"In\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_PreviewExpanded\": false\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.CosineNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"dfdf2055-22ce-44e0-9360-bd63d1812c75\",\n \"m_GroupGuidSerialized\": \"41c12357-62d5-420d-bbf0-186ea48337b1\",\n \"m_Name\": \"Cosine\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -849.0,\n \"y\": 112.00003814697266,\n \"width\": 123.00000762939453,\n \"height\": 94.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"In\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"In\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_PreviewExpanded\": false\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.SplitNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"dc545918-35b3-45b4-8b75-44da6099161b\",\n \"m_GroupGuidSerialized\": \"41c12357-62d5-420d-bbf0-186ea48337b1\",\n \"m_Name\": \"Split\",\n \"m_DrawState\": {\n \"m_Expanded\": false,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -983.9999389648438,\n \"y\": 38.0000114440918,\n \"width\": 114.0,\n \"height\": 101.00000762939453\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"In\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"In\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"R\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"R\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"G\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"G\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 3,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 4,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.CombineNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"ca74969a-af21-4f32-906d-74ee8424edb9\",\n \"m_GroupGuidSerialized\": \"41c12357-62d5-420d-bbf0-186ea48337b1\",\n \"m_Name\": \"Combine\",\n \"m_DrawState\": {\n \"m_Expanded\": false,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -694.9999389648438,\n \"y\": 43.00002670288086,\n \"width\": 121.0,\n \"height\": 118.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"R\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"R\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"G\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"G\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 3,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector4MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 4,\\n \\\"m_DisplayName\\\": \\\"RGBA\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"RGBA\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector3MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 5,\\n \\\"m_DisplayName\\\": \\\"RGB\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"RGB\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\",\\n \\\"Z\\\"\\n ]\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector2MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 6,\\n \\\"m_DisplayName\\\": \\\"RG\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"RG\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\"\\n ]\\n}\"\n }\n ],\n \"m_PreviewExpanded\": false\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.NormalizeNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"546ba884-4094-4754-817a-b9419b61d3ae\",\n \"m_GroupGuidSerialized\": \"41c12357-62d5-420d-bbf0-186ea48337b1\",\n \"m_Name\": \"Normalize\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -536.0,\n \"y\": -2.9999916553497316,\n \"width\": 123.00000762939453,\n \"height\": 94.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"In\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"In\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_PreviewExpanded\": false\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.CosineNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"9523a8bd-eb1e-4fe8-879f-40ff1f0e6158\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Cosine\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 637.0,\n \"y\": 65.0,\n \"width\": 123.0,\n \"height\": 94.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"In\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"In\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_PreviewExpanded\": false\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.PropertyNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"d3bf50ed-fd2e-4951-82b0-b533f08c6cd2\",\n \"m_GroupGuidSerialized\": \"e1cad54c-ed2c-4ec2-9ca4-8ab28b699bb6\",\n \"m_Name\": \"Property\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -346.0,\n \"y\": 289.0,\n \"width\": 129.0,\n \"height\": 34.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector2MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"PositionWS\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\"\\n ]\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true,\n \"m_PropertyGuidSerialized\": \"aeefdbaf-8e06-4609-a30f-f67419e845a7\"\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.PropertyNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"e5f420e3-2e52-4998-996b-b5c64ce003e0\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Property\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -7.999978065490723,\n \"y\": 200.0,\n \"width\": 135.0,\n \"height\": 34.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"WaveSpeed\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true,\n \"m_PropertyGuidSerialized\": \"8f63cb42-bf59-43eb-ba27-5d049864a1b7\"\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.PropertyNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"fe02e829-5aaa-4f0b-a386-17a7dbc377a5\",\n \"m_GroupGuidSerialized\": \"41c12357-62d5-420d-bbf0-186ea48337b1\",\n \"m_Name\": \"Property\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -1124.0,\n \"y\": 37.000022888183597,\n \"width\": 117.0,\n \"height\": 34.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector2MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Direction\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0\\n },\\n \\\"m_Labels\\\": [\\n \\\"X\\\",\\n \\\"Y\\\"\\n ]\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true,\n \"m_PropertyGuidSerialized\": \"d67ebba8-8192-4475-b3e0-2ea7f568875f\"\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.PropertyNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"2ea1e991-c155-4ea0-9b87-a68915922e85\",\n \"m_GroupGuidSerialized\": \"efc0a636-e970-439e-81e2-b32304cc24fb\",\n \"m_Name\": \"Property\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -342.0000305175781,\n \"y\": 527.0,\n \"width\": 133.0,\n \"height\": 34.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.Vector1MaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"Wavelength\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": 0.0,\\n \\\"m_DefaultValue\\\": 0.0,\\n \\\"m_Labels\\\": [\\n \\\"X\\\"\\n ]\\n}\"\n }\n ],\n \"m_PreviewExpanded\": true,\n \"m_PropertyGuidSerialized\": \"6e16ae66-da50-4bd7-8271-2cd58482d131\"\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.DivideNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"8f5b007b-9f95-4364-8807-02241e2feb3a\",\n \"m_GroupGuidSerialized\": \"efc0a636-e970-439e-81e2-b32304cc24fb\",\n \"m_Name\": \"Divide\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": -186.00001525878907,\n \"y\": 431.0000305175781,\n \"width\": 124.0,\n \"height\": 118.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 6.283180236816406,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 2.0,\\n \\\"y\\\": 2.0,\\n \\\"z\\\": 2.0,\\n \\\"w\\\": 2.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicVectorMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"x\\\": 0.0,\\n \\\"y\\\": 0.0,\\n \\\"z\\\": 0.0,\\n \\\"w\\\": 0.0\\n }\\n}\"\n }\n ],\n \"m_PreviewExpanded\": false\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.ShaderGraph.MultiplyNode"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_GuidSerialized\": \"3d8cdea2-8c5e-499c-964d-d296b089c944\",\n \"m_GroupGuidSerialized\": \"00000000-0000-0000-0000-000000000000\",\n \"m_Name\": \"Multiply\",\n \"m_DrawState\": {\n \"m_Expanded\": true,\n \"m_Position\": {\n \"serializedVersion\": \"2\",\n \"x\": 44.000003814697269,\n \"y\": 288.0000305175781,\n \"width\": 124.0,\n \"height\": 118.0\n }\n },\n \"m_SerializableSlots\": [\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 0,\\n \\\"m_DisplayName\\\": \\\"A\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"A\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 0.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 0.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 0.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 1,\\n \\\"m_DisplayName\\\": \\\"B\\\",\\n \\\"m_SlotType\\\": 0,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"B\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 2.0,\\n \\\"e01\\\": 2.0,\\n \\\"e02\\\": 2.0,\\n \\\"e03\\\": 2.0,\\n \\\"e10\\\": 2.0,\\n \\\"e11\\\": 2.0,\\n \\\"e12\\\": 2.0,\\n \\\"e13\\\": 2.0,\\n \\\"e20\\\": 2.0,\\n \\\"e21\\\": 2.0,\\n \\\"e22\\\": 2.0,\\n \\\"e23\\\": 2.0,\\n \\\"e30\\\": 2.0,\\n \\\"e31\\\": 2.0,\\n \\\"e32\\\": 2.0,\\n \\\"e33\\\": 2.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n },\n {\n \"typeInfo\": {\n \"fullName\": \"UnityEditor.ShaderGraph.DynamicValueMaterialSlot\"\n },\n \"JSONnodeData\": \"{\\n \\\"m_Id\\\": 2,\\n \\\"m_DisplayName\\\": \\\"Out\\\",\\n \\\"m_SlotType\\\": 1,\\n \\\"m_Priority\\\": 2147483647,\\n \\\"m_Hidden\\\": false,\\n \\\"m_ShaderOutputName\\\": \\\"Out\\\",\\n \\\"m_StageCapability\\\": 3,\\n \\\"m_Value\\\": {\\n \\\"e00\\\": 0.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 0.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 0.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 0.0\\n },\\n \\\"m_DefaultValue\\\": {\\n \\\"e00\\\": 1.0,\\n \\\"e01\\\": 0.0,\\n \\\"e02\\\": 0.0,\\n \\\"e03\\\": 0.0,\\n \\\"e10\\\": 0.0,\\n \\\"e11\\\": 1.0,\\n \\\"e12\\\": 0.0,\\n \\\"e13\\\": 0.0,\\n \\\"e20\\\": 0.0,\\n \\\"e21\\\": 0.0,\\n \\\"e22\\\": 1.0,\\n \\\"e23\\\": 0.0,\\n \\\"e30\\\": 0.0,\\n \\\"e31\\\": 0.0,\\n \\\"e32\\\": 0.0,\\n \\\"e33\\\": 1.0\\n }\\n}\"\n }\n ],\n \"m_PreviewExpanded\": false\n}"
|
||||
}
|
||||
],
|
||||
"m_Groups": [
|
||||
{
|
||||
"m_GuidSerialized": "41c12357-62d5-420d-bbf0-186ea48337b1",
|
||||
"m_Title": "Wind Direction",
|
||||
"m_Position": {
|
||||
"x": 55.292537689208987,
|
||||
"y": 12.417510032653809
|
||||
}
|
||||
},
|
||||
{
|
||||
"m_GuidSerialized": "e1cad54c-ed2c-4ec2-9ca4-8ab28b699bb6",
|
||||
"m_Title": "Direction",
|
||||
"m_Position": {
|
||||
"x": 45.19003677368164,
|
||||
"y": 9.902510643005371
|
||||
}
|
||||
},
|
||||
{
|
||||
"m_GuidSerialized": "efc0a636-e970-439e-81e2-b32304cc24fb",
|
||||
"m_Title": "W",
|
||||
"m_Position": {
|
||||
"x": 41.300079345703128,
|
||||
"y": 35.034942626953128
|
||||
}
|
||||
}
|
||||
],
|
||||
"m_SerializableEdges": [
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"546ba884-4094-4754-817a-b9419b61d3ae\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"81b6e165-ee60-4b75-b79f-ecebc2bc6f47\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"38cdda13-6816-454d-a834-035268698849\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"51e152d7-3931-4d7a-bfcd-bc25dc9a89e9\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"51e152d7-3931-4d7a-bfcd-bc25dc9a89e9\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"bc7444dc-8505-4e77-a28b-6dbe95f7a238\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"bc7444dc-8505-4e77-a28b-6dbe95f7a238\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"9523a8bd-eb1e-4fe8-879f-40ff1f0e6158\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"dc545918-35b3-45b4-8b75-44da6099161b\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"1b303909-07bc-4de9-8d41-8b4d762ad743\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"1b303909-07bc-4de9-8d41-8b4d762ad743\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"ca74969a-af21-4f32-906d-74ee8424edb9\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"dc545918-35b3-45b4-8b75-44da6099161b\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"dfdf2055-22ce-44e0-9360-bd63d1812c75\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"dfdf2055-22ce-44e0-9360-bd63d1812c75\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"ca74969a-af21-4f32-906d-74ee8424edb9\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 6,\n \"m_NodeGUIDSerialized\": \"ca74969a-af21-4f32-906d-74ee8424edb9\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"546ba884-4094-4754-817a-b9419b61d3ae\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"d3bf50ed-fd2e-4951-82b0-b533f08c6cd2\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"81b6e165-ee60-4b75-b79f-ecebc2bc6f47\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"e5f420e3-2e52-4998-996b-b5c64ce003e0\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"51e152d7-3931-4d7a-bfcd-bc25dc9a89e9\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"fe02e829-5aaa-4f0b-a386-17a7dbc377a5\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"dc545918-35b3-45b4-8b75-44da6099161b\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"9523a8bd-eb1e-4fe8-879f-40ff1f0e6158\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"f40aece3-7622-466f-8d20-8878977bde6c\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"2ea1e991-c155-4ea0-9b87-a68915922e85\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"8f5b007b-9f95-4364-8807-02241e2feb3a\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"8f5b007b-9f95-4364-8807-02241e2feb3a\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"3d8cdea2-8c5e-499c-964d-d296b089c944\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"81b6e165-ee60-4b75-b79f-ecebc2bc6f47\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 0,\n \"m_NodeGUIDSerialized\": \"3d8cdea2-8c5e-499c-964d-d296b089c944\"\n }\n}"
|
||||
},
|
||||
{
|
||||
"typeInfo": {
|
||||
"fullName": "UnityEditor.Graphing.Edge"
|
||||
},
|
||||
"JSONnodeData": "{\n \"m_OutputSlot\": {\n \"m_SlotId\": 2,\n \"m_NodeGUIDSerialized\": \"3d8cdea2-8c5e-499c-964d-d296b089c944\"\n },\n \"m_InputSlot\": {\n \"m_SlotId\": 1,\n \"m_NodeGUIDSerialized\": \"bc7444dc-8505-4e77-a28b-6dbe95f7a238\"\n }\n}"
|
||||
}
|
||||
],
|
||||
"m_PreviewData": {
|
||||
"serializedMesh": {
|
||||
"m_SerializedMesh": "",
|
||||
"m_Guid": ""
|
||||
}
|
||||
},
|
||||
"m_Path": "Sub Graphs"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 050d4204de13e4b108feb78488946f52
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3}
|
||||
@@ -0,0 +1,158 @@
|
||||
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
|
||||
|
||||
Shader "Unlit/InfiniteWater"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
_Size ("size", float) = 3.0
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderType"="Transparent" "Queue"="Transparent-101" "RenderPipeline" = "UniversalPipeline" }
|
||||
LOD 100
|
||||
|
||||
Pass
|
||||
{
|
||||
ZWrite On
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
// make fog work
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
#include "WaterInput.hlsl"
|
||||
#include "CommonUtilities.hlsl"
|
||||
#include "WaterLighting.hlsl"
|
||||
|
||||
#define EPSILON 0.00001
|
||||
|
||||
// ray-plane intersection test
|
||||
// @return side of plane hit
|
||||
// 0 : no hit
|
||||
// 1 : front
|
||||
// 2 : back
|
||||
int intersect_plane (float3 ro, float3 rd, float3 po, float3 pd, out float3 hit)
|
||||
{
|
||||
float D = dot(po, pd); // re-parameterize plane to normal + distance
|
||||
float tn = D - dot(ro, pd); // ray pos w.r.t. plane (frnt, back, on)
|
||||
float td = dot (rd, pd); // ray ori w.r.t. plane (towards, away, parallel)
|
||||
|
||||
if (td > -EPSILON && td < EPSILON) return 0; // parallel to plane
|
||||
|
||||
float t = tn / td; // dist along ray to hit
|
||||
if (t < 0.0) return 0; // plane lies behind ray
|
||||
hit = ro + t * rd; // got a hit
|
||||
return (tn > 0.0) ? 2 : 1; // which side of the plane?
|
||||
}
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 screenPos : TEXCOORD2;//screen position of the verticies after wave distortion
|
||||
float4 viewDir : TEXCOORD3;
|
||||
float4 vertex : SV_POSITION;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
float _Size;
|
||||
float _CameraRoll;
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
float3 posWS = TransformObjectToWorld(v.vertex.xyz);
|
||||
o.vertex = TransformWorldToHClip(posWS);
|
||||
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
|
||||
o.screenPos = ComputeScreenPos(o.vertex);
|
||||
o.viewDir.xyz = UNITY_MATRIX_IT_MV[2].xyz;
|
||||
float3 viewPos = TransformWorldToView(posWS);// posWS - _WorldSpaceCameraPos;
|
||||
o.viewDir.w = length(viewPos / viewPos.z);
|
||||
return o;
|
||||
}
|
||||
|
||||
void frag (v2f i, out half4 outColor:SV_Target, out float outDepth : SV_Depth) //: SV_Target
|
||||
{
|
||||
|
||||
float3 viewDir = i.viewDir.xyz; //UNITY_MATRIX_IT_MV[2].xyz;
|
||||
float3 pos = _WorldSpaceCameraPos * viewDir;
|
||||
i.uv = pos.xy;
|
||||
|
||||
//////
|
||||
float4 p = i.screenPos;
|
||||
float2 uv = p.xy / p.w; // [0, 1]
|
||||
half2 st = 2.0 * uv - half2(1.0, 1.0);
|
||||
|
||||
float asp = _ScreenParams.x / _ScreenParams.y;
|
||||
|
||||
float2 st_adj = float2(st.x * asp, st.y);
|
||||
|
||||
// camera settings
|
||||
//float dist = 2.0 + 0.5*sin(0.5*Time);
|
||||
//float theta = 0.1230596391*_Time.y;
|
||||
// float cx = dist * sin(theta);
|
||||
// float cz = dist * cos(theta);
|
||||
float3 cam_ori = float3(-_WorldSpaceCameraPos.x, _WorldSpaceCameraPos.y, _WorldSpaceCameraPos.z);
|
||||
// vec3 cam_look = vec3(0.0, 0.50, 0.0);
|
||||
float3 cam_dir = float3(viewDir.x, -viewDir.y, -viewDir.z);
|
||||
|
||||
// over, up, norm basis vectors for camera
|
||||
half zRot = radians(-_CameraRoll);
|
||||
float3 cam_ovr = normalize(cross(cam_dir, half3(0, cos(zRot), sin(zRot))));
|
||||
float3 cam_uhp = normalize(cross(cam_ovr, cam_dir));
|
||||
|
||||
// scene
|
||||
float3 po = 0;
|
||||
float3 pd = half3(0.0, 1.0, 0.0);
|
||||
|
||||
// ray
|
||||
half3 ro = cam_ori;
|
||||
|
||||
float cam_dist = unity_CameraProjection._m11;//80 degrees = 1.2
|
||||
float3 rt = cam_ori + cam_dist*cam_dir;
|
||||
rt += st_adj.x * cam_ovr;
|
||||
rt += st_adj.y * cam_uhp;
|
||||
half3 rd = normalize(rt - cam_ori);
|
||||
|
||||
float3 hit;
|
||||
int side = intersect_plane (ro, rd, po, pd, hit);
|
||||
if(side == 0)
|
||||
discard;
|
||||
|
||||
//half fog = pow(1-abs(rd.y), 20);
|
||||
// plane
|
||||
// - figure out UV on plane to sample texture
|
||||
half3 dee = hit;
|
||||
float tSize = 0.05;
|
||||
float2 p_uv = float2(dot(dee, half3(1, 0, 0)) * tSize, dot(dee, half3(0, 0, 1)) * tSize);
|
||||
///
|
||||
// sample the texture
|
||||
half4 col = tex2D(_MainTex, p_uv);
|
||||
|
||||
//re-construct depth
|
||||
half3 camPos = _WorldSpaceCameraPos;
|
||||
float a = _ProjectionParams.z / ( _ProjectionParams.z - _ProjectionParams.y );
|
||||
float b = _ProjectionParams.z * _ProjectionParams.y / ( _ProjectionParams.y - _ProjectionParams.z );
|
||||
float z = length(hit + half3(camPos.x, camPos.y + 1, -camPos.z)) / i.viewDir.w;
|
||||
float d = a + b / z;
|
||||
// apply fog
|
||||
//UNITY_APPLY_FOG(i.fogCoord, col);
|
||||
//return float4(col);
|
||||
//outColor = half4(i.viewDir.xyz, 1);
|
||||
outColor = half4(frac(p_uv), frac(1-d), 1);
|
||||
outDepth = 1-d;
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
FallBack "Hidden/InternalErrorShader"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f51d4f8f480441339ead24ab495af7d
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,52 @@
|
||||
Shader "BoatAttack/Water"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_BumpScale("Detail Wave Amount", Range(0, 2)) = 0.2//fine detail multiplier
|
||||
_DitherPattern ("Dithering Pattern", 2D) = "bump" {}
|
||||
[Toggle(_STATIC_SHADER)] _Static ("Static", Float) = 0
|
||||
[KeywordEnum(Off, SSS, Refraction, Reflection, Normal, Fresnel, WaterEffects, Foam, WaterDepth)] _Debug ("Debug mode", Float) = 0
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderType"="Transparent" "Queue"="Transparent-100" "RenderPipeline" = "UniversalPipeline" }
|
||||
ZWrite On
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "WaterShading"
|
||||
Tags{"LightMode" = "UniversalForward"}
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma prefer_hlslcc gles
|
||||
/////////////////SHADER FEATURES//////////////////
|
||||
#pragma shader_feature _REFLECTION_CUBEMAP _REFLECTION_PROBES _REFLECTION_PLANARREFLECTION
|
||||
#pragma multi_compile _ USE_STRUCTURED_BUFFER
|
||||
#pragma multi_compile _ _STATIC_SHADER
|
||||
#pragma shader_feature _DEBUG_OFF _DEBUG_SSS _DEBUG_REFRACTION _DEBUG_REFLECTION _DEBUG_NORMAL _DEBUG_FRESNEL _DEBUG_WATEREFFECTS _DEBUG_FOAM _DEBUG_WATERDEPTH
|
||||
|
||||
// -------------------------------------
|
||||
// Lightweight Pipeline keywords
|
||||
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS
|
||||
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE
|
||||
#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
|
||||
#pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS
|
||||
#pragma multi_compile _ _SHADOWS_SOFT
|
||||
|
||||
//--------------------------------------
|
||||
// GPU Instancing
|
||||
#pragma multi_compile_instancing
|
||||
#pragma multi_compile_fog
|
||||
|
||||
////////////////////INCLUDES//////////////////////
|
||||
#include "WaterCommon.hlsl"
|
||||
|
||||
//non-tess
|
||||
#pragma vertex WaterVertex
|
||||
#pragma fragment WaterFragment
|
||||
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
FallBack "Hidden/InternalErrorShader"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a94edd303261140cf9e6ce8c90d7a99a
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,301 @@
|
||||
#ifndef WATER_COMMON_INCLUDED
|
||||
#define WATER_COMMON_INCLUDED
|
||||
|
||||
#define SHADOWS_SCREEN 0
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
#include "WaterInput.hlsl"
|
||||
#include "CommonUtilities.hlsl"
|
||||
#include "GerstnerWaves.hlsl"
|
||||
#include "WaterLighting.hlsl"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Structs //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
struct WaterVertexInput // vert struct
|
||||
{
|
||||
float4 vertex : POSITION; // vertex positions
|
||||
float2 texcoord : TEXCOORD0; // local UVs
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct WaterVertexOutput // fragment struct
|
||||
{
|
||||
float4 uv : TEXCOORD0; // Geometric UVs stored in xy, and world(pre-waves) in zw
|
||||
float3 posWS : TEXCOORD1; // world position of the vertices
|
||||
half3 normal : NORMAL; // vert normals
|
||||
float3 viewDir : TEXCOORD2; // view direction
|
||||
float3 preWaveSP : TEXCOORD3; // screen position of the verticies before wave distortion
|
||||
half2 fogFactorNoise : TEXCOORD4; // x: fogFactor, y: noise
|
||||
float4 additionalData : TEXCOORD5; // x = distance to surface, y = distance to surface, z = normalized wave height, w = horizontal movement
|
||||
half4 shadowCoord : TEXCOORD6; // for ssshadows
|
||||
|
||||
float4 clipPos : SV_POSITION;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Water debug functions //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
half3 DebugWaterFX(half3 input, half4 waterFX, half screenUV)
|
||||
{
|
||||
input = lerp(input, half3(waterFX.y, 1, waterFX.z), saturate(floor(screenUV + 0.7)));
|
||||
input = lerp(input, waterFX.xxx, saturate(floor(screenUV + 0.5)));
|
||||
half3 disp = lerp(0, half3(1, 0, 0), saturate((waterFX.www - 0.5) * 4));
|
||||
disp += lerp(0, half3(0, 0, 1), saturate(((1-waterFX.www) - 0.5) * 4));
|
||||
input = lerp(input, disp, saturate(floor(screenUV + 0.3)));
|
||||
return input;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Water shading functions //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
half3 Scattering(half depth)
|
||||
{
|
||||
return SAMPLE_TEXTURE2D(_AbsorptionScatteringRamp, sampler_AbsorptionScatteringRamp, half2(depth, 0.375h)).rgb;
|
||||
}
|
||||
|
||||
half3 Absorption(half depth)
|
||||
{
|
||||
return SAMPLE_TEXTURE2D(_AbsorptionScatteringRamp, sampler_AbsorptionScatteringRamp, half2(depth, 0.0h)).rgb;
|
||||
}
|
||||
|
||||
float2 AdjustedDepth(half2 uvs, half4 additionalData)
|
||||
{
|
||||
float rawD = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, sampler_ScreenTextures_linear_clamp, uvs);
|
||||
float d = LinearEyeDepth(rawD, _ZBufferParams);
|
||||
|
||||
// TODO: Changing the usage of UNITY_REVERSED_Z this way to fix testing, but I'm not sure the original code is correct anyway.
|
||||
// In OpenGL, rawD should already have be remmapped before converting depth to linear eye depth.
|
||||
#if UNITY_REVERSED_Z
|
||||
float offset = 0;
|
||||
#else
|
||||
float offset = 1;
|
||||
#endif
|
||||
|
||||
return float2(d * additionalData.x - additionalData.y, (rawD * -_ProjectionParams.x) + offset);
|
||||
}
|
||||
|
||||
float WaterTextureDepth(float3 posWS)
|
||||
{
|
||||
return (1 - SAMPLE_TEXTURE2D_LOD(_WaterDepthMap, sampler_WaterDepthMap_linear_clamp, posWS.xz * 0.002 + 0.5, 1).r) * (_MaxDepth + _VeraslWater_DepthCamParams.x) - _VeraslWater_DepthCamParams.x;
|
||||
}
|
||||
|
||||
float3 WaterDepth(float3 posWS, half4 additionalData, half2 screenUVs)// x = seafloor depth, y = water depth
|
||||
{
|
||||
float3 outDepth = 0;
|
||||
outDepth.xz = AdjustedDepth(screenUVs, additionalData);
|
||||
float wd = WaterTextureDepth(posWS);
|
||||
outDepth.y = wd + posWS.y;
|
||||
return outDepth;
|
||||
}
|
||||
|
||||
half3 Refraction(half2 distortion, half depth, real depthMulti)
|
||||
{
|
||||
half3 output = SAMPLE_TEXTURE2D_LOD(_CameraOpaqueTexture, sampler_CameraOpaqueTexture_linear_clamp, distortion, depth * 0.25).rgb;
|
||||
output *= Absorption((depth) * depthMulti);
|
||||
return output;
|
||||
}
|
||||
|
||||
half2 DistortionUVs(half depth, float3 normalWS)
|
||||
{
|
||||
half3 viewNormal = mul((float3x3)GetWorldToHClipMatrix(), -normalWS).xyz;
|
||||
|
||||
return viewNormal.xz * saturate((depth) * 0.005);
|
||||
}
|
||||
|
||||
half4 AdditionalData(float3 postionWS, WaveStruct wave)
|
||||
{
|
||||
half4 data = half4(0.0, 0.0, 0.0, 0.0);
|
||||
float3 viewPos = TransformWorldToView(postionWS);
|
||||
data.x = length(viewPos / viewPos.z);// distance to surface
|
||||
data.y = length(GetCameraPositionWS().xyz - postionWS); // local position in camera space
|
||||
data.z = wave.position.y / _MaxWaveHeight * 0.5 + 0.5; // encode the normalized wave height into additional data
|
||||
data.w = wave.position.x + wave.position.z;
|
||||
return data;
|
||||
}
|
||||
|
||||
WaterVertexOutput WaveVertexOperations(WaterVertexOutput input)
|
||||
{
|
||||
#ifdef _STATIC_SHADER
|
||||
float time = 0;
|
||||
#else
|
||||
float time = _Time.y;
|
||||
#endif
|
||||
|
||||
input.normal = float3(0, 1, 0);
|
||||
input.fogFactorNoise.y = ((noise((input.posWS.xz * 0.5) + time) + noise((input.posWS.xz * 1) + time)) * 0.25 - 0.5) + 1;
|
||||
|
||||
// Detail UVs
|
||||
input.uv.zw = input.posWS.xz * 0.1h + time * 0.05h + (input.fogFactorNoise.y * 0.1);
|
||||
input.uv.xy = input.posWS.xz * 0.4h - time.xx * 0.1h + (input.fogFactorNoise.y * 0.2);
|
||||
|
||||
half4 screenUV = ComputeScreenPos(TransformWorldToHClip(input.posWS));
|
||||
screenUV.xyz /= screenUV.w;
|
||||
|
||||
// shallows mask
|
||||
half waterDepth = WaterTextureDepth(input.posWS);
|
||||
input.posWS.y += pow(saturate((-waterDepth + 1.5) * 0.4), 2);
|
||||
|
||||
//Gerstner here
|
||||
WaveStruct wave;
|
||||
SampleWaves(input.posWS, saturate((waterDepth * 0.1 + 0.05)), wave);
|
||||
input.normal = wave.normal;
|
||||
input.posWS += wave.position;
|
||||
|
||||
#ifdef SHADER_API_PS4
|
||||
input.posWS.y -= 0.5;
|
||||
#endif
|
||||
|
||||
// Dynamic displacement
|
||||
half4 waterFX = SAMPLE_TEXTURE2D_LOD(_WaterFXMap, sampler_ScreenTextures_linear_clamp, screenUV.xy, 0);
|
||||
input.posWS.y += waterFX.w * 2 - 1;
|
||||
|
||||
// After waves
|
||||
input.clipPos = TransformWorldToHClip(input.posWS);
|
||||
input.shadowCoord = ComputeScreenPos(input.clipPos);
|
||||
input.viewDir = SafeNormalize(_WorldSpaceCameraPos - input.posWS);
|
||||
|
||||
// Fog
|
||||
input.fogFactorNoise.x = ComputeFogFactor(input.clipPos.z);
|
||||
input.preWaveSP = screenUV.xyz; // pre-displaced screenUVs
|
||||
|
||||
// Additional data
|
||||
input.additionalData = AdditionalData(input.posWS, wave);
|
||||
|
||||
// distance blend
|
||||
half distanceBlend = saturate(abs(length((_WorldSpaceCameraPos.xz - input.posWS.xz) * 0.005)) - 0.25);
|
||||
input.normal = lerp(input.normal, half3(0, 1, 0), distanceBlend);
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Vertex and Fragment functions //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Vertex: Used for Standard non-tessellated water
|
||||
WaterVertexOutput WaterVertex(WaterVertexInput v)
|
||||
{
|
||||
WaterVertexOutput o;// = (WaterVertexOutput)0;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
|
||||
o.uv.xy = v.texcoord; // geo uvs
|
||||
o.posWS = TransformObjectToWorld(v.vertex.xyz);
|
||||
|
||||
o = WaveVertexOperations(o);
|
||||
return o;
|
||||
}
|
||||
|
||||
// Fragment for water
|
||||
half4 WaterFragment(WaterVertexOutput IN) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_INSTANCE_ID(IN);
|
||||
half3 screenUV = IN.shadowCoord.xyz / IN.shadowCoord.w;//screen UVs
|
||||
|
||||
half4 waterFX = SAMPLE_TEXTURE2D(_WaterFXMap, sampler_ScreenTextures_linear_clamp, IN.preWaveSP.xy);
|
||||
|
||||
// Depth
|
||||
float3 depth = WaterDepth(IN.posWS, IN.additionalData, screenUV.xy);// TODO - hardcoded shore depth UVs
|
||||
//return half4(0, frac(ceil(depth.y) / _MaxDepth), frac(IN.posWS.y), 1);
|
||||
half depthMulti = 1 / _MaxDepth;
|
||||
|
||||
// Detail waves
|
||||
half2 detailBump1 = SAMPLE_TEXTURE2D(_SurfaceMap, sampler_SurfaceMap, IN.uv.zw).xy * 2 - 1;
|
||||
half2 detailBump2 = SAMPLE_TEXTURE2D(_SurfaceMap, sampler_SurfaceMap, IN.uv.xy).xy * 2 - 1;
|
||||
half2 detailBump = (detailBump1 + detailBump2 * 0.5) * saturate(depth.x * 0.25 + 0.25);
|
||||
|
||||
IN.normal += half3(detailBump.x, 0, detailBump.y) * _BumpScale;
|
||||
IN.normal += half3(1-waterFX.y, 0.5h, 1-waterFX.z) - 0.5;
|
||||
IN.normal = normalize(IN.normal);
|
||||
|
||||
// Distortion
|
||||
half2 distortion = DistortionUVs(depth.x, IN.normal);
|
||||
distortion = screenUV.xy + distortion;// * clamp(depth.x, 0, 5);
|
||||
float d = depth.x;
|
||||
depth.xz = AdjustedDepth(distortion, IN.additionalData);
|
||||
distortion = depth.x < 0 ? screenUV.xy : distortion;
|
||||
depth.x = depth.x < 0 ? d : depth.x;
|
||||
|
||||
// Fresnel
|
||||
half fresnelTerm = CalculateFresnelTerm(IN.normal, IN.viewDir.xyz);
|
||||
//return fresnelTerm.xxxx;
|
||||
|
||||
// Lighting
|
||||
Light mainLight = GetMainLight(TransformWorldToShadowCoord(IN.posWS));
|
||||
half shadow = SoftShadows(screenUV, IN.posWS, IN.viewDir.xyz, depth.x);
|
||||
half3 GI = SampleSH(IN.normal);
|
||||
|
||||
// SSS
|
||||
half3 directLighting = dot(mainLight.direction, half3(0, 1, 0)) * mainLight.color;
|
||||
directLighting += saturate(pow(dot(IN.viewDir, -mainLight.direction) * IN.additionalData.z, 3)) * 5 * mainLight.color;
|
||||
half3 sss = directLighting * shadow + GI;
|
||||
|
||||
// Foam
|
||||
half3 foamMap = SAMPLE_TEXTURE2D(_FoamMap, sampler_FoamMap, IN.uv.zw).rgb; //r=thick, g=medium, b=light
|
||||
half depthEdge = saturate(depth.x * 20);
|
||||
half waveFoam = saturate(IN.additionalData.z - 0.75 * 0.5); // wave tips
|
||||
half depthAdd = saturate(1 - depth.x * 4) * 0.5;
|
||||
half edgeFoam = saturate((1 - min(depth.x, depth.y) * 0.5 - 0.25) + depthAdd) * depthEdge;
|
||||
half foamBlendMask = max(max(waveFoam, edgeFoam), waterFX.r * 2);
|
||||
half3 foamBlend = SAMPLE_TEXTURE2D(_AbsorptionScatteringRamp, sampler_AbsorptionScatteringRamp, half2(foamBlendMask, 0.66)).rgb;
|
||||
half foamMask = saturate(length(foamMap * foamBlend) * 1.5 - 0.1);
|
||||
// Foam lighting
|
||||
half3 foam = foamMask.xxx * (mainLight.shadowAttenuation * mainLight.color + GI);
|
||||
|
||||
BRDFData brdfData;
|
||||
half alpha = 1;
|
||||
InitializeBRDFData(half3(0, 0, 0), 0, half3(1, 1, 1), 0.95, alpha, brdfData);
|
||||
half3 spec = DirectBDRF(brdfData, IN.normal, mainLight.direction, IN.viewDir) * shadow * mainLight.color;
|
||||
#ifdef _ADDITIONAL_LIGHTS
|
||||
uint pixelLightCount = GetAdditionalLightsCount();
|
||||
for (uint lightIndex = 0u; lightIndex < pixelLightCount; ++lightIndex)
|
||||
{
|
||||
Light light = GetAdditionalLight(lightIndex, IN.posWS);
|
||||
spec += LightingPhysicallyBased(brdfData, light, IN.normal, IN.viewDir);
|
||||
sss += light.distanceAttenuation * light.color;
|
||||
}
|
||||
#endif
|
||||
|
||||
sss *= Scattering(depth.x * depthMulti);
|
||||
|
||||
// Reflections
|
||||
half3 reflection = SampleReflections(IN.normal, IN.viewDir.xyz, screenUV.xy, 0.0);
|
||||
|
||||
// Refraction
|
||||
half3 refraction = Refraction(distortion, depth.x, depthMulti);
|
||||
|
||||
// Do compositing
|
||||
half3 comp = lerp(lerp(refraction, reflection, fresnelTerm) + sss + spec, foam, foamMask); //lerp(refraction, color + reflection + foam, 1-saturate(1-depth.x * 25));
|
||||
|
||||
// Fog
|
||||
float fogFactor = IN.fogFactorNoise.x;
|
||||
comp = MixFog(comp, fogFactor);
|
||||
#if defined(_DEBUG_FOAM)
|
||||
return half4(foamMask.xxx, 1);
|
||||
#elif defined(_DEBUG_SSS)
|
||||
return half4(sss, 1);
|
||||
#elif defined(_DEBUG_REFRACTION)
|
||||
return half4(refraction, 1);
|
||||
#elif defined(_DEBUG_REFLECTION)
|
||||
return half4(reflection, 1);
|
||||
#elif defined(_DEBUG_NORMAL)
|
||||
return half4(IN.normal.x * 0.5 + 0.5, 0, IN.normal.z * 0.5 + 0.5, 1);
|
||||
#elif defined(_DEBUG_FRESNEL)
|
||||
return half4(fresnelTerm.xxx, 1);
|
||||
#elif defined(_DEBUG_WATEREFFECTS)
|
||||
return half4(waterFX);
|
||||
#elif defined(_DEBUG_WATERDEPTH)
|
||||
return half4(frac(depth), 1);
|
||||
#else
|
||||
return half4(comp, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // WATER_COMMON_INCLUDED
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8169b68b201d74e3597abae6c06c4264
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,61 @@
|
||||
Shader "Unlit/WaterFXFoamOnly"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderType"="Transparent" "Queue"="Transparent" "RenderPipeline" = "UniversalPipeline" }
|
||||
ZWrite Off
|
||||
Blend One One
|
||||
LOD 100
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "WaterFX"
|
||||
Tags{"LightMode" = "WaterFX"}
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#define _NORMALMAP 1
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
half4 color : COLOR;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float2 uv : TEXCOORD0;
|
||||
half4 color : TEXCOORD1;
|
||||
float4 vertex : SV_POSITION;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
half3 posWS = TransformObjectToWorld(v.vertex.xyz);
|
||||
o.vertex = TransformWorldToHClip(posWS);
|
||||
o.uv = v.uv;
|
||||
o.color = v.color;
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : SV_Target
|
||||
{
|
||||
half4 col = tex2D(_MainTex, i.uv) * i.color;
|
||||
return half4(col.rgb, 0);
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 11c17326e513c47a6a4da8bc7e511417
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,100 @@
|
||||
Shader "BoatAttack/WaterFXShader"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
// Blend mode values
|
||||
[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend ("Src Blend mode", Float) = 0.0
|
||||
// Blend mode values
|
||||
[Enum(UnityEngine.Rendering.BlendMode)] _DstBlend ("Dst Blend mode", Float) = 0.0
|
||||
// Will set "_INVERT_ON" shader keyword when set
|
||||
[Toggle] _Invert ("Invert?", Float) = 0
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderType"="Transparent" "Queue"="Transparent" "RenderPipeline" = "UniversalPipeline" }
|
||||
ZWrite Off
|
||||
Blend[_SrcBlend][_DstBlend]
|
||||
LOD 100
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "WaterFX"
|
||||
Tags{"LightMode" = "WaterFX"}
|
||||
HLSLPROGRAM
|
||||
#pragma vertex WaterFXVertex
|
||||
#pragma fragment WaterFXFragment
|
||||
#pragma shader_feature _INVERT_ON
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
|
||||
struct Attributes
|
||||
{
|
||||
float3 positionOS : POSITION;
|
||||
float3 normalOS : NORMAL;
|
||||
float4 tangentOS : TANGENT;
|
||||
half4 color : COLOR;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct Varyings
|
||||
{
|
||||
float2 uv : TEXCOORD0;
|
||||
half4 normal : TEXCOORD1; // xyz: normal, w: viewDir.x
|
||||
half4 tangent : TEXCOORD2; // xyz: tangent, w: viewDir.y
|
||||
half4 bitangent : TEXCOORD3; // xyz: binormal, w: viewDir.z
|
||||
half4 color : TEXCOORD4;
|
||||
float4 vertex : SV_POSITION;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
|
||||
Varyings WaterFXVertex (Attributes input)
|
||||
{
|
||||
Varyings output = (Varyings)0;
|
||||
|
||||
VertexPositionInputs vertexPosition = GetVertexPositionInputs(input.positionOS.xyz);
|
||||
VertexNormalInputs vertexTBN = GetVertexNormalInputs(input.normalOS, input.tangentOS);
|
||||
|
||||
output.vertex = vertexPosition.positionCS;
|
||||
|
||||
output.uv = input.uv;
|
||||
|
||||
output.color = input.color;
|
||||
|
||||
half3 viewDir = GetCameraPositionWS() - vertexPosition.positionWS;
|
||||
|
||||
output.normal = half4(vertexTBN.normalWS, viewDir.x);
|
||||
output.tangent = half4(vertexTBN.tangentWS, viewDir.y);
|
||||
output.bitangent = half4(vertexTBN.bitangentWS, viewDir.z);
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
half4 WaterFXFragment (Varyings input) : SV_Target
|
||||
{
|
||||
half4 col = tex2D(_MainTex, input.uv);
|
||||
|
||||
half foamMask = col.r * input.color.r;
|
||||
half disp = col.a * 2 - 1;
|
||||
|
||||
disp *= input.color.a;
|
||||
|
||||
half3 tNorm = half3(col.b, col.g, 1) * 2 - 1;
|
||||
|
||||
half3 viewDir = half3(input.normal.w, input.tangent.w, input.bitangent.w);
|
||||
half3 normalWS = TransformTangentToWorld(tNorm, half3x3(input.tangent.xyz, input.bitangent.xyz, input.normal.xyz));
|
||||
|
||||
normalWS = lerp(half3(0, 1, 0), normalWS, input.color.g);
|
||||
half4 comp = half4(foamMask, normalWS.xz, disp);
|
||||
|
||||
#ifdef _INVERT_ON
|
||||
comp *= -1;
|
||||
#endif
|
||||
|
||||
return comp;
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e7be97cb17d9940f7b6a757181b86170
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,44 @@
|
||||
#ifndef WATER_INPUT_INCLUDED
|
||||
#define WATER_INPUT_INCLUDED
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
half _BumpScale;
|
||||
half4 _DitherPattern_TexelSize;
|
||||
CBUFFER_END
|
||||
half _MaxDepth;
|
||||
half _MaxWaveHeight;
|
||||
int _DebugPass;
|
||||
half4 _VeraslWater_DepthCamParams;
|
||||
float4x4 _InvViewProjection;
|
||||
|
||||
// Screen Effects textures
|
||||
SAMPLER(sampler_ScreenTextures_linear_clamp);
|
||||
#if defined(_REFLECTION_PLANARREFLECTION)
|
||||
TEXTURE2D(_PlanarReflectionTexture);
|
||||
#elif defined(_REFLECTION_CUBEMAP)
|
||||
TEXTURECUBE(_CubemapTexture);
|
||||
SAMPLER(sampler_CubemapTexture);
|
||||
#endif
|
||||
TEXTURE2D(_WaterFXMap);
|
||||
TEXTURE2D(_CameraDepthTexture);
|
||||
TEXTURE2D(_CameraOpaqueTexture); SAMPLER(sampler_CameraOpaqueTexture_linear_clamp);
|
||||
|
||||
TEXTURE2D(_WaterDepthMap); SAMPLER(sampler_WaterDepthMap_linear_clamp);
|
||||
|
||||
// Surface textures
|
||||
TEXTURE2D(_AbsorptionScatteringRamp); SAMPLER(sampler_AbsorptionScatteringRamp);
|
||||
TEXTURE2D(_SurfaceMap); SAMPLER(sampler_SurfaceMap);
|
||||
TEXTURE2D(_FoamMap); SAMPLER(sampler_FoamMap);
|
||||
TEXTURE2D(_DitherPattern); SAMPLER(sampler_DitherPattern);
|
||||
|
||||
struct WaterSurfaceData
|
||||
{
|
||||
half3 absorption;
|
||||
half3 scattering;
|
||||
half3 normal;
|
||||
half foam;
|
||||
};
|
||||
|
||||
#endif // WATER_INPUT_INCLUDED
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b63d1585d6c8e4834994e9494b1ac4fc
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,109 @@
|
||||
#ifndef WATER_LIGHTING_INCLUDED
|
||||
#define WATER_LIGHTING_INCLUDED
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
||||
|
||||
#define SHADOW_ITERATIONS 4
|
||||
|
||||
half CalculateFresnelTerm(half3 normalWS, half3 viewDirectionWS)
|
||||
{
|
||||
return saturate(pow(1.0 - dot(normalWS, viewDirectionWS), 5));//fresnel TODO - find a better place
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Lighting Calculations //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//diffuse
|
||||
half4 VertexLightingAndFog(half3 normalWS, half3 posWS, half3 clipPos)
|
||||
{
|
||||
half3 vertexLight = VertexLighting(posWS, normalWS);
|
||||
half fogFactor = ComputeFogFactor(clipPos.z);
|
||||
return half4(fogFactor, vertexLight);
|
||||
}
|
||||
|
||||
//specular
|
||||
half3 Highlights(half3 positionWS, half roughness, half3 normalWS, half3 viewDirectionWS)
|
||||
{
|
||||
Light mainLight = GetMainLight();
|
||||
|
||||
half roughness2 = roughness * roughness;
|
||||
half3 halfDir = SafeNormalize(mainLight.direction + viewDirectionWS);
|
||||
half NoH = saturate(dot(normalize(normalWS), halfDir));
|
||||
half LoH = saturate(dot(mainLight.direction, halfDir));
|
||||
// GGX Distribution multiplied by combined approximation of Visibility and Fresnel
|
||||
// See "Optimizing PBR for Mobile" from Siggraph 2015 moving mobile graphics course
|
||||
// https://community.arm.com/events/1155
|
||||
half d = NoH * NoH * (roughness2 - 1.h) + 1.0001h;
|
||||
half LoH2 = LoH * LoH;
|
||||
half specularTerm = roughness2 / ((d * d) * max(0.1h, LoH2) * (roughness + 0.5h) * 4);
|
||||
// on mobiles (where half actually means something) denominator have risk of overflow
|
||||
// clamp below was added specifically to "fix" that, but dx compiler (we convert bytecode to metal/gles)
|
||||
// sees that specularTerm have only non-negative terms, so it skips max(0,..) in clamp (leaving only min(100,...))
|
||||
#if defined (SHADER_API_MOBILE)
|
||||
specularTerm = specularTerm - HALF_MIN;
|
||||
specularTerm = clamp(specularTerm, 0.0, 5.0); // Prevent FP16 overflow on mobiles
|
||||
#endif
|
||||
return specularTerm * mainLight.color * mainLight.distanceAttenuation;
|
||||
}
|
||||
|
||||
//Soft Shadows
|
||||
half SoftShadows(float3 screenUV, float3 positionWS, half3 viewDir, half depth)
|
||||
{
|
||||
#if _MAIN_LIGHT_SHADOWS
|
||||
half2 jitterUV = screenUV.xy * _ScreenParams.xy * _DitherPattern_TexelSize.xy;
|
||||
half shadowAttenuation = 0;
|
||||
|
||||
float loopDiv = 1.0 / SHADOW_ITERATIONS;
|
||||
half depthFrac = depth * loopDiv;
|
||||
half3 lightOffset = -viewDir * depthFrac;
|
||||
for (uint i = 0u; i < SHADOW_ITERATIONS; ++i)
|
||||
{
|
||||
#ifndef _STATIC_SHADER
|
||||
jitterUV += frac(half2(_Time.x, -_Time.z));
|
||||
#endif
|
||||
float3 jitterTexture = SAMPLE_TEXTURE2D(_DitherPattern, sampler_DitherPattern, jitterUV + i * _ScreenParams.xy).xyz * 2 - 1;
|
||||
half3 j = jitterTexture.xzy * depthFrac * i * 0.1;
|
||||
float3 lightJitter = (positionWS + j) + (lightOffset * (i + jitterTexture.y));
|
||||
shadowAttenuation += SAMPLE_TEXTURE2D_SHADOW(_MainLightShadowmapTexture, sampler_MainLightShadowmapTexture, TransformWorldToShadowCoord(lightJitter));
|
||||
}
|
||||
return BEYOND_SHADOW_FAR(TransformWorldToShadowCoord(positionWS * 1.1)) ? 1.0 : shadowAttenuation * loopDiv;
|
||||
#else
|
||||
return 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Reflection Modes //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
half3 SampleReflections(half3 normalWS, half3 viewDirectionWS, half2 screenUV, half roughness)
|
||||
{
|
||||
half3 reflection = 0;
|
||||
half2 refOffset = 0;
|
||||
|
||||
#if _REFLECTION_CUBEMAP
|
||||
half3 reflectVector = reflect(-viewDirectionWS, normalWS);
|
||||
reflection = SAMPLE_TEXTURECUBE(_CubemapTexture, sampler_CubemapTexture, reflectVector).rgb;
|
||||
#elif _REFLECTION_PROBES
|
||||
half3 reflectVector = reflect(-viewDirectionWS, normalWS);
|
||||
reflection = GlossyEnvironmentReflection(reflectVector, 0, 1);
|
||||
#elif _REFLECTION_PLANARREFLECTION
|
||||
|
||||
// get the perspective projection
|
||||
float2 p11_22 = float2(unity_CameraInvProjection._11, unity_CameraInvProjection._22) * 10;
|
||||
// conver the uvs into view space by "undoing" projection
|
||||
float3 viewDir = -(float3((screenUV * 2 - 1) / p11_22, -1));
|
||||
|
||||
half3 viewNormal = mul(normalWS, (float3x3)GetWorldToViewMatrix()).xyz;
|
||||
half3 reflectVector = reflect(-viewDir, viewNormal);
|
||||
|
||||
half2 reflectionUV = screenUV + normalWS.zx * half2(0.02, 0.15);
|
||||
reflection += SAMPLE_TEXTURE2D_LOD(_PlanarReflectionTexture, sampler_ScreenTextures_linear_clamp, reflectionUV, 6 * roughness).rgb;//planar reflection
|
||||
#endif
|
||||
//do backup
|
||||
//return reflectVector.yyy;
|
||||
return reflection;
|
||||
}
|
||||
|
||||
#endif // WATER_LIGHTING_INCLUDED
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f1b7d55b20a1440b38c82e0092d37161
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,51 @@
|
||||
Shader "BoatAttack/WaterTessellated"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_TessellationEdgeLength ("Tessellation Edge Length", Range(5, 100)) = 50
|
||||
_BumpScale("Detail Wave Amount", Range(0, 1)) = 0.2//fine detail multiplier
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderType"="Transparent" "Queue"="Transparent-100" "RenderPipeline" = "LightweightPipeline" }
|
||||
LOD 300
|
||||
ZWrite Off
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "WaterShading"
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma require tessellation tessHW
|
||||
#pragma prefer_hlslcc gles
|
||||
/////////////////SHADER FEATURES//////////////////
|
||||
#pragma shader_feature _ _TESSELLATION
|
||||
#define _TESSELLATION 1
|
||||
|
||||
#pragma multi_compile _REFLECTION_CUBEMAP _REFLECTION_PROBES _REFLECTION_PLANARREFLECTION
|
||||
#pragma multi_compile _ USE_STRUCTURED_BUFFER
|
||||
|
||||
// -------------------------------------
|
||||
// Lightweight Pipeline keywords
|
||||
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS
|
||||
#pragma multi_compile _ _SHADOWS_SOFT
|
||||
|
||||
//--------------------------------------
|
||||
// GPU Instancing
|
||||
#pragma multi_compile_instancing
|
||||
#pragma multi_compile_fog
|
||||
|
||||
////////////////////INCLUDES//////////////////////
|
||||
#include "WaterCommon.hlsl"
|
||||
#include "WaterTessellation.hlsl"
|
||||
|
||||
#pragma vertex TessellationVertex
|
||||
#pragma hull Hull
|
||||
#pragma domain Domain
|
||||
#pragma fragment WaterFragment
|
||||
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
fallback "BoatAttack/Water"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d4deeba0d8a64503964c2f653931109
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,98 @@
|
||||
#ifndef WATER_TESSELLATION_INCLUDED
|
||||
#define WATER_TESSELLATION_INCLUDED
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Structs //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
struct TessellationControlPoint
|
||||
{
|
||||
float4 vertex : INTERNALTESSPOS;
|
||||
float4 texcoord : TEXCOORD0; // Geometric UVs stored in xy, and world(pre-waves) in zw
|
||||
float3 posWS : TEXCOORD1; // world position of the vertices
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct HS_ConstantOutput
|
||||
{
|
||||
float TessFactor[3] : SV_TessFactor;
|
||||
float InsideTessFactor : SV_InsideTessFactor;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Tessellation functions //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
half _TessellationEdgeLength;
|
||||
|
||||
float TessellationEdgeFactor (float3 p0, float3 p1)
|
||||
{
|
||||
float edgeLength = distance(p0, p1);
|
||||
|
||||
float3 edgeCenter = (p0 + p1) * 0.5;
|
||||
float viewDistance = distance(edgeCenter, _WorldSpaceCameraPos);
|
||||
|
||||
return edgeLength * _ScreenParams.y / (_TessellationEdgeLength * viewDistance);
|
||||
}
|
||||
|
||||
TessellationControlPoint TessellationVertex( WaterVertexInput v )
|
||||
{
|
||||
TessellationControlPoint o;
|
||||
o.vertex = v.vertex;
|
||||
o.posWS = TransformObjectToWorld(v.vertex.xyz);
|
||||
o.texcoord.xy = v.texcoord;
|
||||
o.texcoord.zw = o.posWS.xz;
|
||||
//o.color = v.color;
|
||||
return o;
|
||||
}
|
||||
|
||||
HS_ConstantOutput HSConstant( InputPatch<TessellationControlPoint, 3> Input )
|
||||
{
|
||||
float3 p0 = TransformObjectToWorld(Input[0].vertex.xyz);
|
||||
float3 p1 = TransformObjectToWorld(Input[1].vertex.xyz);
|
||||
float3 p2 = TransformObjectToWorld(Input[2].vertex.xyz);
|
||||
HS_ConstantOutput o = (HS_ConstantOutput)0;
|
||||
o.TessFactor[0] = TessellationEdgeFactor(p1, p2);
|
||||
o.TessFactor[1] = TessellationEdgeFactor(p2, p0);
|
||||
o.TessFactor[2] = TessellationEdgeFactor(p0, p1);
|
||||
o.InsideTessFactor = (TessellationEdgeFactor(p1, p2) +
|
||||
TessellationEdgeFactor(p2, p0) +
|
||||
TessellationEdgeFactor(p0, p1)) * (1 / 3.0);
|
||||
return o;
|
||||
}
|
||||
|
||||
[domain("tri")]
|
||||
[partitioning("fractional_odd")]
|
||||
[outputtopology("triangle_cw")]
|
||||
[patchconstantfunc("HSConstant")]
|
||||
[outputcontrolpoints(3)]
|
||||
TessellationControlPoint Hull( InputPatch<TessellationControlPoint, 3> Input, uint uCPID : SV_OutputControlPointID )
|
||||
{
|
||||
return Input[uCPID];
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Domain: replaces vert for tessellation version
|
||||
[domain("tri")]
|
||||
WaterVertexOutput Domain( HS_ConstantOutput HSConstantData, const OutputPatch<TessellationControlPoint, 3> Input, float3 BarycentricCoords : SV_DomainLocation)
|
||||
{
|
||||
WaterVertexOutput o = (WaterVertexOutput)0;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
/////////////////////Tessellation////////////////////////
|
||||
float fU = BarycentricCoords.x;
|
||||
float fV = BarycentricCoords.y;
|
||||
float fW = BarycentricCoords.z;
|
||||
|
||||
float4 vertex = Input[0].vertex * fU + Input[1].vertex * fV + Input[2].vertex * fW;
|
||||
o.uv = Input[0].texcoord * fU + Input[1].texcoord * fV + Input[2].texcoord * fW;
|
||||
o.posWS = Input[0].posWS * fU + Input[1].posWS * fV + Input[2].posWS * fW;
|
||||
|
||||
o = WaveVertexOperations(o);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
#endif // WATER_TESSELLATION_INCLUDED
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b43b1830f56c64692b92d59d34a90038
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user