Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Integrate texture blend with skybox shader

Discussion in 'Shaders' started by MikeyJY, Apr 27, 2020.

  1. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    351
    I found this texture blend shader:
    Code (CSharp):
    1.  Shader "Custom/Texture Blend" {
    2.          Properties {
    3.              _Color ("Color", Color) = (1,1,1,1)
    4.              _Blend ("Texture Blend", Range(0,1)) = 0.0
    5.              _MainTex ("Albedo (RGB)", 2D) = "white" {}
    6.              _MainTex2 ("Albedo 2 (RGB)", 2D) = "white" {}
    7.              _Glossiness ("Smoothness", Range(0,1)) = 0.5
    8.              _Metallic ("Metallic", Range(0,1)) = 0.0
    9.          }
    10.          SubShader {
    11.              Tags { "RenderType"="Opaque" }
    12.              LOD 200
    13.          
    14.              CGPROGRAM
    15.              // Physically based Standard lighting model, and enable shadows on all light types
    16.              #pragma surface surf Standard fullforwardshadows
    17.    
    18.              // Use shader model 3.0 target, to get nicer looking lighting
    19.              #pragma target 3.0
    20.    
    21.              sampler2D _MainTex;
    22.              sampler2D _MainTex2;
    23.    
    24.              struct Input {
    25.                  float2 uv_MainTex;
    26.                  float2 uv_MainTex2;
    27.              };
    28.    
    29.              half _Blend;
    30.              half _Glossiness;
    31.              half _Metallic;
    32.              fixed4 _Color;
    33.    
    34.              void surf (Input IN, inout SurfaceOutputStandard o) {
    35.                  // Albedo comes from a texture tinted by color
    36.                  fixed4 c = lerp (tex2D (_MainTex, IN.uv_MainTex), tex2D (_MainTex2, IN.uv_MainTex2), _Blend) * _Color;
    37.                  o.Albedo = c.rgb;
    38.                  // Metallic and smoothness come from slider variables
    39.                  o.Metallic = _Metallic;
    40.                  o.Smoothness = _Glossiness;
    41.                  o.Alpha = c.a;
    42.              }
    43.              ENDCG
    44.          }
    45.          FallBack "Diffuse"
    46.      }
    I wand to use it with Skybox/6 sided

    upload_2020-4-27_15-25-43.png

    I want to combine the 2 shaders to make one that's lerping between day and night. Also instead of 6 textures as proprieties I want 12:

    Front Day:
    FrontNight:

    BackDay:
    BackNight:

    UpDay:
    UpNight:

    DownDay:
    DownNight:

    LeftDay:
    LeftNight:

    RightDay:
    RightNight:

    I think it is very hard because the 6 sided skybox shader has 830 lines of code.
    Code (CSharp):
    1. // Compiled shader for PC, Mac & Linux Standalone
    2.  
    3. //////////////////////////////////////////////////////////////////////////
    4. //
    5. // NOTE: This is *not* a valid shader file, the contents are provided just
    6. // for information and for debugging purposes only.
    7. //
    8. //////////////////////////////////////////////////////////////////////////
    9. // Skipping shader variants that would not be included into build of current scene.
    10.  
    11. Shader "Skybox/6 Sided" {
    12. Properties {
    13. _Tint ("Tint Color", Color) = (0.500000,0.500000,0.500000,0.500000)
    14. [Gamma]  _Exposure ("Exposure", Range(0.000000,8.000000)) = 1.000000
    15. _Rotation ("Rotation", Range(0.000000,360.000000)) = 0.000000
    16. [NoScaleOffset]  _FrontTex ("Front [+Z]   (HDR)", 2D) = "grey" { }
    17. [NoScaleOffset]  _BackTex ("Back [-Z]   (HDR)", 2D) = "grey" { }
    18. [NoScaleOffset]  _LeftTex ("Left [+X]   (HDR)", 2D) = "grey" { }
    19. [NoScaleOffset]  _RightTex ("Right [-X]   (HDR)", 2D) = "grey" { }
    20. [NoScaleOffset]  _UpTex ("Up [+Y]   (HDR)", 2D) = "grey" { }
    21. [NoScaleOffset]  _DownTex ("Down [-Y]   (HDR)", 2D) = "grey" { }
    22. }
    23. SubShader {
    24. Tags { "QUEUE"="Background" "RenderType"="Background" "PreviewType"="Skybox" }
    25.  
    26.  
    27. // Stats for Vertex shader:
    28. //        d3d11: 12 math
    29. // Stats for Fragment shader:
    30. //        d3d11: 7 math, 1 texture
    31. Pass {
    32.   Tags { "QUEUE"="Background" "RenderType"="Background" "PreviewType"="Skybox" }
    33.   ZWrite Off
    34.   Cull Off
    35.   //////////////////////////////////
    36.   //                              //
    37.   //      Compiled programs       //
    38.   //                              //
    39.   //////////////////////////////////
    40. //////////////////////////////////////////////////////
    41. Global Keywords: <none>
    42. Local Keywords: <none>
    43. -- Hardware tier variant: Tier 1
    44. -- Vertex shader for "d3d11":
    45. // Stats: 12 math, 3 temp registers
    46. Uses vertex data channel "Vertex"
    47. Uses vertex data channel "TexCoord0"
    48.  
    49. Constant Buffer "$Globals" (80 bytes) on slot 0 {
    50.   Float _Rotation at 52
    51. }
    52. Constant Buffer "UnityPerDraw" (176 bytes) on slot 1 {
    53.   Matrix4x4 unity_ObjectToWorld at 0
    54. }
    55. Constant Buffer "UnityPerFrame" (368 bytes) on slot 2 {
    56.   Matrix4x4 unity_MatrixVP at 272
    57. }
    58.  
    59. Shader Disassembly:
    60. //
    61. // Generated by Microsoft (R) D3D Shader Disassembler
    62. //
    63. //
    64. // Input signature:
    65. //
    66. // Name                 Index   Mask Register SysValue  Format   Used
    67. // -------------------- ----- ------ -------- -------- ------- ------
    68. // POSITION                 0   xyzw        0     NONE   float   xyz
    69. // TEXCOORD                 0   xy          1     NONE   float   xy
    70. //
    71. //
    72. // Output signature:
    73. //
    74. // Name                 Index   Mask Register SysValue  Format   Used
    75. // -------------------- ----- ------ -------- -------- ------- ------
    76. // SV_POSITION              0   xyzw        0      POS   float   xyzw
    77. // TEXCOORD                 0   xy          1     NONE   float   xy
    78. //
    79.       vs_4_0
    80.       dcl_constantbuffer CB0[4], immediateIndexed
    81.       dcl_constantbuffer CB1[4], immediateIndexed
    82.       dcl_constantbuffer CB2[21], immediateIndexed
    83.       dcl_input v0.xyz
    84.       dcl_input v1.xy
    85.       dcl_output_siv o0.xyzw, position
    86.       dcl_output o1.xy
    87.       dcl_temps 3
    88.    0: mul r0.x, cb0[3].y, l(0.017453)
    89.    1: sincos r0.x, r1.x, r0.x
    90.    2: mov r2.x, -r0.x
    91.    3: mov r2.y, r1.x
    92.    4: mov r2.z, r0.x
    93.    5: dp2 r0.x, r2.zyzz, v0.xzxx
    94.    6: dp2 r0.y, r2.yxyy, v0.xzxx
    95.    7: mul r1.xyzw, v0.yyyy, cb1[1].xyzw
    96.    8: mad r1.xyzw, cb1[0].xyzw, r0.yyyy, r1.xyzw
    97.    9: mad r0.xyzw, cb1[2].xyzw, r0.xxxx, r1.xyzw
    98.   10: add r0.xyzw, r0.xyzw, cb1[3].xyzw
    99.   11: mul r1.xyzw, r0.yyyy, cb2[18].xyzw
    100.   12: mad r1.xyzw, cb2[17].xyzw, r0.xxxx, r1.xyzw
    101.   13: mad r1.xyzw, cb2[19].xyzw, r0.zzzz, r1.xyzw
    102.   14: mad o0.xyzw, cb2[20].xyzw, r0.wwww, r1.xyzw
    103.   15: mov o1.xy, v1.xyxx
    104.   16: ret
    105. // Approximately 0 instruction slots used
    106.  
    107.  
    108. -- Hardware tier variant: Tier 1
    109. -- Fragment shader for "d3d11":
    110. // Stats: 7 math, 1 temp registers, 1 textures
    111. Set 2D Texture "_FrontTex" to slot 0
    112.  
    113. Constant Buffer "$Globals" (80 bytes) on slot 0 {
    114.   Vector4 _Tint at 32
    115.   Float _Exposure at 48
    116.   Vector4 _FrontTex_HDR at 64
    117. }
    118.  
    119. Shader Disassembly:
    120. //
    121. // Generated by Microsoft (R) D3D Shader Disassembler
    122. //
    123. //
    124. // Input signature:
    125. //
    126. // Name                 Index   Mask Register SysValue  Format   Used
    127. // -------------------- ----- ------ -------- -------- ------- ------
    128. // SV_POSITION              0   xyzw        0      POS   float      
    129. // TEXCOORD                 0   xy          1     NONE   float   xy
    130. //
    131. //
    132. // Output signature:
    133. //
    134. // Name                 Index   Mask Register SysValue  Format   Used
    135. // -------------------- ----- ------ -------- -------- ------- ------
    136. // SV_Target                0   xyzw        0   TARGET   float   xyzw
    137. //
    138.       ps_4_0
    139.       dcl_constantbuffer CB0[5], immediateIndexed
    140.       dcl_sampler s0, mode_default
    141.       dcl_resource_texture2d (float,float,float,float) t0
    142.       dcl_input_ps linear v1.xy
    143.       dcl_output o0.xyzw
    144.       dcl_temps 1
    145.    0: sample r0.xyzw, v1.xyxx, t0.xyzw, s0
    146.    1: add r0.w, r0.w, l(-1.000000)
    147.    2: mad r0.w, cb0[4].w, r0.w, l(1.000000)
    148.    3: mul r0.w, r0.w, cb0[4].x
    149.    4: mul r0.xyz, r0.xyzx, r0.wwww
    150.    5: mul r0.xyz, r0.xyzx, cb0[2].xyzx
    151.    6: mul r0.xyz, r0.xyzx, cb0[3].xxxx
    152.    7: add o0.xyz, r0.xyzx, r0.xyzx
    153.    8: mov o0.w, l(1.000000)
    154.    9: ret
    155. // Approximately 0 instruction slots used
    156.  
    157.  
    158. }
    159.  
    160.  
    161. // Stats for Vertex shader:
    162. //        d3d11: 12 math
    163. // Stats for Fragment shader:
    164. //        d3d11: 7 math, 1 texture
    165. Pass {
    166.   Tags { "QUEUE"="Background" "RenderType"="Background" "PreviewType"="Skybox" }
    167.   ZWrite Off
    168.   Cull Off
    169.   //////////////////////////////////
    170.   //                              //
    171.   //      Compiled programs       //
    172.   //                              //
    173.   //////////////////////////////////
    174. //////////////////////////////////////////////////////
    175. Global Keywords: <none>
    176. Local Keywords: <none>
    177. -- Hardware tier variant: Tier 1
    178. -- Vertex shader for "d3d11":
    179. // Stats: 12 math, 3 temp registers
    180. Uses vertex data channel "Vertex"
    181. Uses vertex data channel "TexCoord0"
    182.  
    183. Constant Buffer "$Globals" (80 bytes) on slot 0 {
    184.   Float _Rotation at 52
    185. }
    186. Constant Buffer "UnityPerDraw" (176 bytes) on slot 1 {
    187.   Matrix4x4 unity_ObjectToWorld at 0
    188. }
    189. Constant Buffer "UnityPerFrame" (368 bytes) on slot 2 {
    190.   Matrix4x4 unity_MatrixVP at 272
    191. }
    192.  
    193. Shader Disassembly:
    194. //
    195. // Generated by Microsoft (R) D3D Shader Disassembler
    196. //
    197. //
    198. // Input signature:
    199. //
    200. // Name                 Index   Mask Register SysValue  Format   Used
    201. // -------------------- ----- ------ -------- -------- ------- ------
    202. // POSITION                 0   xyzw        0     NONE   float   xyz
    203. // TEXCOORD                 0   xy          1     NONE   float   xy
    204. //
    205. //
    206. // Output signature:
    207. //
    208. // Name                 Index   Mask Register SysValue  Format   Used
    209. // -------------------- ----- ------ -------- -------- ------- ------
    210. // SV_POSITION              0   xyzw        0      POS   float   xyzw
    211. // TEXCOORD                 0   xy          1     NONE   float   xy
    212. //
    213.       vs_4_0
    214.       dcl_constantbuffer CB0[4], immediateIndexed
    215.       dcl_constantbuffer CB1[4], immediateIndexed
    216.       dcl_constantbuffer CB2[21], immediateIndexed
    217.       dcl_input v0.xyz
    218.       dcl_input v1.xy
    219.       dcl_output_siv o0.xyzw, position
    220.       dcl_output o1.xy
    221.       dcl_temps 3
    222.    0: mul r0.x, cb0[3].y, l(0.017453)
    223.    1: sincos r0.x, r1.x, r0.x
    224.    2: mov r2.x, -r0.x
    225.    3: mov r2.y, r1.x
    226.    4: mov r2.z, r0.x
    227.    5: dp2 r0.x, r2.zyzz, v0.xzxx
    228.    6: dp2 r0.y, r2.yxyy, v0.xzxx
    229.    7: mul r1.xyzw, v0.yyyy, cb1[1].xyzw
    230.    8: mad r1.xyzw, cb1[0].xyzw, r0.yyyy, r1.xyzw
    231.    9: mad r0.xyzw, cb1[2].xyzw, r0.xxxx, r1.xyzw
    232.   10: add r0.xyzw, r0.xyzw, cb1[3].xyzw
    233.   11: mul r1.xyzw, r0.yyyy, cb2[18].xyzw
    234.   12: mad r1.xyzw, cb2[17].xyzw, r0.xxxx, r1.xyzw
    235.   13: mad r1.xyzw, cb2[19].xyzw, r0.zzzz, r1.xyzw
    236.   14: mad o0.xyzw, cb2[20].xyzw, r0.wwww, r1.xyzw
    237.   15: mov o1.xy, v1.xyxx
    238.   16: ret
    239. // Approximately 0 instruction slots used
    240.  
    241.  
    242. -- Hardware tier variant: Tier 1
    243. -- Fragment shader for "d3d11":
    244. // Stats: 7 math, 1 temp registers, 1 textures
    245. Set 2D Texture "_BackTex" to slot 0
    246.  
    247. Constant Buffer "$Globals" (80 bytes) on slot 0 {
    248.   Vector4 _Tint at 32
    249.   Float _Exposure at 48
    250.   Vector4 _BackTex_HDR at 64
    251. }
    252.  
    253. Shader Disassembly:
    254. //
    255. // Generated by Microsoft (R) D3D Shader Disassembler
    256. //
    257. //
    258. // Input signature:
    259. //
    260. // Name                 Index   Mask Register SysValue  Format   Used
    261. // -------------------- ----- ------ -------- -------- ------- ------
    262. // SV_POSITION              0   xyzw        0      POS   float      
    263. // TEXCOORD                 0   xy          1     NONE   float   xy
    264. //
    265. //
    266. // Output signature:
    267. //
    268. // Name                 Index   Mask Register SysValue  Format   Used
    269. // -------------------- ----- ------ -------- -------- ------- ------
    270. // SV_Target                0   xyzw        0   TARGET   float   xyzw
    271. //
    272.       ps_4_0
    273.       dcl_constantbuffer CB0[5], immediateIndexed
    274.       dcl_sampler s0, mode_default
    275.       dcl_resource_texture2d (float,float,float,float) t0
    276.       dcl_input_ps linear v1.xy
    277.       dcl_output o0.xyzw
    278.       dcl_temps 1
    279.    0: sample r0.xyzw, v1.xyxx, t0.xyzw, s0
    280.    1: add r0.w, r0.w, l(-1.000000)
    281.    2: mad r0.w, cb0[4].w, r0.w, l(1.000000)
    282.    3: mul r0.w, r0.w, cb0[4].x
    283.    4: mul r0.xyz, r0.xyzx, r0.wwww
    284.    5: mul r0.xyz, r0.xyzx, cb0[2].xyzx
    285.    6: mul r0.xyz, r0.xyzx, cb0[3].xxxx
    286.    7: add o0.xyz, r0.xyzx, r0.xyzx
    287.    8: mov o0.w, l(1.000000)
    288.    9: ret
    289. // Approximately 0 instruction slots used
    290.  
    291.  
    292. }
    293.  
    294.  
    295. // Stats for Vertex shader:
    296. //        d3d11: 12 math
    297. // Stats for Fragment shader:
    298. //        d3d11: 7 math, 1 texture
    299. Pass {
    300.   Tags { "QUEUE"="Background" "RenderType"="Background" "PreviewType"="Skybox" }
    301.   ZWrite Off
    302.   Cull Off
    303.   //////////////////////////////////
    304.   //                              //
    305.   //      Compiled programs       //
    306.   //                              //
    307.   //////////////////////////////////
    308. //////////////////////////////////////////////////////
    309. Global Keywords: <none>
    310. Local Keywords: <none>
    311. -- Hardware tier variant: Tier 1
    312. -- Vertex shader for "d3d11":
    313. // Stats: 12 math, 3 temp registers
    314. Uses vertex data channel "Vertex"
    315. Uses vertex data channel "TexCoord0"
    316.  
    317. Constant Buffer "$Globals" (80 bytes) on slot 0 {
    318.   Float _Rotation at 52
    319. }
    320. Constant Buffer "UnityPerDraw" (176 bytes) on slot 1 {
    321.   Matrix4x4 unity_ObjectToWorld at 0
    322. }
    323. Constant Buffer "UnityPerFrame" (368 bytes) on slot 2 {
    324.   Matrix4x4 unity_MatrixVP at 272
    325. }
    326.  
    327. Shader Disassembly:
    328. //
    329. // Generated by Microsoft (R) D3D Shader Disassembler
    330. //
    331. //
    332. // Input signature:
    333. //
    334. // Name                 Index   Mask Register SysValue  Format   Used
    335. // -------------------- ----- ------ -------- -------- ------- ------
    336. // POSITION                 0   xyzw        0     NONE   float   xyz
    337. // TEXCOORD                 0   xy          1     NONE   float   xy
    338. //
    339. //
    340. // Output signature:
    341. //
    342. // Name                 Index   Mask Register SysValue  Format   Used
    343. // -------------------- ----- ------ -------- -------- ------- ------
    344. // SV_POSITION              0   xyzw        0      POS   float   xyzw
    345. // TEXCOORD                 0   xy          1     NONE   float   xy
    346. //
    347.       vs_4_0
    348.       dcl_constantbuffer CB0[4], immediateIndexed
    349.       dcl_constantbuffer CB1[4], immediateIndexed
    350.       dcl_constantbuffer CB2[21], immediateIndexed
    351.       dcl_input v0.xyz
    352.       dcl_input v1.xy
    353.       dcl_output_siv o0.xyzw, position
    354.       dcl_output o1.xy
    355.       dcl_temps 3
    356.    0: mul r0.x, cb0[3].y, l(0.017453)
    357.    1: sincos r0.x, r1.x, r0.x
    358.    2: mov r2.x, -r0.x
    359.    3: mov r2.y, r1.x
    360.    4: mov r2.z, r0.x
    361.    5: dp2 r0.x, r2.zyzz, v0.xzxx
    362.    6: dp2 r0.y, r2.yxyy, v0.xzxx
    363.    7: mul r1.xyzw, v0.yyyy, cb1[1].xyzw
    364.    8: mad r1.xyzw, cb1[0].xyzw, r0.yyyy, r1.xyzw
    365.    9: mad r0.xyzw, cb1[2].xyzw, r0.xxxx, r1.xyzw
    366.   10: add r0.xyzw, r0.xyzw, cb1[3].xyzw
    367.   11: mul r1.xyzw, r0.yyyy, cb2[18].xyzw
    368.   12: mad r1.xyzw, cb2[17].xyzw, r0.xxxx, r1.xyzw
    369.   13: mad r1.xyzw, cb2[19].xyzw, r0.zzzz, r1.xyzw
    370.   14: mad o0.xyzw, cb2[20].xyzw, r0.wwww, r1.xyzw
    371.   15: mov o1.xy, v1.xyxx
    372.   16: ret
    373. // Approximately 0 instruction slots used
    374.  
    375.  
    376. -- Hardware tier variant: Tier 1
    377. -- Fragment shader for "d3d11":
    378. // Stats: 7 math, 1 temp registers, 1 textures
    379. Set 2D Texture "_LeftTex" to slot 0
    380.  
    381. Constant Buffer "$Globals" (80 bytes) on slot 0 {
    382.   Vector4 _Tint at 32
    383.   Float _Exposure at 48
    384.   Vector4 _LeftTex_HDR at 64
    385. }
    386.  
    387. Shader Disassembly:
    388. //
    389. // Generated by Microsoft (R) D3D Shader Disassembler
    390. //
    391. //
    392. // Input signature:
    393. //
    394. // Name                 Index   Mask Register SysValue  Format   Used
    395. // -------------------- ----- ------ -------- -------- ------- ------
    396. // SV_POSITION              0   xyzw        0      POS   float      
    397. // TEXCOORD                 0   xy          1     NONE   float   xy
    398. //
    399. //
    400. // Output signature:
    401. //
    402. // Name                 Index   Mask Register SysValue  Format   Used
    403. // -------------------- ----- ------ -------- -------- ------- ------
    404. // SV_Target                0   xyzw        0   TARGET   float   xyzw
    405. //
    406.       ps_4_0
    407.       dcl_constantbuffer CB0[5], immediateIndexed
    408.       dcl_sampler s0, mode_default
    409.       dcl_resource_texture2d (float,float,float,float) t0
    410.       dcl_input_ps linear v1.xy
    411.       dcl_output o0.xyzw
    412.       dcl_temps 1
    413.    0: sample r0.xyzw, v1.xyxx, t0.xyzw, s0
    414.    1: add r0.w, r0.w, l(-1.000000)
    415.    2: mad r0.w, cb0[4].w, r0.w, l(1.000000)
    416.    3: mul r0.w, r0.w, cb0[4].x
    417.    4: mul r0.xyz, r0.xyzx, r0.wwww
    418.    5: mul r0.xyz, r0.xyzx, cb0[2].xyzx
    419.    6: mul r0.xyz, r0.xyzx, cb0[3].xxxx
    420.    7: add o0.xyz, r0.xyzx, r0.xyzx
    421.    8: mov o0.w, l(1.000000)
    422.    9: ret
    423. // Approximately 0 instruction slots used
    424.  
    425.  
    426. }
    427.  
    428.  
    429. // Stats for Vertex shader:
    430. //        d3d11: 12 math
    431. // Stats for Fragment shader:
    432. //        d3d11: 7 math, 1 texture
    433. Pass {
    434.   Tags { "QUEUE"="Background" "RenderType"="Background" "PreviewType"="Skybox" }
    435.   ZWrite Off
    436.   Cull Off
    437.   //////////////////////////////////
    438.   //                              //
    439.   //      Compiled programs       //
    440.   //                              //
    441.   //////////////////////////////////
    442. //////////////////////////////////////////////////////
    443. Global Keywords: <none>
    444. Local Keywords: <none>
    445. -- Hardware tier variant: Tier 1
    446. -- Vertex shader for "d3d11":
    447. // Stats: 12 math, 3 temp registers
    448. Uses vertex data channel "Vertex"
    449. Uses vertex data channel "TexCoord0"
    450.  
    451. Constant Buffer "$Globals" (80 bytes) on slot 0 {
    452.   Float _Rotation at 52
    453. }
    454. Constant Buffer "UnityPerDraw" (176 bytes) on slot 1 {
    455.   Matrix4x4 unity_ObjectToWorld at 0
    456. }
    457. Constant Buffer "UnityPerFrame" (368 bytes) on slot 2 {
    458.   Matrix4x4 unity_MatrixVP at 272
    459. }
    460.  
    461. Shader Disassembly:
    462. //
    463. // Generated by Microsoft (R) D3D Shader Disassembler
    464. //
    465. //
    466. // Input signature:
    467. //
    468. // Name                 Index   Mask Register SysValue  Format   Used
    469. // -------------------- ----- ------ -------- -------- ------- ------
    470. // POSITION                 0   xyzw        0     NONE   float   xyz
    471. // TEXCOORD                 0   xy          1     NONE   float   xy
    472. //
    473. //
    474. // Output signature:
    475. //
    476. // Name                 Index   Mask Register SysValue  Format   Used
    477. // -------------------- ----- ------ -------- -------- ------- ------
    478. // SV_POSITION              0   xyzw        0      POS   float   xyzw
    479. // TEXCOORD                 0   xy          1     NONE   float   xy
    480. //
    481.       vs_4_0
    482.       dcl_constantbuffer CB0[4], immediateIndexed
    483.       dcl_constantbuffer CB1[4], immediateIndexed
    484.       dcl_constantbuffer CB2[21], immediateIndexed
    485.       dcl_input v0.xyz
    486.       dcl_input v1.xy
    487.       dcl_output_siv o0.xyzw, position
    488.       dcl_output o1.xy
    489.       dcl_temps 3
    490.    0: mul r0.x, cb0[3].y, l(0.017453)
    491.    1: sincos r0.x, r1.x, r0.x
    492.    2: mov r2.x, -r0.x
    493.    3: mov r2.y, r1.x
    494.    4: mov r2.z, r0.x
    495.    5: dp2 r0.x, r2.zyzz, v0.xzxx
    496.    6: dp2 r0.y, r2.yxyy, v0.xzxx
    497.    7: mul r1.xyzw, v0.yyyy, cb1[1].xyzw
    498.    8: mad r1.xyzw, cb1[0].xyzw, r0.yyyy, r1.xyzw
    499.    9: mad r0.xyzw, cb1[2].xyzw, r0.xxxx, r1.xyzw
    500.   10: add r0.xyzw, r0.xyzw, cb1[3].xyzw
    501.   11: mul r1.xyzw, r0.yyyy, cb2[18].xyzw
    502.   12: mad r1.xyzw, cb2[17].xyzw, r0.xxxx, r1.xyzw
    503.   13: mad r1.xyzw, cb2[19].xyzw, r0.zzzz, r1.xyzw
    504.   14: mad o0.xyzw, cb2[20].xyzw, r0.wwww, r1.xyzw
    505.   15: mov o1.xy, v1.xyxx
    506.   16: ret
    507. // Approximately 0 instruction slots used
    508.  
    509.  
    510. -- Hardware tier variant: Tier 1
    511. -- Fragment shader for "d3d11":
    512. // Stats: 7 math, 1 temp registers, 1 textures
    513. Set 2D Texture "_RightTex" to slot 0
    514.  
    515. Constant Buffer "$Globals" (80 bytes) on slot 0 {
    516.   Vector4 _Tint at 32
    517.   Float _Exposure at 48
    518.   Vector4 _RightTex_HDR at 64
    519. }
    520.  
    521. Shader Disassembly:
    522. //
    523. // Generated by Microsoft (R) D3D Shader Disassembler
    524. //
    525. //
    526. // Input signature:
    527. //
    528. // Name                 Index   Mask Register SysValue  Format   Used
    529. // -------------------- ----- ------ -------- -------- ------- ------
    530. // SV_POSITION              0   xyzw        0      POS   float      
    531. // TEXCOORD                 0   xy          1     NONE   float   xy
    532. //
    533. //
    534. // Output signature:
    535. //
    536. // Name                 Index   Mask Register SysValue  Format   Used
    537. // -------------------- ----- ------ -------- -------- ------- ------
    538. // SV_Target                0   xyzw        0   TARGET   float   xyzw
    539. //
    540.       ps_4_0
    541.       dcl_constantbuffer CB0[5], immediateIndexed
    542.       dcl_sampler s0, mode_default
    543.       dcl_resource_texture2d (float,float,float,float) t0
    544.       dcl_input_ps linear v1.xy
    545.       dcl_output o0.xyzw
    546.       dcl_temps 1
    547.    0: sample r0.xyzw, v1.xyxx, t0.xyzw, s0
    548.    1: add r0.w, r0.w, l(-1.000000)
    549.    2: mad r0.w, cb0[4].w, r0.w, l(1.000000)
    550.    3: mul r0.w, r0.w, cb0[4].x
    551.    4: mul r0.xyz, r0.xyzx, r0.wwww
    552.    5: mul r0.xyz, r0.xyzx, cb0[2].xyzx
    553.    6: mul r0.xyz, r0.xyzx, cb0[3].xxxx
    554.    7: add o0.xyz, r0.xyzx, r0.xyzx
    555.    8: mov o0.w, l(1.000000)
    556.    9: ret
    557. // Approximately 0 instruction slots used
    558.  
    559.  
    560. }
    561.  
    562.  
    563. // Stats for Vertex shader:
    564. //        d3d11: 12 math
    565. // Stats for Fragment shader:
    566. //        d3d11: 7 math, 1 texture
    567. Pass {
    568.   Tags { "QUEUE"="Background" "RenderType"="Background" "PreviewType"="Skybox" }
    569.   ZWrite Off
    570.   Cull Off
    571.   //////////////////////////////////
    572.   //                              //
    573.   //      Compiled programs       //
    574.   //                              //
    575.   //////////////////////////////////
    576. //////////////////////////////////////////////////////
    577. Global Keywords: <none>
    578. Local Keywords: <none>
    579. -- Hardware tier variant: Tier 1
    580. -- Vertex shader for "d3d11":
    581. // Stats: 12 math, 3 temp registers
    582. Uses vertex data channel "Vertex"
    583. Uses vertex data channel "TexCoord0"
    584.  
    585. Constant Buffer "$Globals" (80 bytes) on slot 0 {
    586.   Float _Rotation at 52
    587. }
    588. Constant Buffer "UnityPerDraw" (176 bytes) on slot 1 {
    589.   Matrix4x4 unity_ObjectToWorld at 0
    590. }
    591. Constant Buffer "UnityPerFrame" (368 bytes) on slot 2 {
    592.   Matrix4x4 unity_MatrixVP at 272
    593. }
    594.  
    595. Shader Disassembly:
    596. //
    597. // Generated by Microsoft (R) D3D Shader Disassembler
    598. //
    599. //
    600. // Input signature:
    601. //
    602. // Name                 Index   Mask Register SysValue  Format   Used
    603. // -------------------- ----- ------ -------- -------- ------- ------
    604. // POSITION                 0   xyzw        0     NONE   float   xyz
    605. // TEXCOORD                 0   xy          1     NONE   float   xy
    606. //
    607. //
    608. // Output signature:
    609. //
    610. // Name                 Index   Mask Register SysValue  Format   Used
    611. // -------------------- ----- ------ -------- -------- ------- ------
    612. // SV_POSITION              0   xyzw        0      POS   float   xyzw
    613. // TEXCOORD                 0   xy          1     NONE   float   xy
    614. //
    615.       vs_4_0
    616.       dcl_constantbuffer CB0[4], immediateIndexed
    617.       dcl_constantbuffer CB1[4], immediateIndexed
    618.       dcl_constantbuffer CB2[21], immediateIndexed
    619.       dcl_input v0.xyz
    620.       dcl_input v1.xy
    621.       dcl_output_siv o0.xyzw, position
    622.       dcl_output o1.xy
    623.       dcl_temps 3
    624.    0: mul r0.x, cb0[3].y, l(0.017453)
    625.    1: sincos r0.x, r1.x, r0.x
    626.    2: mov r2.x, -r0.x
    627.    3: mov r2.y, r1.x
    628.    4: mov r2.z, r0.x
    629.    5: dp2 r0.x, r2.zyzz, v0.xzxx
    630.    6: dp2 r0.y, r2.yxyy, v0.xzxx
    631.    7: mul r1.xyzw, v0.yyyy, cb1[1].xyzw
    632.    8: mad r1.xyzw, cb1[0].xyzw, r0.yyyy, r1.xyzw
    633.    9: mad r0.xyzw, cb1[2].xyzw, r0.xxxx, r1.xyzw
    634.   10: add r0.xyzw, r0.xyzw, cb1[3].xyzw
    635.   11: mul r1.xyzw, r0.yyyy, cb2[18].xyzw
    636.   12: mad r1.xyzw, cb2[17].xyzw, r0.xxxx, r1.xyzw
    637.   13: mad r1.xyzw, cb2[19].xyzw, r0.zzzz, r1.xyzw
    638.   14: mad o0.xyzw, cb2[20].xyzw, r0.wwww, r1.xyzw
    639.   15: mov o1.xy, v1.xyxx
    640.   16: ret
    641. // Approximately 0 instruction slots used
    642.  
    643.  
    644. -- Hardware tier variant: Tier 1
    645. -- Fragment shader for "d3d11":
    646. // Stats: 7 math, 1 temp registers, 1 textures
    647. Set 2D Texture "_UpTex" to slot 0
    648.  
    649. Constant Buffer "$Globals" (80 bytes) on slot 0 {
    650.   Vector4 _Tint at 32
    651.   Float _Exposure at 48
    652.   Vector4 _UpTex_HDR at 64
    653. }
    654.  
    655. Shader Disassembly:
    656. //
    657. // Generated by Microsoft (R) D3D Shader Disassembler
    658. //
    659. //
    660. // Input signature:
    661. //
    662. // Name                 Index   Mask Register SysValue  Format   Used
    663. // -------------------- ----- ------ -------- -------- ------- ------
    664. // SV_POSITION              0   xyzw        0      POS   float      
    665. // TEXCOORD                 0   xy          1     NONE   float   xy
    666. //
    667. //
    668. // Output signature:
    669. //
    670. // Name                 Index   Mask Register SysValue  Format   Used
    671. // -------------------- ----- ------ -------- -------- ------- ------
    672. // SV_Target                0   xyzw        0   TARGET   float   xyzw
    673. //
    674.       ps_4_0
    675.       dcl_constantbuffer CB0[5], immediateIndexed
    676.       dcl_sampler s0, mode_default
    677.       dcl_resource_texture2d (float,float,float,float) t0
    678.       dcl_input_ps linear v1.xy
    679.       dcl_output o0.xyzw
    680.       dcl_temps 1
    681.    0: sample r0.xyzw, v1.xyxx, t0.xyzw, s0
    682.    1: add r0.w, r0.w, l(-1.000000)
    683.    2: mad r0.w, cb0[4].w, r0.w, l(1.000000)
    684.    3: mul r0.w, r0.w, cb0[4].x
    685.    4: mul r0.xyz, r0.xyzx, r0.wwww
    686.    5: mul r0.xyz, r0.xyzx, cb0[2].xyzx
    687.    6: mul r0.xyz, r0.xyzx, cb0[3].xxxx
    688.    7: add o0.xyz, r0.xyzx, r0.xyzx
    689.    8: mov o0.w, l(1.000000)
    690.    9: ret
    691. // Approximately 0 instruction slots used
    692.  
    693.  
    694. }
    695.  
    696.  
    697. // Stats for Vertex shader:
    698. //        d3d11: 12 math
    699. // Stats for Fragment shader:
    700. //        d3d11: 7 math, 1 texture
    701. Pass {
    702.   Tags { "QUEUE"="Background" "RenderType"="Background" "PreviewType"="Skybox" }
    703.   ZWrite Off
    704.   Cull Off
    705.   //////////////////////////////////
    706.   //                              //
    707.   //      Compiled programs       //
    708.   //                              //
    709.   //////////////////////////////////
    710. //////////////////////////////////////////////////////
    711. Global Keywords: <none>
    712. Local Keywords: <none>
    713. -- Hardware tier variant: Tier 1
    714. -- Vertex shader for "d3d11":
    715. // Stats: 12 math, 3 temp registers
    716. Uses vertex data channel "Vertex"
    717. Uses vertex data channel "TexCoord0"
    718.  
    719. Constant Buffer "$Globals" (80 bytes) on slot 0 {
    720.   Float _Rotation at 52
    721. }
    722. Constant Buffer "UnityPerDraw" (176 bytes) on slot 1 {
    723.   Matrix4x4 unity_ObjectToWorld at 0
    724. }
    725. Constant Buffer "UnityPerFrame" (368 bytes) on slot 2 {
    726.   Matrix4x4 unity_MatrixVP at 272
    727. }
    728.  
    729. Shader Disassembly:
    730. //
    731. // Generated by Microsoft (R) D3D Shader Disassembler
    732. //
    733. //
    734. // Input signature:
    735. //
    736. // Name                 Index   Mask Register SysValue  Format   Used
    737. // -------------------- ----- ------ -------- -------- ------- ------
    738. // POSITION                 0   xyzw        0     NONE   float   xyz
    739. // TEXCOORD                 0   xy          1     NONE   float   xy
    740. //
    741. //
    742. // Output signature:
    743. //
    744. // Name                 Index   Mask Register SysValue  Format   Used
    745. // -------------------- ----- ------ -------- -------- ------- ------
    746. // SV_POSITION              0   xyzw        0      POS   float   xyzw
    747. // TEXCOORD                 0   xy          1     NONE   float   xy
    748. //
    749.       vs_4_0
    750.       dcl_constantbuffer CB0[4], immediateIndexed
    751.       dcl_constantbuffer CB1[4], immediateIndexed
    752.       dcl_constantbuffer CB2[21], immediateIndexed
    753.       dcl_input v0.xyz
    754.       dcl_input v1.xy
    755.       dcl_output_siv o0.xyzw, position
    756.       dcl_output o1.xy
    757.       dcl_temps 3
    758.    0: mul r0.x, cb0[3].y, l(0.017453)
    759.    1: sincos r0.x, r1.x, r0.x
    760.    2: mov r2.x, -r0.x
    761.    3: mov r2.y, r1.x
    762.    4: mov r2.z, r0.x
    763.    5: dp2 r0.x, r2.zyzz, v0.xzxx
    764.    6: dp2 r0.y, r2.yxyy, v0.xzxx
    765.    7: mul r1.xyzw, v0.yyyy, cb1[1].xyzw
    766.    8: mad r1.xyzw, cb1[0].xyzw, r0.yyyy, r1.xyzw
    767.    9: mad r0.xyzw, cb1[2].xyzw, r0.xxxx, r1.xyzw
    768.   10: add r0.xyzw, r0.xyzw, cb1[3].xyzw
    769.   11: mul r1.xyzw, r0.yyyy, cb2[18].xyzw
    770.   12: mad r1.xyzw, cb2[17].xyzw, r0.xxxx, r1.xyzw
    771.   13: mad r1.xyzw, cb2[19].xyzw, r0.zzzz, r1.xyzw
    772.   14: mad o0.xyzw, cb2[20].xyzw, r0.wwww, r1.xyzw
    773.   15: mov o1.xy, v1.xyxx
    774.   16: ret
    775. // Approximately 0 instruction slots used
    776.  
    777.  
    778. -- Hardware tier variant: Tier 1
    779. -- Fragment shader for "d3d11":
    780. // Stats: 7 math, 1 temp registers, 1 textures
    781. Set 2D Texture "_DownTex" to slot 0
    782.  
    783. Constant Buffer "$Globals" (80 bytes) on slot 0 {
    784.   Vector4 _Tint at 32
    785.   Float _Exposure at 48
    786.   Vector4 _DownTex_HDR at 64
    787. }
    788.  
    789. Shader Disassembly:
    790. //
    791. // Generated by Microsoft (R) D3D Shader Disassembler
    792. //
    793. //
    794. // Input signature:
    795. //
    796. // Name                 Index   Mask Register SysValue  Format   Used
    797. // -------------------- ----- ------ -------- -------- ------- ------
    798. // SV_POSITION              0   xyzw        0      POS   float      
    799. // TEXCOORD                 0   xy          1     NONE   float   xy
    800. //
    801. //
    802. // Output signature:
    803. //
    804. // Name                 Index   Mask Register SysValue  Format   Used
    805. // -------------------- ----- ------ -------- -------- ------- ------
    806. // SV_Target                0   xyzw        0   TARGET   float   xyzw
    807. //
    808.       ps_4_0
    809.       dcl_constantbuffer CB0[5], immediateIndexed
    810.       dcl_sampler s0, mode_default
    811.       dcl_resource_texture2d (float,float,float,float) t0
    812.       dcl_input_ps linear v1.xy
    813.       dcl_output o0.xyzw
    814.       dcl_temps 1
    815.    0: sample r0.xyzw, v1.xyxx, t0.xyzw, s0
    816.    1: add r0.w, r0.w, l(-1.000000)
    817.    2: mad r0.w, cb0[4].w, r0.w, l(1.000000)
    818.    3: mul r0.w, r0.w, cb0[4].x
    819.    4: mul r0.xyz, r0.xyzx, r0.wwww
    820.    5: mul r0.xyz, r0.xyzx, cb0[2].xyzx
    821.    6: mul r0.xyz, r0.xyzx, cb0[3].xxxx
    822.    7: add o0.xyz, r0.xyzx, r0.xyzx
    823.    8: mov o0.w, l(1.000000)
    824.    9: ret
    825. // Approximately 0 instruction slots used
    826.  
    827.  
    828. }
    829. }
    830. }
     

    Attached Files:

  2. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    351
unityunity