zoukankan      html  css  js  c++  java
  • 滚动光效shader

    Shader "Custom/LightMove" {
    Properties {
    _MainTex ("Base (RGB)", 2D) = "white" {}
    _BumpMap ("BumpMap", 2D) = "bump" {}
    _Shiness ("Base (BA)", 2D) = "white" {}
    _Color("Main Color",Color) = (1,1,1,0)
    _RimPower ("Rim Power", Range(0.5,8.0)) = 3.0
    }
    SubShader {
    Tags { "RenderType"="Opaque" }
    LOD 200
    
    CGPROGRAM
    #pragma surface surf Lambert
    
    
    sampler2D _MainTex;
    sampler2D _BumpMap;
    sampler2D _Shiness;
    float _RimPower;
    fixed4 _Color;
    struct Input {
    float2 uv_MainTex;
    float2 uv_BumpMap;
    float2 uv_Shiness;
    float3 viewDir;
    };
    
    
    void surf (Input IN, inout SurfaceOutput o) {
    float b = IN.uv_Shiness.x + 5 * _Time;
    float2 e = float2(b,IN.uv_Shiness.y);
    half4 c = tex2D (_MainTex, IN.uv_MainTex);
    half4 d = tex2D (_Shiness, e);
    o.Albedo = c.rgb;
    o.Normal = UnpackNormal (tex2D (_BumpMap, IN.uv_BumpMap));
    half rim = 1.0 - saturate(dot (normalize(IN.viewDir), o.Normal));
    o.Emission =d.rgb * _Color.rgb * pow (rim, _RimPower);
    o.Alpha = c.a;
    }
    ENDCG
    } 
    FallBack "Diffuse"
    }
  • 相关阅读:
    BZOJ4569: [Scoi2016]萌萌哒
    BZOJ4566: [Haoi2016]找相同字符
    BZOJ4556: [Tjoi2016&Heoi2016]字符串
    BZOJ4545: DQS的trie
    BZOJ4458: GTY的OJ
    Codeforces Beta Round #19E. Fairy
    不确定性推理
    朴素贝叶斯
    对抗搜索
    struct
  • 原文地址:https://www.cnblogs.com/123ing/p/4080932.html
Copyright © 2011-2022 走看看