Browse Source

修改shader

DESKTOP-FB72PO8\Administrator 3 weeks ago
parent
commit
1dc0c3633c

+ 11 - 3
Assets/Art/ParallaxCloud/Material/ParallaxCloud.mat

@@ -44,14 +44,22 @@ Material:
         m_Texture: {fileID: 0}
         m_Scale: {x: 1, y: 1}
         m_Offset: {x: 0, y: 0}
+    - _Turbulence:
+        m_Texture: {fileID: 2800000, guid: 9d4d19dff37532b4da4c3f044ff139c5, type: 3}
+        m_Scale: {x: 14.38, y: 160.44}
+        m_Offset: {x: 0, y: 0}
+    - _TurbulenceTex:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 6.37, y: 2.65}
+        m_Offset: {x: 0, y: 0.76}
     m_Ints: []
     m_Floats:
-    - _Alpha: 0.753
+    - _Alpha: 0.772
     - _AlphaContrast: 0.5
     - _AlphaExtent: 5
     - _MoveSpeed: 0.15
-    - _ParallaxLayers: 12.6
-    - _ParallaxSize: 0.0753
+    - _ParallaxLayers: 40.2
+    - _ParallaxSize: 0.1
     - _ParallaxType: 4
     - _SteepParallax: 1
     - _ViewOffset: 0

+ 8 - 2
Assets/Art/ParallaxCloud/Shader/ParallaxCloud.shader

@@ -10,6 +10,8 @@ Shader "Custom/ParallaxCloud"
         _MoveSpeed ("MoveSpeed:移动速度", Range(-0.5, 0.5)) = 0.1
         _Alpha ("Alpha:透明度", Range(0, 1)) = 0.5
         _AlphaExtent ("AlphaExtent:透明对比度", Range(0.0, 5.0)) = 5.0
+//      _worldDis("云的最远距离", float) = 0
+        _ruiHua("虚化距离", float) = 300
     }
 
     SubShader
@@ -60,6 +62,8 @@ Shader "Custom/ParallaxCloud"
                 half _MoveSpeed;
                 half _Alpha;
                 half _AlphaExtent;
+            // float _worldDis;
+            float _ruiHua;
             CBUFFER_END
 
             TEXTURE2D(_MainTex);
@@ -81,8 +85,10 @@ Shader "Custom/ParallaxCloud"
                 o.nDirWS = TransformObjectToWorldNormal(v.normalOS);
                 o.tDirWS = normalize(TransformObjectToWorld(v.tangent.xyz));
                 o.bDirWS = normalize(cross(o.nDirWS, o.tDirWS) * v.tangent.w);
+                
                 // o.uv.xy = TRANSFORM_TEX(v.uv, _MainTex) + float2(frac(_Time.y * _MoveSpeed), 0.0);
-                o.uv.xy = o.positionWS.xz * 0.06 + float2(frac(_Time.y * _MoveSpeed), 0.0);
+                float2 newUV=o.positionWS.xz*0.06;
+                o.uv.xy =TRANSFORM_TEX( newUV, _MainTex)  + float2(frac(_Time.y * _MoveSpeed), 0.0);
                 o.uv.zw =  o.positionWS.xz * 0.02;
                 o.screenPos = ComputeScreenPos(o.positionCS);
                 return o;
@@ -132,7 +138,7 @@ Shader "Custom/ParallaxCloud"
                 dist = clamp(dist, 0, 1);
 
                 float ptcpos = length(i.positionWS - _WorldSpaceCameraPos);
-                ptcpos = 1 - (ptcpos - 100) / 50;
+                ptcpos = 1 - (ptcpos - 0) / _ruiHua;
                 ptcpos = clamp(ptcpos, 0, 1);
                 //Light mylight = GetMainLight();
                 //half3 light = mylight.color;

File diff suppressed because it is too large
+ 6110 - 49
UserSettings/Layouts/default-2022.dwlt


Some files were not shown because too many files changed in this diff