Custom encoding/decoding.

Custom vector3 encoding/decoding test.
removed normal decoding from VA functions, this should now be done outside this function to allow easy switching of decoders.

Co-Authored-By: Neeto-rzo <68438932+Neeto-rzo@users.noreply.github.com>
This commit is contained in:
max 2020-12-08 00:33:06 +01:00
parent b63ee2ff02
commit f2b6a61d1e
17 changed files with 1039 additions and 342 deletions

View File

@ -6,70 +6,75 @@ using UnityEngine;
namespace TAO.VertexAnimation
{
//TODO: SetComponent.
//TODO: Disable thread safety.
//TODO: Blob data for static animation data.
//public class VA_AnimatorSystem : SystemBase
//{
// private EndSimulationEntityCommandBufferSystem endSimulationEntityCommandBufferSystem;
// protected override void OnCreate()
// {
// base.OnCreate();
// endSimulationEntityCommandBufferSystem = World.GetExistingSystem<EndSimulationEntityCommandBufferSystem>();
// }
// protected override void OnUpdate()
// {
// var ecb = endSimulationEntityCommandBufferSystem.CreateCommandBuffer().AsParallelWriter();
// Entities.ForEach((Entity entity, int entityInQueryIndex, in VA_AnimatorComponent ac, in DynamicBuffer<Child> children) =>
// {
// for (int i = 0; i < children.Length; i++)
// {
// // Get child.
// Entity child = children[i].Value;
// // Overwrite existing component.
// ecb.AddComponent(entityInQueryIndex, child, new VA_AnimationTimeComponent { Value = ac.animationTime });
// ecb.AddComponent(entityInQueryIndex, child, new VA_AnimationIndexComponent { Value = ac.animationIndex });
// }
// })
// .ScheduleParallel();
// endSimulationEntityCommandBufferSystem.AddJobHandleForProducer(Dependency);
// }
// private EndSimulationEntityCommandBufferSystem endSimulationEntityCommandBufferSystem;
// protected override void OnCreate()
// {
// base.OnCreate();
// endSimulationEntityCommandBufferSystem = World.GetExistingSystem<EndSimulationEntityCommandBufferSystem>();
// }
// protected override void OnUpdate()
// {
// var ecb = endSimulationEntityCommandBufferSystem.CreateCommandBuffer().AsParallelWriter();
// Entities.ForEach((Entity entity, int entityInQueryIndex, in VA_AnimatorComponent ac, in DynamicBuffer<Child> children) =>
// {
// for (int i = 0; i < children.Length; i++)
// {
// // Get child.
// Entity child = children[i].Value;
// // Overwrite existing component.
// ecb.AddComponent(entityInQueryIndex, child, new VA_AnimationTimeComponent { Value = ac.animationTime });
// ecb.AddComponent(entityInQueryIndex, child, new VA_AnimationIndexComponent { Value = ac.animationIndex });
// }
// })
// .ScheduleParallel();
// endSimulationEntityCommandBufferSystem.AddJobHandleForProducer(Dependency);
// }
//}
//[UpdateBefore(typeof(HybridRendererSystem))]
public class VA_AnimatorSystem : SystemBase
{
protected override void OnUpdate()
{
var atc = GetComponentDataFromEntity<VA_AnimationTimeComponent>(false);
var aic = GetComponentDataFromEntity<VA_AnimationIndexComponent>(false);
var aic = GetComponentDataFromEntity<VA_AnimationIndexComponent>(false);
Entities.ForEach((ref VA_AnimatorComponent ac, in DynamicBuffer<Child> children) =>
{
for (int i = 0; i < children.Length; i++)
{
// Get child.
Entity child = children[i].Value;
// Get a copy of the time Component of the child.
VA_AnimationTimeComponent atcCopy = atc[child];
// Set new value.
atcCopy.Value = ac.animationTime;
// Update original.
atc[child] = atcCopy;
VA_AnimationIndexComponent aicCopy = aic[child];
aicCopy.Value = ac.animationIndex;
aic[child] = aicCopy;
}
})
.Run();
}
{
for (int i = 0; i < children.Length; i++)
{
// Get child.
Entity child = children[i].Value;
// Get a copy of the time Component of the child.
VA_AnimationTimeComponent atcCopy = atc[child];
// Set new value.
atcCopy.Value = ac.animationTime;
// Update original.
atc[child] = atcCopy;
VA_AnimationIndexComponent aicCopy = aic[child];
aicCopy.Value = ac.animationIndex;
aic[child] = aicCopy;
}
})
.Run();
}
}
public class VA_AnimatorSystem2 : SystemBase
{
protected override void OnCreate()
@ -128,8 +133,9 @@ namespace TAO.VertexAnimation
{
Entities.ForEach((Entity entity, ref VA_AnimatorComponent ac) =>
{
int index = entity.Index % 2;
ac.animationIndex = index;
//int index = entity.Index % 2;
//ac.animationIndex = index;
ac.animationIndex = 0;
}).ScheduleParallel();
}
}

