Sample Lightmap.asset 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. %YAML 1.1
  2. %TAG !u! tag:unity3d.com,2011:
  3. --- !u!114 &11400000
  4. MonoBehaviour:
  5. m_ObjectHideFlags: 0
  6. m_CorrespondingSourceObject: {fileID: 0}
  7. m_PrefabInstance: {fileID: 0}
  8. m_PrefabAsset: {fileID: 0}
  9. m_GameObject: {fileID: 0}
  10. m_Enabled: 1
  11. m_EditorHideFlags: 0
  12. m_Script: {fileID: 11500000, guid: 78b2425a2284af743826c689403a4924, type: 3}
  13. m_Name: Sample Lightmap
  14. m_EditorClassIdentifier:
  15. m_functionInfo: "// Made with Amplify Shader Editor v1.9.6.1\n// Available at the
  16. Unity Asset Store - http://u3d.as/y3X \n/*ASEBEGIN\nVersion=19601\nNode;AmplifyShaderEditor.CommentaryNode;212;1066.107,-568.2391;Inherit;False;614.2085;438.7624;;5;210;211;215;213;216;SRP
  17. Switch;1,1,1,1;0;0\nNode;AmplifyShaderEditor.CommentaryNode;198;-3321.077,-917.414;Inherit;False;1469.91;1078.811;;17;170;55;62;61;54;71;168;67;13;16;15;19;18;17;20;101;245;Inputs;1,1,1,1;0;0\nNode;AmplifyShaderEditor.CommentaryNode;197;-1643.276,-298.3067;Inherit;False;1831.265;759.8353;;15;249;192;190;194;191;188;175;174;176;189;153;167;173;195;196;URP
  18. & HDRP;1,1,1,1;0;0\nNode;AmplifyShaderEditor.CommentaryNode;200;-1643.683,-1527.179;Inherit;False;2476.525;940.3968;;24;225;209;205;232;208;218;204;203;230;202;201;221;220;219;226;233;234;235;237;238;239;240;243;246;BiRP;1,1,1,1;0;0\nNode;AmplifyShaderEditor.CommentaryNode;199;1811.648,-566.3028;Inherit;False;542.9536;444.1997;;2;178;0;Outputs;1,1,1,1;0;0\nNode;AmplifyShaderEditor.GetLocalVarNode;173;-1007.25,-144.4184;Inherit;False;170;backNormalWS;1;0;OBJECT;;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.GetLocalVarNode;167;-982.1501,-225.209;Inherit;False;67;normalWS;1;0;OBJECT;;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.FunctionNode;61;-2341.289,-408.4945;Inherit;False;Lightmap
  19. UV;-1;;77;1940f027d0458684eb0ad486f669d7d5;1,1,1;0;1;FLOAT2;0\nNode;AmplifyShaderEditor.Vector4Node;16;-2885.037,-91.71725;Float;False;Constant;_Vector1;Vector
  20. 1;3;0;Create;True;0;0;0;False;0;False;0,0,0,0;0,0,0,0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4\nNode;AmplifyShaderEditor.StaticSwitch;15;-3037.036,-261.7169;Float;False;Property;_Keyword2;Keyword
  21. 2;2;0;Create;True;0;0;0;False;0;False;0;0;0;False;UNITY_LIGHTMAP_RGBM_ENCODING;Toggle;2;Key0;Key1;Fetch;True;True;All;9;1;FLOAT4;0,0,0,0;False;0;FLOAT4;0,0,0,0;False;2;FLOAT4;0,0,0,0;False;3;FLOAT4;0,0,0,0;False;4;FLOAT4;0,0,0,0;False;5;FLOAT4;0,0,0,0;False;6;FLOAT4;0,0,0,0;False;7;FLOAT4;0,0,0,0;False;8;FLOAT4;0,0,0,0;False;1;FLOAT4;0\nNode;AmplifyShaderEditor.CustomExpressionNode;19;-2608.36,-289.4103;Inherit;False;return
  22. float4(LIGHTMAP_HDR_MULTIPLIER, LIGHTMAP_HDR_EXPONENT, 0, 0)@;4;Create;0;URPDecodeInstruction;True;False;0;;False;0;1;FLOAT4;0\nNode;AmplifyShaderEditor.Vector4Node;18;-3271.077,-50.60384;Float;False;Constant;_Vector3;Vector
  23. 3;3;0;Create;True;0;0;0;False;0;False;34.49324,2.2,0,0;0,0,0,0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4\nNode;AmplifyShaderEditor.Vector4Node;17;-3264.077,-263.6035;Float;False;Constant;_Vector2;Vector
  24. 2;3;0;Create;True;0;0;0;False;0;False;2,2.2,0,0;0,0,0,0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4\nNode;AmplifyShaderEditor.FunctionSwitchByPipeline;20;-2342.951,-225.9808;Inherit;False;4;0;FLOAT4;0,0,0,0;False;3;FLOAT4;0,0,0,0;False;1;FLOAT4;0,0,0,0;False;2;FLOAT4;0,0,0,0;False;1;FLOAT4;0\nNode;AmplifyShaderEditor.RegisterLocalVarNode;101;-2100.167,-229.8449;Inherit;False;decodeInstructions;-1;True;1;0;FLOAT4;0,0,0,0;False;1;FLOAT4;0\nNode;AmplifyShaderEditor.RegisterLocalVarNode;55;-2105.392,-528.5924;Inherit;False;staticUV;-1;True;1;0;FLOAT2;0,0;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.RegisterLocalVarNode;62;-2108.067,-411.3564;Inherit;False;dynamicUV;-1;True;1;0;FLOAT2;0,0;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.FunctionNode;54;-2343.268,-526.1492;Inherit;False;Lightmap
  25. UV;-1;;78;1940f027d0458684eb0ad486f669d7d5;1,1,0;0;1;FLOAT2;0\nNode;AmplifyShaderEditor.StaticSwitch;13;-2689.409,-196.2771;Float;False;Property;_Keyword0;Keyword
  26. 0;1;0;Create;True;0;0;0;False;0;False;0;0;0;False;UNITY_LIGHTMAP_FULL_HDR;Toggle;2;Key0;Key1;Fetch;True;True;All;9;1;FLOAT4;0,0,0,0;False;0;FLOAT4;0,0,0,0;False;2;FLOAT4;0,0,0,0;False;3;FLOAT4;0,0,0,0;False;4;FLOAT4;0,0,0,0;False;5;FLOAT4;0,0,0,0;False;6;FLOAT4;0,0,0,0;False;7;FLOAT4;0,0,0,0;False;8;FLOAT4;0,0,0,0;False;1;FLOAT4;0\nNode;AmplifyShaderEditor.FunctionSwitchByPipeline;211;1409.194,-331.8781;Inherit;False;4;0;COLOR;0,0,0,0;False;3;COLOR;0,0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;1;COLOR;0\nNode;AmplifyShaderEditor.FunctionSwitchByPipeline;210;1407.375,-495.5697;Inherit;False;4;0;COLOR;0,0,0,0;False;3;COLOR;0,0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;1;COLOR;0\nNode;AmplifyShaderEditor.RelayNode;216;1156.125,-423.1747;Inherit;False;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.RelayNode;213;1156.155,-496.1849;Inherit;False;1;0;COLOR;0,0,0,0;False;1;COLOR;0\nNode;AmplifyShaderEditor.RelayNode;215;1158.605,-258.5797;Inherit;False;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.FunctionNode;204;-1082.759,-820.9391;Inherit;False;Bicubic
  27. Sample;-1;;79;ce0e14d5ad5eac645b2e5892ab3506ff;2,92,2,72,2;7;99;SAMPLER2D;0;False;91;SAMPLER2DARRAY;0;False;93;FLOAT;0;False;97;FLOAT2;0,0;False;198;FLOAT4;0,0,0,0;False;199;FLOAT2;0,0;False;94;SAMPLERSTATE;0;False;5;COLOR;86;FLOAT;84;FLOAT;85;FLOAT;82;FLOAT;83\nNode;AmplifyShaderEditor.CustomExpressionNode;218;-1556.358,-756.4255;Inherit;False;int
  28. width = 1, height = 1@$#if !defined( SHADER_TARGET_SURFACE_ANALYSIS )$unity_Lightmap.GetDimensions(
  29. width, height )@$#endif$TexelSize = float4( 1.0 / float2( width, height ), width,
  30. height )@;7;Create;1;True;TexelSize;FLOAT4;0,0,0,0;Out;;Inherit;False;Lightmap
  31. Texel Size;False;False;0;;False;2;0;FLOAT;0;False;1;FLOAT4;0,0,0,0;False;2;FLOAT;0;FLOAT4;2\nNode;AmplifyShaderEditor.GetLocalVarNode;208;-1535.264,-848.9343;Inherit;False;55;staticUV;1;0;OBJECT;;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.FunctionNode;205;-1349.639,-792.7326;Inherit;False;Bicubic
  32. Precompute;-1;;80;818835145cc522e4da1f9915d8b8a984;0;2;5;FLOAT2;0,0;False;55;FLOAT4;0,0,0,0;False;2;FLOAT4;34;FLOAT2;54\nNode;AmplifyShaderEditor.TexturePropertyNode;201;-1570.616,-1145.339;Float;True;Global;unity_Lightmap;unity_Lightmap;0;0;Fetch;True;0;0;0;False;0;False;None;None;False;white;Auto;Texture2D;-1;0;2;SAMPLER2D;0;SAMPLERSTATE;1\nNode;AmplifyShaderEditor.GetLocalVarNode;202;-1511.77,-943.116;Inherit;False;55;staticUV;1;0;OBJECT;;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.SamplerNode;203;-1276.811,-1039.238;Inherit;True;Property;_TextureSample0;Texture
  33. Sample 0;0;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5\nNode;AmplifyShaderEditor.WireNode;230;-1293.099,-841.9213;Inherit;False;1;0;SAMPLER2D;;False;1;SAMPLER2D;0\nNode;AmplifyShaderEditor.WireNode;232;-1137.081,-816.2039;Inherit;False;1;0;SAMPLER2D;;False;1;SAMPLER2D;0\nNode;AmplifyShaderEditor.FunctionNode;237;-623.8598,-1071.433;Inherit;False;Bicubic
  34. Precompute;-1;;83;818835145cc522e4da1f9915d8b8a984;0;2;5;FLOAT2;0,0;False;55;FLOAT4;0,0,0,0;False;2;FLOAT4;34;FLOAT2;54\nNode;AmplifyShaderEditor.FunctionNode;233;-356.9789,-1099.639;Inherit;False;Bicubic
  35. Sample;-1;;84;ce0e14d5ad5eac645b2e5892ab3506ff;2,92,2,72,2;7;99;SAMPLER2D;0;False;91;SAMPLER2DARRAY;0;False;93;FLOAT;0;False;97;FLOAT2;0,0;False;198;FLOAT4;0,0,0,0;False;199;FLOAT2;0,0;False;94;SAMPLERSTATE;0;False;5;COLOR;86;FLOAT;84;FLOAT;85;FLOAT;82;FLOAT;83\nNode;AmplifyShaderEditor.WireNode;240;-413.0786,-1096.328;Inherit;False;1;0;SAMPLER2D;;False;1;SAMPLER2D;0\nNode;AmplifyShaderEditor.SamplerNode;219;-539.1411,-1312.84;Inherit;True;Property;_TextureSample12;Texture
  36. Sample 0;0;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5\nNode;AmplifyShaderEditor.TexturePropertyNode;221;-829.9549,-1413.015;Float;True;Global;unity_LightmapInd;unity_LightmapInd;1;0;Fetch;True;0;0;0;False;0;False;None;None;False;white;Auto;Texture2D;-1;0;2;SAMPLER2D;0;SAMPLERSTATE;1\nNode;AmplifyShaderEditor.WireNode;239;-569.8479,-1141.709;Inherit;False;1;0;SAMPLER2D;;False;1;SAMPLER2D;0\nNode;AmplifyShaderEditor.RelayNode;243;-6.239696,-836.7784;Inherit;False;1;0;COLOR;0,0,0,0;False;1;COLOR;0\nNode;AmplifyShaderEditor.StaticSwitch;226;528.4357,-844.262;Float;False;Property;_Keyword1;Keyword
  37. 0;1;0;Create;True;0;0;0;False;0;False;0;0;0;False;DIRLIGHTMAP_COMBINED;Toggle;2;Key0;Key1;Fetch;True;True;All;9;1;COLOR;0,0,0,0;False;0;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;3;COLOR;0,0,0,0;False;4;COLOR;0,0,0,0;False;5;COLOR;0,0,0,0;False;6;COLOR;0,0,0,0;False;7;COLOR;0,0,0,0;False;8;COLOR;0,0,0,0;False;1;COLOR;0\nNode;AmplifyShaderEditor.FunctionSwitch;209;-835.5051,-844.2455;Inherit;False;Lighting
  38. Filter;False;0;2;0;Bilinear;Bicubic;Instance;195;10;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;8;FLOAT;0;False;9;FLOAT;0;False;1;COLOR;0\nNode;AmplifyShaderEditor.FunctionSwitch;238;-97.97224,-1122.82;Inherit;False;Direction
  39. Filter;False;0;2;1;Bilinear;Bicubic;Object;-1;10;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;8;FLOAT;0;False;9;FLOAT;0;False;1;COLOR;0\nNode;AmplifyShaderEditor.CustomExpressionNode;234;-830.5789,-1035.125;Inherit;False;int
  40. width = 1, height = 1@$#if !defined( SHADER_TARGET_SURFACE_ANALYSIS )$unity_LightmapInd.GetDimensions(
  41. width, height )@$#endif$TexelSize = float4( 1.0 / float2( width, height ), width,
  42. height )@;7;Call;1;True;TexelSize;FLOAT4;0,0,0,0;Out;;Inherit;False;LightmapInd
  43. Texel Size;False;False;0;;False;2;0;FLOAT;0;False;1;FLOAT4;0,0,0,0;False;2;FLOAT;0;FLOAT4;2\nNode;AmplifyShaderEditor.GetLocalVarNode;225;-74.82937,-996.6099;Inherit;False;67;normalWS;1;0;OBJECT;;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.FunctionNode;244;177.309,-942.9111;Inherit;False;Decode
  44. Directional Lighmap;-1;;86;8132441d5c7c63f479ea1c42855420a8;0;3;3;FLOAT3;0,0,0;False;2;FLOAT4;0,0,0,0;False;4;FLOAT3;0,0,0;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.RegisterLocalVarNode;67;-2105.157,-821.5981;Inherit;False;normalWS;-1;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.RegisterLocalVarNode;170;-2108.187,-690.5192;Inherit;False;backNormalWS;-1;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.SimpleMultiplyOpNode;245;-2583.312,-684.721;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT3;-1,-1,-1;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.WorldNormalVector;168;-3006.344,-819.4457;Inherit;False;False;1;0;FLOAT3;0,0,1;False;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3\nNode;AmplifyShaderEditor.FunctionInput;71;-2794.314,-824.7816;Inherit;False;Normal
  45. WS;3;0;False;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.GetLocalVarNode;235;-810.4849,-1110.634;Inherit;False;55;staticUV;1;0;OBJECT;;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.GetLocalVarNode;220;-808.5855,-1190.202;Inherit;False;55;staticUV;1;0;OBJECT;;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.WireNode;246;-856.9822,-1219.418;Inherit;False;1;0;SAMPLERSTATE;;False;1;SAMPLERSTATE;0\nNode;AmplifyShaderEditor.GetLocalVarNode;176;-1027.531,109.2103;Inherit;False;101;decodeInstructions;1;0;OBJECT;;False;1;FLOAT4;0\nNode;AmplifyShaderEditor.GetLocalVarNode;174;-974.187,-66.97986;Inherit;False;55;staticUV;1;0;OBJECT;;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.GetLocalVarNode;175;-982.531,22.33251;Inherit;False;62;dynamicUV;1;0;OBJECT;;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.FunctionSwitch;191;-1000.923,198.1162;Inherit;False;dwd;False;0;2;1;Bilinear;Bicubic;Instance;238;10;0;FLOAT4;0,0,0,0;False;1;FLOAT4;0,0,0,0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;8;FLOAT;0;False;9;FLOAT;0;False;1;FLOAT4;0\nNode;AmplifyShaderEditor.FunctionSwitch;249;-1000.977,315.5321;Inherit;False;dwd;False;0;2;1;Bilinear;Bicubic;Instance;238;10;0;FLOAT4;0,0,0,0;False;1;FLOAT4;0,0,0,0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;8;FLOAT;0;False;9;FLOAT;0;False;1;FLOAT4;0\nNode;AmplifyShaderEditor.FunctionSwitch;195;-60.53754,-130.1396;Inherit;False;Lighting
  46. Filter;False;0;2;0;Bilinear;Bicubic;Object;-1;10;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;8;FLOAT;0;False;9;FLOAT;0;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.FunctionSwitch;196;-60.30683,119.6928;Inherit;False;Lighting
  47. Filter;False;0;2;0;Bilinear;Bicubic;Instance;195;10;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;8;FLOAT;0;False;9;FLOAT;0;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.GetLocalVarNode;189;-1576.323,197.3364;Inherit;False;55;staticUV;1;0;OBJECT;;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.GetLocalVarNode;190;-1585.323,340.3365;Inherit;False;62;dynamicUV;1;0;OBJECT;;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.CustomExpressionNode;192;-1337.46,297.4571;Inherit;False;#if
  48. defined( DIRLIGHTMAP_COMBINED ) && ( defined( SHADER_STAGE_FRAGMENT ) || defined(
  49. SHADER_STAGE_RAY_TRACING ) )$ int width, height@$ float4 texSize@$$
  50. #if defined( LIGHTMAP_ON )$ #if defined( UNITY_DOTS_INSTANCING_ENABLED
  51. )$ unity_LightmapsInd.GetDimensions( width, height )@$
  52. texSize = float4( width, height, 1.0 / float2( width, height ) )@$
  53. staticDir = SampleTexture2DBicubic( unity_LightmapsInd, samplerunity_Lightmaps,
  54. staticUV, texSize, float2( 1, 1 ), unity_LightmapIndex.x )@$ #else$
  55. unity_LightmapInd.GetDimensions( width, height )@$ texSize = float4(
  56. width, height, 1.0 / float2( width, height ) )@$ staticDir = SampleTexture2DBicubic(
  57. unity_LightmapInd, samplerunity_Lightmap, staticUV, texSize, float2( 1, 1 ),
  58. 0 )@$ #endif$ #endif$$ #if defined( DYNAMICLIGHTMAP_ON )$
  59. unity_DynamicDirectionality.GetDimensions( width, height )@$ texSize =
  60. float4( width, height, 1.0 / float2( width, height ) )@$ dynamicDir =
  61. SampleTexture2DBicubic( unity_DynamicDirectionality, samplerunity_DynamicLightmap,
  62. dynamicUV, texSize, float2( 1, 1 ), 0 )@$ #endif$$#endif;7;Create;4;True;staticUV;FLOAT2;0,0;In;;Inherit;False;True;dynamicUV;FLOAT2;0,0;In;;Inherit;False;True;staticDir;FLOAT4;0,0,0,0;Out;;Inherit;False;True;dynamicDir;FLOAT4;0,0,0,0;Out;;Inherit;False;Sample
  63. Direction Bicubic;False;False;0;;False;5;0;FLOAT;0;False;1;FLOAT2;0,0;False;2;FLOAT2;0,0;False;3;FLOAT4;0,0,0,0;False;4;FLOAT4;0,0,0,0;False;3;FLOAT;0;FLOAT4;4;FLOAT4;5\nNode;AmplifyShaderEditor.CustomExpressionNode;194;-624,112;Inherit;False;bakeDiffuseLighting
  64. = 0@$backBakeDiffuseLighting = 0@$#if defined( SHADER_STAGE_FRAGMENT ) || defined(
  65. SHADER_STAGE_RAY_TRACING )$\tint width, height@$\tfloat4 texSize@$\tfloat3 illuminance@$\tfloat
  66. halfLambert@$\tfloat backHalfLambert@$$\t#if defined( LIGHTMAP_ON )$\t\t#ifdef
  67. UNITY_LIGHTMAP_FULL_HDR$\t\t\tbool encodedLightmap = false@$\t\t#else$\t\t\tbool
  68. encodedLightmap = true@$\t\t#endif$$\t\t#if defined( UNITY_DOTS_INSTANCING_ENABLED
  69. )$\t\t\tunity_Lightmaps.GetDimensions( width, height )@$\t\t\ttexSize = float4(
  70. width, height, 1.0 / float2( width, height ) )@$\t\t\tfloat4 encodedIlluminance
  71. = SampleTexture2DBicubic( unity_Lightmaps, samplerunity_Lightmaps, staticUV,
  72. texSize, float2( 1, 1 ), unity_LightmapIndex.x ).rgba@$\t\t#else$\t\t\tunity_Lightmap.GetDimensions(
  73. width, height )@$\t\t\ttexSize = float4( width, height, 1.0 / float2( width,
  74. height ) )@$\t\t\tfloat4 encodedIlluminance = SampleTexture2DBicubic( unity_Lightmap,
  75. samplerunity_Lightmap, staticUV, texSize, float2( 1, 1 ), 0 ).rgba@$\t\t#endif$\t\tilluminance
  76. = encodedLightmap ? DecodeLightmap( encodedIlluminance, decodeInstructions )
  77. : encodedIlluminance.rgb@$$\t\t#if defined( DIRLIGHTMAP_COMBINED )$\t\t\thalfLambert
  78. = dot( normalWS, staticDir.xyz - 0.5 ) + 0.5@$\t\t\tbakeDiffuseLighting += illuminance
  79. * halfLambert / max( 1e-4, staticDir.w )@$$\t\t\tbackHalfLambert = dot( backNormalWS,
  80. staticDir.xyz - 0.5 ) + 0.5@$\t\t\tbackBakeDiffuseLighting += illuminance * backHalfLambert
  81. / max( 1e-4, staticDir.w )@$\t\t#else$\t\t\tbakeDiffuseLighting += illuminance@$\t\t\tbackBakeDiffuseLighting
  82. += illuminance@$\t\t#endif$\t#endif$$\t#if defined( DYNAMICLIGHTMAP_ON )$\t\tunity_DynamicLightmap.GetDimensions(
  83. width, height )@$\t\ttexSize = float4( width, height, 1.0 / float2( width, height
  84. ) )@$$\t\tilluminance = SampleTexture2DBicubic( unity_DynamicLightmap, samplerunity_DynamicLightmap,
  85. dynamicUV, texSize, float2( 1, 1 ), 0 ).rgb@$$\t\t#if defined( DIRLIGHTMAP_COMBINED
  86. )$\t\t\thalfLambert = dot( normalWS, dynamicDir.xyz - 0.5 ) + 0.5@$\t\t\tbakeDiffuseLighting
  87. += illuminance * halfLambert / max( 1e-4, dynamicDir.w )@$$\t\t\tbackHalfLambert
  88. = dot( backNormalWS, dynamicDir.xyz - 0.5 ) + 0.5@$\t\t\tbackBakeDiffuseLighting
  89. += illuminance * backHalfLambert / max( 1e-4, dynamicDir.w )@$\t\t#else$\t\t\tbakeDiffuseLighting
  90. += illuminance@$\t\t\tbackBakeDiffuseLighting += illuminance@$\t\t#endif$\t#endif$$#endif$return@;7;Create;9;True;normalWS;FLOAT3;0,0,0;In;;Inherit;False;True;backNormalWS;FLOAT3;0,0,0;In;;Inherit;False;True;staticUV;FLOAT2;0,0;In;;Inherit;False;True;dynamicUV;FLOAT2;0,0;In;;Inherit;False;True;bakeDiffuseLighting;FLOAT3;0,0,0;Out;;Inherit;False;True;backBakeDiffuseLighting;FLOAT3;0,0,0;Out;;Inherit;False;True;decodeInstructions;FLOAT4;0,0,0,0;In;;Inherit;False;True;staticDir;FLOAT4;0,0,0,0;In;;Inherit;False;True;dynamicDir;FLOAT4;0,0,0,0;In;;Inherit;False;Sample
  91. Lightmap Bicubic;False;False;0;;False;10;0;FLOAT;0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT3;0,0,0;False;6;FLOAT3;0,0,0;False;7;FLOAT4;0,0,0,0;False;8;FLOAT4;0,0,0,0;False;9;FLOAT4;0,0,0,0;False;3;FLOAT;0;FLOAT3;6;FLOAT3;7\nNode;AmplifyShaderEditor.CustomExpressionNode;153;-624,-144;Inherit;False;bakeDiffuseLighting
  92. = 0@$backBakeDiffuseLighting = 0@$#if defined( SHADER_STAGE_FRAGMENT ) || defined(
  93. SHADER_STAGE_RAY_TRACING )$\tfloat3 illuminance@$\tfloat halfLambert@$\tfloat
  94. backHalfLambert@$$\t#if defined( LIGHTMAP_ON )$\t\t#ifdef UNITY_LIGHTMAP_FULL_HDR$\t\t\tbool
  95. encodedLightmap = false@$\t\t#else$\t\t\tbool encodedLightmap = true@$\t\t#endif$$\t\t#if
  96. defined( UNITY_DOTS_INSTANCING_ENABLED )$\t\t\tfloat4 encodedIlluminance = SAMPLE_TEXTURE2D_LIGHTMAP(
  97. unity_Lightmaps, samplerunity_Lightmaps, staticUV, unity_LightmapIndex.x ).rgba@$\t\t#else$\t\t\tfloat4
  98. encodedIlluminance = SAMPLE_TEXTURE2D_LIGHTMAP( unity_Lightmap, samplerunity_Lightmap,
  99. staticUV ).rgba@$\t\t#endif$\t\tilluminance = encodedLightmap ? DecodeLightmap(
  100. encodedIlluminance, decodeInstructions ) : encodedIlluminance.rgb@$$\t\t#if defined(
  101. DIRLIGHTMAP_COMBINED )$\t\t\thalfLambert = dot( normalWS, staticDir.xyz - 0.5
  102. ) + 0.5@$\t\t\tbakeDiffuseLighting += illuminance * halfLambert / max( 1e-4,
  103. staticDir.w )@$$\t\t\tbackHalfLambert = dot( backNormalWS, staticDir.xyz - 0.5
  104. ) + 0.5@$\t\t\tbackBakeDiffuseLighting += illuminance * backHalfLambert / max(
  105. 1e-4, staticDir.w )@$\t\t#else$\t\t\tbakeDiffuseLighting += illuminance@$\t\t\tbackBakeDiffuseLighting
  106. += illuminance@$\t\t#endif$\t#endif$$\t#if defined( DYNAMICLIGHTMAP_ON )$\t\tilluminance
  107. = SAMPLE_TEXTURE2D_LIGHTMAP( unity_DynamicLightmap, samplerunity_DynamicLightmap,
  108. dynamicUV ).rgb@$$\t\t#if defined( DIRLIGHTMAP_COMBINED )$\t\t\thalfLambert =
  109. dot( normalWS, dynamicDir.xyz - 0.5 ) + 0.5@$\t\t\tbakeDiffuseLighting += illuminance
  110. * halfLambert / max( 1e-4, dynamicDir.w )@$$\t\t\tbackHalfLambert = dot( backNormalWS,
  111. dynamicDir.xyz - 0.5 ) + 0.5@$\t\t\tbackBakeDiffuseLighting += illuminance *
  112. backHalfLambert / max( 1e-4, dynamicDir.w )@$\t\t#else$\t\t\tbakeDiffuseLighting
  113. += illuminance@$\t\t\tbackBakeDiffuseLighting += illuminance@$\t\t#endif$\t#endif$$#endif$return@;7;Create;9;True;normalWS;FLOAT3;0,0,0;In;;Inherit;False;True;backNormalWS;FLOAT3;0,0,0;In;;Inherit;False;True;staticUV;FLOAT2;0,0;In;;Inherit;False;True;dynamicUV;FLOAT2;0,0;In;;Inherit;False;True;bakeDiffuseLighting;FLOAT3;0,0,0;Out;;Inherit;False;True;backBakeDiffuseLighting;FLOAT3;0,0,0;Out;;Inherit;False;True;decodeInstructions;FLOAT4;0,0,0,0;In;;Inherit;False;True;staticDir;FLOAT4;0,0,0,0;In;;Inherit;False;True;dynamicDir;FLOAT4;0,0,0,0;In;;Inherit;False;Sample
  114. Lightmap Bilinear;False;False;0;;False;10;0;FLOAT;0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT3;0,0,0;False;6;FLOAT3;0,0,0;False;7;FLOAT4;0,0,0,0;False;8;FLOAT4;0,0,0,0;False;9;FLOAT4;0,0,0,0;False;3;FLOAT;0;FLOAT3;6;FLOAT3;7\nNode;AmplifyShaderEditor.SimpleMultiplyOpNode;255;464,96;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.Exposure;254;256,-16;Inherit;False;0;1;FLOAT;0\nNode;AmplifyShaderEditor.SimpleMultiplyOpNode;256;464,-128;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.FunctionSwitch;258;656,-240;Inherit;False;Apply
  115. Exposure;True;1;2;-1;In 0;In 1;Object;-1;10;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;8;FLOAT;0;False;9;FLOAT;0;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.FunctionSwitch;259;656,0;Inherit;False;Apply
  116. Exposure;True;1;2;-1;In 0;In 1;Instance;258;10;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;8;FLOAT;0;False;9;FLOAT;0;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.CustomExpressionNode;188;-1338.572,178.5896;Inherit;False;#if
  117. defined( DIRLIGHTMAP_COMBINED ) && ( defined( SHADER_STAGE_FRAGMENT ) || defined(
  118. SHADER_STAGE_RAY_TRACING ) )$$ #if defined( LIGHTMAP_ON )$ #if defined(
  119. UNITY_DOTS_INSTANCING_ENABLED )$ staticDir = SAMPLE_TEXTURE2D_LIGHTMAP(
  120. unity_LightmapsInd, samplerunity_Lightmaps, staticUV, unity_LightmapIndex.x )@$
  121. #else$ staticDir = SAMPLE_TEXTURE2D_LIGHTMAP( unity_LightmapInd, samplerunity_Lightmap,
  122. staticUV )@$ #endif$ #endif$$ #if defined( DYNAMICLIGHTMAP_ON )$
  123. dynamicDir = SAMPLE_TEXTURE2D_LIGHTMAP( unity_DynamicDirectionality, samplerunity_DynamicLightmap,
  124. dynamicUV )@$ #endif$$#endif;7;Create;4;True;staticUV;FLOAT2;0,0;In;;Inherit;False;True;dynamicUV;FLOAT2;0,0;In;;Inherit;False;True;staticDir;FLOAT4;0,0,0,0;Out;;Inherit;False;True;dynamicDir;FLOAT4;0,0,0,0;Out;;Inherit;False;Sample
  125. Direction Bilinear;False;False;0;;False;5;0;FLOAT;0;False;1;FLOAT2;0,0;False;2;FLOAT2;0,0;False;3;FLOAT4;0,0,0,0;False;4;FLOAT4;0,0,0,0;False;3;FLOAT;0;FLOAT4;4;FLOAT4;5\nNode;AmplifyShaderEditor.FunctionOutput;0;1901.405,-499.9456;Inherit;False;True;-1;Lighting;0;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0\nNode;AmplifyShaderEditor.FunctionOutput;178;1904.03,-333.0743;Inherit;False;False;-1;Back
  126. Lighting;1;False;1;0;COLOR;0,0,0,0;False;1;COLOR;0\nWireConnection;15;1;17;0\nWireConnection;15;0;18;0\nWireConnection;20;0;13;0\nWireConnection;20;3;13;0\nWireConnection;20;1;19;0\nWireConnection;20;2;13;0\nWireConnection;101;0;20;0\nWireConnection;55;0;54;0\nWireConnection;62;0;61;0\nWireConnection;13;1;15;0\nWireConnection;13;0;16;0\nWireConnection;211;0;213;0\nWireConnection;211;3;213;0\nWireConnection;211;1;215;0\nWireConnection;211;2;215;0\nWireConnection;210;0;213;0\nWireConnection;210;3;213;0\nWireConnection;210;1;216;0\nWireConnection;210;2;216;0\nWireConnection;216;0;258;0\nWireConnection;213;0;226;0\nWireConnection;215;0;259;0\nWireConnection;204;99;232;0\nWireConnection;204;198;205;34\nWireConnection;204;199;205;54\nWireConnection;205;5;208;0\nWireConnection;205;55;218;2\nWireConnection;203;0;201;0\nWireConnection;203;1;202;0\nWireConnection;203;7;201;1\nWireConnection;230;0;201;0\nWireConnection;232;0;230;0\nWireConnection;237;5;235;0\nWireConnection;237;55;234;2\nWireConnection;233;99;240;0\nWireConnection;233;198;237;34\nWireConnection;233;199;237;54\nWireConnection;240;0;239;0\nWireConnection;219;0;221;0\nWireConnection;219;1;220;0\nWireConnection;219;7;246;0\nWireConnection;239;0;221;0\nWireConnection;243;0;209;0\nWireConnection;226;1;243;0\nWireConnection;226;0;244;0\nWireConnection;209;0;203;0\nWireConnection;209;1;204;86\nWireConnection;238;0;219;0\nWireConnection;238;1;233;86\nWireConnection;244;3;243;0\nWireConnection;244;2;238;0\nWireConnection;244;4;225;0\nWireConnection;67;0;71;0\nWireConnection;170;0;245;0\nWireConnection;245;0;71;0\nWireConnection;71;0;168;0\nWireConnection;246;0;201;1\nWireConnection;191;0;188;4\nWireConnection;191;1;192;4\nWireConnection;249;0;188;5\nWireConnection;249;1;192;5\nWireConnection;195;0;153;6\nWireConnection;195;1;194;6\nWireConnection;196;0;153;7\nWireConnection;196;1;194;7\nWireConnection;192;1;189;0\nWireConnection;192;2;190;0\nWireConnection;194;1;167;0\nWireConnection;194;2;173;0\nWireConnection;194;3;174;0\nWireConnection;194;4;175;0\nWireConnection;194;7;176;0\nWireConnection;194;8;191;0\nWireConnection;194;9;249;0\nWireConnection;153;1;167;0\nWireConnection;153;2;173;0\nWireConnection;153;3;174;0\nWireConnection;153;4;175;0\nWireConnection;153;7;176;0\nWireConnection;153;8;191;0\nWireConnection;153;9;249;0\nWireConnection;255;0;254;0\nWireConnection;255;1;196;0\nWireConnection;256;0;195;0\nWireConnection;256;1;254;0\nWireConnection;258;0;195;0\nWireConnection;258;1;256;0\nWireConnection;259;0;196;0\nWireConnection;259;1;255;0\nWireConnection;188;1;189;0\nWireConnection;188;2;190;0\nWireConnection;0;0;210;0\nWireConnection;178;0;211;0\nASEEND*/\n//CHKSM=5237DBE3894DE513CDED35E76CA481E3C597BEEF"
  127. m_functionName:
  128. m_description: 'Sample lightmap. '
  129. m_additionalIncludes:
  130. m_additionalIncludes: []
  131. m_outsideIncludes: []
  132. m_additionalPragmas:
  133. m_additionalPragmas: []
  134. m_outsidePragmas: []
  135. m_additionalDirectives:
  136. m_validData: 0
  137. m_isDirty: 1
  138. m_moduleName: ' Additional Directives'
  139. m_independentModule: 1
  140. m_customEdited: 0
  141. m_additionalDirectives:
  142. - {fileID: 0}
  143. - {fileID: 0}
  144. - {fileID: 0}
  145. m_shaderFunctionDirectives: []
  146. m_nativeDirectives: []
  147. m_nativeDirectivesIndex: -1
  148. m_nativeDirectivesFoldout: 0
  149. m_directivesSaveItems:
  150. - LineType: 2
  151. LineValue: multi_compile _ LIGHTMAP_ON
  152. GUIDToggle: 0
  153. GUIDValue:
  154. ShowConditionals: 0
  155. VersionMin: 0
  156. VersionMax: 0
  157. Passes:
  158. Origin: 2
  159. - LineType: 2
  160. LineValue: multi_compile _ DYNAMICLIGHTMAP_ON
  161. GUIDToggle: 0
  162. GUIDValue:
  163. ShowConditionals: 0
  164. VersionMin: 0
  165. VersionMax: 0
  166. Passes:
  167. Origin: 2
  168. - LineType: 2
  169. LineValue: multi_compile _ DIRLIGHTMAP_COMBINED
  170. GUIDToggle: 0
  171. GUIDValue:
  172. ShowConditionals: 0
  173. VersionMin: 0
  174. VersionMax: 0
  175. Passes:
  176. Origin: 2
  177. m_nodeCategory: 3
  178. m_headerStyle: 1
  179. m_headerColor: {r: 1, g: 0.4, b: 0, a: 1}
  180. m_customNodeCategory:
  181. m_previewPosition: 0
  182. m_hidden: 0
  183. m_url: