• RenderSettings 渲染设置


    在Edit->RenderSettings里设置

    wps1

    Fog: 激活或不激活

    Fog Color:雾的颜色,仅RGB起作用。

    Fog Mode:显示方式

    Linear线性

    Exp指数

    Exp2 指数2

    Fog Density:雾化的强度

    Linear Fog Start:开始距离

    Linear Fog End:结束距离

    Ambient Light:全局光照

    Skybox Material:

    Halo Strength:

    Flate Strength:

    Flare Fade Speed:

    Halo Texture:

    Spot Cookie:

    (2)部分雾化(Shader里面调)

    在需要雾化的Shader里加入代码

    Fog{Mode Linear Color (0.87,0.87,0.87,1) Density 0.1  Range 0,300} 测试代码:

    Shader "Custom/Fog" {  

    Properties { 

          _MainTex ("Texture", 2D) = "white" {} 

          _FogColor ("Fog Color", Color) = (0.3, 0.4, 0.7, 1.0)     } 

        SubShader { 

          Tags { "RenderType" = "Opaque" }       CGPROGRAM 

          #pragma surface surf Lambert finalcolor:mycolor vertex:myvert       struct Input {           float2 uv_MainTex;

    half fog;       }; 

          void myvert (inout appdata_full v, out Input data)       { 

              float4 hpos = mul (UNITY_MATRIX_MVP, v.vertex);           data.fog = min (1, dot (hpos.xy, hpos.xy) * 0.1);       } 

          fixed4 _FogColor; 

          void mycolor (Input IN, SurfaceOutput o, inout fixed4 color)       { 

              fixed3 fogColor = _FogColor.rgb;           #ifdef UNITY_PASS_FORWARDADD           fogColor = 0;           #endif 

              color.rgb = lerp (color.rgb, fogColor, IN.fog);       } 

          sampler2D _MainTex; 

          void surf (Input IN, inout SurfaceOutput o) { 

               o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb;       } 

         ENDCG     }  

        Fallback "Diffuse"   } 

    代码看不懂先保存着以后慢慢看

  • 相关阅读:
    通过python来获取网页状态
    php多域名跳转nginx
    mybatis-plus主键策略
    mybatis-plus ActiveRecord模式
    mybatis-plus-Cud操作
    mybatis-plus高级操作
    mybatis-plus入门
    ☕【Java技术指南】「序列化系列」深入挖掘FST快速序列化压缩内存的利器的特性和原理
    虚拟机研究系列-「GC本质底层机制」SafePoint的深入分析和底层原理探究指南
    👊 Spring技术原理系列(7)带你看看那些可能你还不知道的Spring特性技巧哦!
  • 原文地址:https://www.cnblogs.com/kubll/p/10801217.html
Copyright © 2020-2023  润新知