View File

@ -2,16 +2,27 @@
#ifndef VECTOR_ENCODING_DECODING_INCLUDED
#define VECTOR_ENCODING_DECODING_INCLUDED
// Ref: SideFX.
void DecodeFloat1ToFloat3_float(float f1, out float3 f3)
#define V_PI 3.14159265359f
#define V_TWO_PI 6.28318530718f
#define V_HALF_PI 1.57079632679f
void EncodeFloat3ToFloat1_float(float3 f3, out float f1)
{
float z = sqrt(f3.z * 8 + 8);
float y = (f3.y / z + 0.5f) * 31;
float x = floor((f3.x / z + 0.5f) * 31) * 32;
f1 = (x + y) / 1023;
}
void DecodeFloat1ToFloat2_float(float f1, out float2 f2)
{
//decode float to float2
f1 *= 1024;
float2 f2;
f2.x = floor(f1 / 32.0) / 31.5;
f2.y = (f1 - (floor(f1 / 32.0) * 32.0)) / 31.5;
}
//decode float2 to float3
void DecodeFloat2ToFloat3_float(float f2, out float3 f3)
{
f2 *= 4;
f2 -= 2;
float f2dot = dot(f2, f2);
@ -20,73 +31,11 @@ void DecodeFloat1ToFloat3_float(float f1, out float3 f3)
f3 = clamp(f3, -1.0, 1.0);
}
void EncodeFloat3ToFloat1_float(float3 f3, out float f1)
void DecodeFloat1ToFloat3_float(float f1, out float3 f3)
{
float z = sqrt(f3.z * 8 + 8);
float y = (f3.y / z + 0.5f) * 31;
float x = floor((f3.x / z + 0.5f) * 31) * 32;
float o = (x + y) / 1023;
f1 = o;
//float fval1 = f3.x;
//float fval2 = f3.y;
//float fval3 = f3.z;
//float scaled0;
//float added0;
//float sqrt0;
//float div0;
//float added1;
//float scaled1;
//float floor0;
//float scaled2;
//float div1;
//float added2;
//float scaled3;
//float sum0;
//float scaled4;
//// Code produced by: mulconst1
//scaled0 = fval3 * 8;
//// Code produced by: addconst1
//added0 = scaled0 + 8;
//// Code produced by: sqrt1
//sqrt0 = sqrt(added0);
//// Code produced by: divide1
//div0 = fval1 / sqrt0;
//// Code produced by: addconst2
//added1 = div0 + 0.5;
//// Code produced by: mulconst2
//scaled1 = added1 * 31;
//// Code produced by: floor1
//floor0 = floor(scaled1);
//// Code produced by: mulconst3
//scaled2 = floor0 * 32;
//// Code produced by: divide2
//div1 = fval2 / sqrt0;
//// Code produced by: addconst3
//added2 = div1 + 0.5;
//// Code produced by: mulconst4
//scaled3 = added2 * 31;
//// Code produced by: add1
//sum0 = scaled2 + scaled3;
//// Code produced by: divconst1
//scaled4 = sum0 * (1.0 / 1023);
//f1 = scaled4;
float2 f2;
DecodeFloat1ToFloat2_float(f1, f2);
DecodeFloat2ToFloat3_float(f2, f3);
}
// Ref:
@ -102,4 +51,35 @@ void Decode2Float1ToFloat3_float(float f1, out float3 f3)
f3 = (frac((f1) / float3(16777216, 65536, 256)));
}
// Custom
// Decode 0..1 float.
void FloatToFloat2_float(float f1, out float2 f2)
{
f1 *= 256;
f2.x = (f1 % 16) / 15;
f2.y = ((f1 / 256) * 16);
f2.y = floor(f2.y) / 15;
}
void Float2ToFloat3_float(float2 f2, out float3 f3)
{
float dist = 1 - abs((f2.y - 0.5f) * 2);
float temp = (f2.x * V_TWO_PI) - V_PI;
f3.x = sin(temp + V_TWO_PI) * dist;
f3.z = cos((temp - V_PI) + V_TWO_PI) * dist;
f3.y = (f2.y - 0.5f) * -2;
f3 = normalize(f3);
}
void FloatToFloat3_float(float f1, out float3 f3)
{
float2 f2;
FloatToFloat2_float(f1, f2);
Float2ToFloat3_float(f2, f3);
}
#endif

