Fixed for Entities 1.0

This commit is contained in:
Maximilian Winter
2022-12-04 04:18:35 +01:00
parent 4499f67f31
commit 6fde2095aa
17 changed files with 1059 additions and 331 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2,9 +2,25 @@
#ifndef VERTEXANIMATIONUTILS_INCLUDED
#define VERTEX_ANIMATION_INCLUDED
#include "VectorEncodingDecoding.hlsl"
#include "SampleTexture2DArrayLOD.hlsl"
void CALC_VA_UV_float(float2 uv, int maxFrames, float time, out float2 uvPosition)
{
float timeInFrames = frac(time);
timeInFrames = ceil(timeInFrames * maxFrames);
timeInFrames /= maxFrames;
timeInFrames += round(1.0f / maxFrames);
uvPosition.x = uv.x;
#ifdef VA_FLIP_UVS_ON
uvPosition.y = (1.0f - (timeInFrames)) + (1.0f - (1.0f - uv.y));
#else
uvPosition.y = (1.0f - (1.0f - uv.y) - (1.0f - (timeInFrames)));
#endif
}
float2 VA_UV_float(float2 uv, int maxFrames, float time)
{
float2 uvPosition;

View File

@ -1,5 +1,5 @@
{
"m_SGVersion": 2,
"m_SGVersion": 3,
"m_Type": "UnityEditor.ShaderGraph.GraphData",
"m_ObjectId": "144dcb1a2d15470a91360080bc9bd989",
"m_Properties": [
@ -23,6 +23,12 @@
}
],
"m_Keywords": [],
"m_Dropdowns": [],
"m_CategoryData": [
{
"m_Id": "7b54f901e6934a3f86974515753934c1"
}
],
"m_Nodes": [
{
"m_Id": "031d019a3f114a639fed0a731159883c"
@ -183,10 +189,12 @@
"serializedMesh": {
"m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}",
"m_Guid": ""
}
},
"preventRotation": false
},
"m_Path": "Sub Graphs",
"m_ConcretePrecision": 0,
"m_GraphPrecision": 0,
"m_PreviewMode": 2,
"m_OutputNode": {
"m_Id": "031d019a3f114a639fed0a731159883c"
},
@ -222,6 +230,8 @@
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
@ -254,7 +264,8 @@
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "texSampler",
"m_StageCapability": 3
"m_StageCapability": 3,
"m_BareResource": true
}
{
@ -283,6 +294,8 @@
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
@ -317,6 +330,8 @@
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
@ -334,7 +349,8 @@
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3
"m_StageCapability": 3,
"m_BareResource": false
}
{
@ -369,6 +385,33 @@
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.CategoryData",
"m_ObjectId": "7b54f901e6934a3f86974515753934c1",
"m_Name": "",
"m_ChildObjectList": [
{
"m_Id": "c333595616b942739573e272a2bcc553"
},
{
"m_Id": "a09a6ce7e08545d99b5bda70586f4e79"
},
{
"m_Id": "975a04061f8d4786bce18d1574108732"
},
{
"m_Id": "f9b649ed28584dca8a522f3fb582f350"
},
{
"m_Id": "967e0c2bcb6e48c2b85b82c6d4c734a4"
},
{
"m_Id": "cc4eba55004546408c4665cdb22d3111"
}
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot",
@ -409,21 +452,21 @@
}
{
"m_SGVersion": 0,
"m_SGVersion": 1,
"m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode",
"m_ObjectId": "83aca69ecbd845e888867dea88a660f1",
"m_Group": {
"m_Id": ""
},
"m_Name": "Custom Function",
"m_Name": "VA_ARRAY (Custom Function)",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -405.0,
"y": -144.0,
"width": 237.99998474121095,
"height": 494.0
"x": -402.66668701171877,
"y": -148.0,
"width": 237.33331298828126,
"height": 399.9999694824219
}
},
"m_Slots": [
@ -455,6 +498,8 @@
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
@ -496,12 +541,17 @@
"m_GuidSerialized": "26e53708-434a-4d58-b8b2-d8fb8005d644"
},
"m_Name": "MaxFrames",
"m_DefaultRefNameVersion": 0,
"m_RefNameGeneratedByDisplayName": "",
"m_DefaultReferenceName": "Vector1_967e0c2bcb6e48c2b85b82c6d4c734a4",
"m_OverrideReferenceName": "",
"m_GeneratePropertyBlock": true,
"m_UseCustomSlotLabel": false,
"m_CustomSlotLabel": "",
"m_DismissedVersion": 0,
"m_Precision": 0,
"overrideHLSLDeclaration": false,
"hlslDeclarationOverride": 0,
"overrideHLSLDeclaration": true,
"hlslDeclarationOverride": 2,
"m_Hidden": false,
"m_Value": 0.0,
"m_FloatType": 0,
@ -512,23 +562,29 @@
}
{
"m_SGVersion": 0,
"m_SGVersion": 1,
"m_Type": "UnityEditor.ShaderGraph.SamplerStateShaderProperty",
"m_ObjectId": "975a04061f8d4786bce18d1574108732",
"m_Guid": {
"m_GuidSerialized": "374e9a5f-1ef4-43a2-9ff2-6108a1976ab0"
},
"m_Name": "SamplerState",
"m_DefaultReferenceName": "",
"m_OverrideReferenceName": "SamplerState_Linear_Repeat",
"m_DefaultRefNameVersion": 0,
"m_RefNameGeneratedByDisplayName": "",
"m_DefaultReferenceName": "SamplerState_975a04061f8d4786bce18d1574108732",
"m_OverrideReferenceName": "",
"m_GeneratePropertyBlock": true,
"m_UseCustomSlotLabel": false,
"m_CustomSlotLabel": "",
"m_DismissedVersion": 0,
"m_Precision": 0,
"overrideHLSLDeclaration": false,
"hlslDeclarationOverride": 0,
"m_Hidden": false,
"m_Value": {
"m_filter": 0,
"m_wrap": 0
"m_wrap": 0,
"m_anisotropic": 0
}
}
@ -540,12 +596,17 @@
"m_GuidSerialized": "96fb959c-8624-4642-9ac6-6b405b5a6dd4"
},
"m_Name": "UV",
"m_DefaultRefNameVersion": 0,
"m_RefNameGeneratedByDisplayName": "",
"m_DefaultReferenceName": "Vector2_a09a6ce7e08545d99b5bda70586f4e79",
"m_OverrideReferenceName": "",
"m_GeneratePropertyBlock": true,
"m_UseCustomSlotLabel": false,
"m_CustomSlotLabel": "",
"m_DismissedVersion": 0,
"m_Precision": 0,
"overrideHLSLDeclaration": false,
"hlslDeclarationOverride": 0,
"hlslDeclarationOverride": 2,
"m_Hidden": false,
"m_Value": {
"x": 0.0,
@ -642,6 +703,8 @@
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
@ -660,6 +723,7 @@
"m_Hidden": false,
"m_ShaderOutputName": "positionMap",
"m_StageCapability": 3,
"m_BareResource": true,
"m_TextureArray": {
"m_SerializedTexture": "{\"textureArray\":{\"instanceID\":0}}",
"m_Guid": ""
@ -718,15 +782,20 @@
"m_GuidSerialized": "484a186e-c3de-457f-80e1-65e0ac649faf"
},
"m_Name": "PositionMap",
"m_DefaultRefNameVersion": 0,
"m_RefNameGeneratedByDisplayName": "",
"m_DefaultReferenceName": "Texture2DArray_c333595616b942739573e272a2bcc553",
"m_OverrideReferenceName": "",
"m_GeneratePropertyBlock": true,
"m_UseCustomSlotLabel": false,
"m_CustomSlotLabel": "",
"m_DismissedVersion": 0,
"m_Precision": 0,
"overrideHLSLDeclaration": false,
"hlslDeclarationOverride": 0,
"m_Hidden": false,
"m_Value": {
"m_SerializedTexture": "{\"textureArray\":{\"instanceID\":0}}",
"m_SerializedTexture": "{\"textureArray\":{\"fileID\":3909434844059189716,\"guid\":\"7211d85b1ff94194f9be9f44b460b472\",\"type\":2}}",
"m_Guid": ""
},
"m_Modifiable": true
@ -758,6 +827,8 @@
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
@ -774,12 +845,17 @@
"m_GuidSerialized": "3f779194-c6e4-40be-9134-677bb0c69785"
},
"m_Name": "PositionMapIndex",
"m_DefaultRefNameVersion": 0,
"m_RefNameGeneratedByDisplayName": "",
"m_DefaultReferenceName": "Vector1_cc4eba55004546408c4665cdb22d3111",
"m_OverrideReferenceName": "",
"m_GeneratePropertyBlock": true,
"m_UseCustomSlotLabel": false,
"m_CustomSlotLabel": "",
"m_DismissedVersion": 0,
"m_Precision": 0,
"overrideHLSLDeclaration": true,
"hlslDeclarationOverride": 3,
"hlslDeclarationOverride": 2,
"m_Hidden": false,
"m_Value": 0.0,
"m_FloatType": 0,
@ -798,7 +874,8 @@
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3
"m_StageCapability": 3,
"m_BareResource": false
}
{
@ -827,6 +904,8 @@
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
@ -878,6 +957,8 @@
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
@ -894,12 +975,17 @@
"m_GuidSerialized": "07478aa4-3d18-4430-bf12-24688db601b8"
},
"m_Name": "Time",
"m_DefaultRefNameVersion": 0,
"m_RefNameGeneratedByDisplayName": "",
"m_DefaultReferenceName": "Vector1_f9b649ed28584dca8a522f3fb582f350",
"m_OverrideReferenceName": "",
"m_GeneratePropertyBlock": true,
"m_UseCustomSlotLabel": false,
"m_CustomSlotLabel": "",
"m_DismissedVersion": 0,
"m_Precision": 0,
"overrideHLSLDeclaration": false,
"hlslDeclarationOverride": 0,
"overrideHLSLDeclaration": true,
"hlslDeclarationOverride": 2,
"m_Hidden": false,
"m_Value": 0.0,
"m_FloatType": 0,