add : sam groud textures & sam character animation

This commit is contained in:
Ferlat Thibaud
2026-06-17 12:45:50 +02:00
parent de466efa05
commit 7290cbcae5
24 changed files with 2098 additions and 2593 deletions
@@ -17,6 +17,9 @@
},
{
"m_Id": "53d5afff3c3f4a9db8281850eee533f8"
},
{
"m_Id": "0d915a4254bd45bc817e7fafacd8e7e2"
}
],
"m_Keywords": [],
@@ -98,6 +101,9 @@
},
{
"m_Id": "bd957a577b964244ac6b8f9854af3641"
},
{
"m_Id": "05c8f09eeb854bd68d6807ecd446e194"
}
],
"m_GroupDatas": [],
@@ -117,6 +123,20 @@
"m_SlotId": 0
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "05c8f09eeb854bd68d6807ecd446e194"
},
"m_SlotId": 0
},
"m_InputSlot": {
"m_Node": {
"m_Id": "8c33db14052d44f58d122f6121da5b71"
},
"m_SlotId": 18
}
},
{
"m_OutputSlot": {
"m_Node": {
@@ -452,6 +472,42 @@
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
"m_ObjectId": "05c8f09eeb854bd68d6807ecd446e194",
"m_Group": {
"m_Id": ""
},
"m_Name": "Property",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 1129.9998779296875,
"y": 174.99996948242188,
"width": 147.0001220703125,
"height": 34.0
}
},
"m_Slots": [
{
"m_Id": "846801b25c654018842d22cb8451db27"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_Property": {
"m_Id": "0d915a4254bd45bc817e7fafacd8e7e2"
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
@@ -483,10 +539,41 @@
"m_ChildObjectList": [
{
"m_Id": "f8301001f4f843788881d0078777ce68"
},
{
"m_Id": "0d915a4254bd45bc817e7fafacd8e7e2"
}
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Internal.BooleanShaderProperty",
"m_ObjectId": "0d915a4254bd45bc817e7fafacd8e7e2",
"m_Guid": {
"m_GuidSerialized": "79134197-ced2-4d6a-9699-2745ad92af90"
},
"promotedFromAssetID": "",
"promotedFromCategoryName": "",
"promotedOrdering": -1,
"m_Name": "EnableFacing",
"m_DefaultRefNameVersion": 1,
"m_RefNameGeneratedByDisplayName": "EnableFacing",
"m_DefaultReferenceName": "_EnableFacing",
"m_OverrideReferenceName": "",
"m_GeneratePropertyBlock": true,
"m_UseCustomSlotLabel": false,
"m_CustomSlotLabel": "",
"m_DismissedVersion": 0,
"m_Precision": 0,
"overrideHLSLDeclaration": false,
"hlslDeclarationOverride": 0,
"m_Hidden": false,
"m_PerRendererData": false,
"m_customAttributes": [],
"m_Value": true
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot",
@@ -1474,6 +1561,20 @@
"m_LiteralMode": false
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot",
"m_ObjectId": "846801b25c654018842d22cb8451db27",
"m_Id": 0,
"m_DisplayName": "EnableFacing",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3,
"m_Value": false,
"m_DefaultValue": false
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
@@ -1577,6 +1678,9 @@
{
"m_Id": "4087f03500c74575947fac907d28ba80"
},
{
"m_Id": "db4f5d0986904c7aa591a381a57ee4fd"
},
{
"m_Id": "7ec1359c52ff4769a1a604ffaa6239a5"
},
@@ -1922,8 +2026,8 @@
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 1299.9998779296875,
"y": 195.0,
"x": 1314.9998779296875,
"y": 232.99996948242188,
"width": 91.0,
"height": 34.0
}
@@ -2413,6 +2517,20 @@
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot",
"m_ObjectId": "db4f5d0986904c7aa591a381a57ee4fd",
"m_Id": 18,
"m_DisplayName": "EnableFacing",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "EnableFacing",
"m_StageCapability": 3,
"m_Value": false,
"m_DefaultValue": false
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
@@ -7,7 +7,7 @@ float2 WorldToScreenUV(float3 posWS)
return ndc * .5 + .5; // [0, 1]
}
float3 GetBillboardPositionWS(float3 PositionOS, float3 PivotWS, float3 ViewDirWS)
float3 GetBillboardPositionWS(float3 PositionOS, float3 PivotWS, float3 ViewDirWS, uint EnableFacing)
{
float3 upWS = normalize(TransformObjectToWorldDir(float3(0, 1, 0)));
@@ -19,6 +19,13 @@ float3 GetBillboardPositionWS(float3 PositionOS, float3 PivotWS, float3 ViewDirW
rightWS = normalize(rightWS);
float3 forwardWS = normalize(cross(rightWS, upWS));
// Local object-space axes, used as fallback when facing is disabled
float3 localRightWS = normalize(TransformObjectToWorldDir(float3(1, 0, 0)));
float3 localForwardWS = normalize(TransformObjectToWorldDir(float3(0, 0, 1)));
rightWS = lerp(localRightWS, rightWS, (float)EnableFacing);
forwardWS = lerp(localForwardWS, forwardWS, (float)EnableFacing);
float3 pOS = PositionOS.x * rightWS + PositionOS.y * upWS + PositionOS.z * forwardWS;
@@ -45,6 +52,7 @@ void Ray_float
float3 PositionOS,
float4 ScreenPos,
uint Orthographic,
uint EnableFacing,
float UvDebug,
out float3 OutPosition,
out float3 OutColor
@@ -67,9 +75,9 @@ void Ray_float
float3 pOS_1 = AppyTaperAndScale(float3( .5, PositionOS.y, 0), scale);
float3 pOS_2 = AppyTaperAndScale(float3(-.5, PositionOS.y, 0), scale);
float3 pWS_0 = GetBillboardPositionWS(pOS_0, pivot, viewDir);
float3 pWS_1 = GetBillboardPositionWS(pOS_1, pivot, viewDir);
float3 pWS_2 = GetBillboardPositionWS(pOS_2, pivot, viewDir);
float3 pWS_0 = GetBillboardPositionWS(pOS_0, pivot, viewDir, EnableFacing);
float3 pWS_1 = GetBillboardPositionWS(pOS_1, pivot, viewDir, EnableFacing);
float3 pWS_2 = GetBillboardPositionWS(pOS_2, pivot, viewDir, EnableFacing);
float2 pSC_0 = ScreenPos.xy;
float2 pSC_1 = WorldToScreenUV(pWS_1);