View File

@ -21,30 +21,32 @@ float2 VA_UV_float(float2 uv, int maxFrames, float time)
}
void VA_float(float2 uv, SamplerState texSampler, Texture2D positionMap, float time, int maxFrames,
out float3 outPosition, out float3 outNormal)
out float3 position, out float3 alpha)
{
float2 uvPosition = VA_UV_float(uv, maxFrames, time);
// Position.
float4 texturePos = positionMap.SampleLevel(texSampler, uvPosition, 0);
outPosition = texturePos.xyz;
position = texturePos.xyz;
// Normal.
DecodeFloat1ToFloat3_float(texturePos.w, outNormal);
//FloatToFloat3_float(texturePos.w, outNormal);
alpha = texturePos.w;
}
void VA_ARRAY_float(float2 uv, SamplerState texSampler, Texture2DArray positionMap, float positionMapIndex, float time, int maxFrames,
out float3 outPosition, out float3 outNormal)
out float3 position, out float3 alpha)
{
float2 uvPosition = VA_UV_float(uv, maxFrames, time);
// Position.
float4 texturePos;
SampleTexture2DArrayLOD_float(positionMap, uvPosition, texSampler, positionMapIndex, 0, texturePos);
outPosition = texturePos.xyz;
position = texturePos.xyz;
// Normal.
DecodeFloat1ToFloat3_float(texturePos.w, outNormal);
//FloatToFloat3_float(texturePos.w, outNormal);
alpha = texturePos.w;
}
#endif

View File

@ -196,7 +196,7 @@
"m_Id": "b89a68670a6642e19ae1063415132848"
},
{
"m_Id": "07aa60cb707f4623a11536d9507405db"
"m_Id": "68e1750097114f2d9801fda29c1a4a1a"
}
],
"m_Precision": 0,
@ -207,34 +207,6 @@
"IsFirstSlotValid": true
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "07aa60cb707f4623a11536d9507405db",
"m_Id": 2,
"m_DisplayName": "Normal",
"m_SlotType": 0,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "Normal",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [
"X",
"Y",
"Z"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
@ -400,6 +372,34 @@
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "68e1750097114f2d9801fda29c1a4a1a",
"m_Id": 2,
"m_DisplayName": "Alpha",
"m_SlotType": 0,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "Alpha",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [
"X",
"Y",
"Z"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot",
@ -425,34 +425,6 @@
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "7e4dcba5ce514132a507e6bccc9e3871",
"m_Id": 10,
"m_DisplayName": "outNormal",
"m_SlotType": 1,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "outNormal",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [
"X",
"Y",
"Z"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode",
@ -472,12 +444,6 @@
}
},
"m_Slots": [
{
"m_Id": "94dc07ad41a445cd8a24fbb7e2ff81aa"
},
{
"m_Id": "7e4dcba5ce514132a507e6bccc9e3871"
},
{
"m_Id": "7dbe167981d2452a8248b6d23432a518"
},
@ -492,6 +458,12 @@
},
{
"m_Id": "ee509cecfe5046ebb88dc4c3ae5e2fed"
},
{
"m_Id": "f08b7a93deeb46548e0a57309906d22a"
},
{
"m_Id": "f3afc10b499a42c4bbcd332b713c9635"
}
],
"m_Precision": 0,
@ -530,34 +502,6 @@
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "94dc07ad41a445cd8a24fbb7e2ff81aa",
"m_Id": 9,
"m_DisplayName": "outPosition",
"m_SlotType": 1,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "outPosition",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [
"X",
"Y",
"Z"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
@ -755,6 +699,34 @@
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "f08b7a93deeb46548e0a57309906d22a",
"m_Id": 9,
"m_DisplayName": "position",
"m_SlotType": 1,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "position",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [
"X",
"Y",
"Z"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
@ -788,6 +760,34 @@
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "f3afc10b499a42c4bbcd332b713c9635",
"m_Id": 10,
"m_DisplayName": "alpha",
"m_SlotType": 1,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "alpha",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [
"X",
"Y",
"Z"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",

View File

@ -216,7 +216,7 @@
"m_Id": "b89a68670a6642e19ae1063415132848"
},
{
"m_Id": "07aa60cb707f4623a11536d9507405db"
"m_Id": "7106fc4a9e6e4a0a8bdd678ceb7f4f1c"
}
],
"m_Precision": 0,
@ -227,34 +227,6 @@
"IsFirstSlotValid": true
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "07aa60cb707f4623a11536d9507405db",
"m_Id": 2,
"m_DisplayName": "Normal",
"m_SlotType": 0,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "Normal",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [
"X",
"Y",
"Z"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
@ -383,6 +355,34 @@
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "7106fc4a9e6e4a0a8bdd678ceb7f4f1c",
"m_Id": 2,
"m_DisplayName": "Alpha",
"m_SlotType": 0,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "Alpha",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [
"X",
"Y",
"Z"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot",
@ -408,34 +408,6 @@
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "7e4dcba5ce514132a507e6bccc9e3871",
"m_Id": 10,
"m_DisplayName": "outNormal",
"m_SlotType": 1,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "outNormal",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [
"X",
"Y",
"Z"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode",
@ -455,12 +427,6 @@
}
},
"m_Slots": [
{
"m_Id": "94dc07ad41a445cd8a24fbb7e2ff81aa"
},
{
"m_Id": "7e4dcba5ce514132a507e6bccc9e3871"
},
{
"m_Id": "7dbe167981d2452a8248b6d23432a518"
},
@ -478,6 +444,12 @@
},
{
"m_Id": "ee509cecfe5046ebb88dc4c3ae5e2fed"
},
{
"m_Id": "c2b10d98649f477bb79b359db258f55a"
},
{
"m_Id": "c1454b74eac5469eb14d403b66a8283a"
}
],
"m_Precision": 0,
@ -516,34 +488,6 @@
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "94dc07ad41a445cd8a24fbb7e2ff81aa",
"m_Id": 9,
"m_DisplayName": "outPosition",
"m_SlotType": 1,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "outPosition",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [
"X",
"Y",
"Z"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
@ -722,6 +666,34 @@
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "c1454b74eac5469eb14d403b66a8283a",
"m_Id": 10,
"m_DisplayName": "alpha",
"m_SlotType": 1,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "alpha",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [
"X",
"Y",
"Z"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
@ -740,6 +712,34 @@
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "c2b10d98649f477bb79b359db258f55a",
"m_Id": 9,
"m_DisplayName": "position",
"m_SlotType": 1,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "position",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [
"X",
"Y",
"Z"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DArrayShaderProperty",

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bb6abbe05e546a64090044126e75d123
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,500 @@
{
"m_SGVersion": 2,
"m_Type": "UnityEditor.ShaderGraph.GraphData",
"m_ObjectId": "a0a2fdc9c1a4498195631e1da43ae9d8",
"m_Properties": [
{
"m_Id": "771ac3b08a1144b086078a0d07c220da"
}
],
"m_Keywords": [],
"m_Nodes": [
{
"m_Id": "966c13a2f0a94a189243c9f0d9524146"
},
{
"m_Id": "b1d371a1c68245c59eaee45d4d61c533"
},
{
"m_Id": "95caa98ec1fe4b12be341a504a26521c"
},
{
"m_Id": "263e3f691adc4e89ae69574634db2de6"
},
{
"m_Id": "5c342c9c5ab943a6ab1d9499425f19e0"
}
],
"m_GroupDatas": [],
"m_StickyNoteDatas": [],
"m_Edges": [
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "263e3f691adc4e89ae69574634db2de6"
},
"m_SlotId": 1
},
"m_InputSlot": {
"m_Node": {
"m_Id": "5c342c9c5ab943a6ab1d9499425f19e0"
},
"m_SlotId": 0
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "5c342c9c5ab943a6ab1d9499425f19e0"
},
"m_SlotId": 1
},
"m_InputSlot": {
"m_Node": {
"m_Id": "966c13a2f0a94a189243c9f0d9524146"
},
"m_SlotId": 1
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "b1d371a1c68245c59eaee45d4d61c533"
},
"m_SlotId": 0
},
"m_InputSlot": {
"m_Node": {
"m_Id": "263e3f691adc4e89ae69574634db2de6"
},
"m_SlotId": 0
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "b1d371a1c68245c59eaee45d4d61c533"
},
"m_SlotId": 0
},
"m_InputSlot": {
"m_Node": {
"m_Id": "95caa98ec1fe4b12be341a504a26521c"
},
"m_SlotId": 0
}
}
],
"m_VertexContext": {
"m_Position": {
"x": 0.0,
"y": 0.0
},
"m_Blocks": []
},
"m_FragmentContext": {
"m_Position": {
"x": 0.0,
"y": 0.0
},
"m_Blocks": []
},
"m_PreviewData": {
"serializedMesh": {
"m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}",
"m_Guid": ""
}
},
"m_Path": "Sub Graphs",
"m_ConcretePrecision": 0,
"m_OutputNode": {
"m_Id": "966c13a2f0a94a189243c9f0d9524146"
},
"m_ActiveTargets": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "118dcba6ddd7426b8bd4d80808b125fc",
"m_Id": 0,
"m_DisplayName": "f1",
"m_SlotType": 0,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "f1",
"m_StageCapability": 3,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": [
"X"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "124ded35cbdf4fa58367d2a2bf5374dc",
"m_Id": 1,
"m_DisplayName": "f3",
"m_SlotType": 1,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "f3",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [
"X",
"Y",
"Z"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode",
"m_ObjectId": "263e3f691adc4e89ae69574634db2de6",
"m_Group": {
"m_Id": ""
},
"m_Name": "Custom Function",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -81.0,
"y": 325.0,
"width": 208.0,
"height": 278.0
}
},
"m_Slots": [
{
"m_Id": "32a19e0ffeb54588b2a8f5c9e2a738cd"
},
{
"m_Id": "e5b6dcbec075435fbc9af85799fe6420"
}
],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SourceType": 0,
"m_FunctionName": "FloatToFloat2",
"m_FunctionSource": "02eb5540183369645883b2c6b33144dc",
"m_FunctionBody": "Enter function body here..."
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "32a19e0ffeb54588b2a8f5c9e2a738cd",
"m_Id": 0,
"m_DisplayName": "f1",
"m_SlotType": 0,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "f1",
"m_StageCapability": 3,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": [
"X"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode",
"m_ObjectId": "5c342c9c5ab943a6ab1d9499425f19e0",
"m_Group": {
"m_Id": ""
},
"m_Name": "Custom Function",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 157.0,
"y": 325.0,
"width": 208.0,
"height": 278.0
}
},
"m_Slots": [
{
"m_Id": "e613aa81b1a9434aac59f67e9ae7339b"
},
{
"m_Id": "7c8b7afd842e45a5960396a7de8d42f0"
}
],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SourceType": 0,
"m_FunctionName": "Float2ToFloat3",
"m_FunctionSource": "02eb5540183369645883b2c6b33144dc",
"m_FunctionBody": "Enter function body here..."
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
"m_ObjectId": "771ac3b08a1144b086078a0d07c220da",
"m_Guid": {
"m_GuidSerialized": "000a9ca6-880e-4eee-a436-af6921fc25b8"
},
"m_Name": "Vector1",
"m_DefaultReferenceName": "Vector1_771ac3b08a1144b086078a0d07c220da",
"m_OverrideReferenceName": "",
"m_GeneratePropertyBlock": true,
"m_Precision": 0,
"m_GPUInstanced": false,
"m_Hidden": false,
"m_Value": 0.23919999599456788,
"m_FloatType": 0,
"m_RangeValues": {
"x": 0.0,
"y": 1.0
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "7c8b7afd842e45a5960396a7de8d42f0",
"m_Id": 1,
"m_DisplayName": "f3",
"m_SlotType": 1,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "f3",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [
"X",
"Y",
"Z"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode",
"m_ObjectId": "95caa98ec1fe4b12be341a504a26521c",
"m_Group": {
"m_Id": ""
},
"m_Name": "Custom Function",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -75.0,
"y": 3.0,
"width": 208.0,
"height": 278.0
}
},
"m_Slots": [
{
"m_Id": "118dcba6ddd7426b8bd4d80808b125fc"
},
{
"m_Id": "124ded35cbdf4fa58367d2a2bf5374dc"
}
],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SourceType": 0,
"m_FunctionName": "FloatToFloat3",
"m_FunctionSource": "02eb5540183369645883b2c6b33144dc",
"m_FunctionBody": "Enter function body here..."
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.SubGraphOutputNode",
"m_ObjectId": "966c13a2f0a94a189243c9f0d9524146",
"m_Group": {
"m_Id": ""
},
"m_Name": "Output",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 538.0,
"y": 9.5367431640625e-7,
"width": 120.00000762939453,
"height": 77.00000762939453
}
},
"m_Slots": [
{
"m_Id": "b220757e741547ccaa7b90e39ecc4acb"
}
],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_CustomColors": {
"m_SerializableColors": []
},
"IsFirstSlotValid": true
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
"m_ObjectId": "b1d371a1c68245c59eaee45d4d61c533",
"m_Group": {
"m_Id": ""
},
"m_Name": "Property",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -219.0,
"y": 43.0,
"width": 115.0,
"height": 34.0
}
},
"m_Slots": [
{
"m_Id": "f2355e12360c41d8be5dbcb32f44c13d"
}
],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_Property": {
"m_Id": "771ac3b08a1144b086078a0d07c220da"
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "b220757e741547ccaa7b90e39ecc4acb",
"m_Id": 1,
"m_DisplayName": "Out_Vector3",
"m_SlotType": 0,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "OutVector3",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [
"X",
"Y",
"Z"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot",
"m_ObjectId": "e5b6dcbec075435fbc9af85799fe6420",
"m_Id": 1,
"m_DisplayName": "f2",
"m_SlotType": 1,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "f2",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0
},
"m_Labels": [
"X",
"Y"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot",
"m_ObjectId": "e613aa81b1a9434aac59f67e9ae7339b",
"m_Id": 0,
"m_DisplayName": "f2 (1)",
"m_SlotType": 0,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "f2",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0
},
"m_Labels": [
"X",
"Y"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "f2355e12360c41d8be5dbcb32f44c13d",
"m_Id": 0,
"m_DisplayName": "Vector1",
"m_SlotType": 1,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": [
"X"
]
}

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 18ce5782075ebe745a6c31bffe3ff85e
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3}

View File

@ -131,13 +131,13 @@
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "206320e6a1984736b1513c9eed70af22",
"m_ObjectId": "848145a6436e4e8aba88f8ef1a124b78",
"m_Id": 1,
"m_DisplayName": "vector3",
"m_DisplayName": "f3",
"m_SlotType": 1,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "vector3",
"m_ShaderOutputName": "f3",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
@ -156,24 +156,6 @@
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "2f0e331f581747c9baca83433ff3a875",
"m_Id": 0,
"m_DisplayName": "vector1",
"m_SlotType": 0,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "vector1",
"m_StageCapability": 3,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": [
"X"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
@ -270,17 +252,17 @@
"m_Position": {
"serializedVersion": "2",
"x": -669.0,
"y": -2.0,
"width": 181.0,
"y": -1.0,
"width": 142.0,
"height": 94.0
}
},
"m_Slots": [
{
"m_Id": "2f0e331f581747c9baca83433ff3a875"
"m_Id": "f44972630e70452686fb82e2cd3a9e44"
},
{
"m_Id": "206320e6a1984736b1513c9eed70af22"
"m_Id": "848145a6436e4e8aba88f8ef1a124b78"
}
],
"m_Precision": 0,
@ -294,3 +276,21 @@
"m_FunctionBody": "Enter function body here..."
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "f44972630e70452686fb82e2cd3a9e44",
"m_Id": 0,
"m_DisplayName": "f1",
"m_SlotType": 0,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "f1",
"m_StageCapability": 3,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": [
"X"
]
}

View File

@ -65,6 +65,12 @@
},
{
"m_Id": "162fa960f3894c9fb70367b3991edf5a"
},
{
"m_Id": "6b6867732354471b902be3554bba5b09"
},
{
"m_Id": "be7a8a9d9878441eaec283da2aaf8933"
}
],
"m_GroupDatas": [],
@ -154,6 +160,20 @@
"m_SlotId": -1980518314
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "6b6867732354471b902be3554bba5b09"
},
"m_SlotId": 1
},
"m_InputSlot": {
"m_Node": {
"m_Id": "be7a8a9d9878441eaec283da2aaf8933"
},
"m_SlotId": 0
}
},
{
"m_OutputSlot": {
"m_Node": {
@ -640,9 +660,9 @@
"m_GPUInstanced": false,
"m_Hidden": false,
"m_Value": {
"r": 0.8301886916160584,
"g": 0.4964756965637207,
"b": 0.07440368086099625,
"r": 0.2350783497095108,
"g": 0.8584905862808228,
"b": 0.1579298973083496,
"a": 0.0
},
"m_ColorMode": 0
@ -789,6 +809,34 @@
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
"m_ObjectId": "5529db94ce71493980a6bcdb26f8bbb1",
"m_Id": 1,
"m_DisplayName": "Out_Vector3",
"m_SlotType": 1,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "OutVector3",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [
"X",
"Y",
"Z"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot",
@ -939,6 +987,46 @@
"m_SerializedDescriptor": "SurfaceDescription.Smoothness"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.SubGraphNode",
"m_ObjectId": "6b6867732354471b902be3554bba5b09",
"m_Group": {
"m_Id": ""
},
"m_Name": "DecodeFloatToFloat3",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -944.0,
"y": 1389.0,
"width": 208.0,
"height": 278.0
}
},
"m_Slots": [
{
"m_Id": "7397f58292e54fc2beee337ecd54e939"
},
{
"m_Id": "5529db94ce71493980a6bcdb26f8bbb1"
}
],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedSubGraph": "{\n \"subGraph\": {\n \"fileID\": -5475051401550479605,\n \"guid\": \"18ce5782075ebe745a6c31bffe3ff85e\",\n \"type\": 3\n }\n}",
"m_PropertyGuids": [
"000a9ca6-880e-4eee-a436-af6921fc25b8"
],
"m_PropertyIds": [
654627568
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget",
@ -993,6 +1081,24 @@
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "7397f58292e54fc2beee337ecd54e939",
"m_Id": 654627568,
"m_DisplayName": "Vector1",
"m_SlotType": 0,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "Vector1_771ac3b08a1144b086078a0d07c220da",
"m_StageCapability": 3,
"m_Value": 0.23919999599456788,
"m_DefaultValue": 0.0,
"m_Labels": [
"X"
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot",
@ -1446,6 +1552,41 @@
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PreviewNode",
"m_ObjectId": "be7a8a9d9878441eaec283da2aaf8933",
"m_Group": {
"m_Id": ""
},
"m_Name": "Preview",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -682.0,
"y": 1389.0,
"width": 208.0,
"height": 278.0
}
},
"m_Slots": [
{
"m_Id": "e0d2d0e15cc14decbb4418c29b8503be"
},
{
"m_Id": "f3f4d3efc35c484887ea1c7630a567b7"
}
],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_Width": 208.0,
"m_Height": 208.0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
@ -1586,6 +1727,31 @@
"m_ColorMode": 1
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
"m_ObjectId": "e0d2d0e15cc14decbb4418c29b8503be",
"m_Id": 0,
"m_DisplayName": "In",
"m_SlotType": 0,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "In",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
@ -1636,6 +1802,31 @@
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
"m_ObjectId": "f3f4d3efc35c484887ea1c7630a567b7",
"m_Id": 1,
"m_DisplayName": "Out",
"m_SlotType": 1,
"m_Priority": 2147483647,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",