zoukankan      html  css  js  c++  java
  • Unity3d《Shader篇》变胖

    变胖前

    变胖后

    //Shader

    Shader "Custom/NormalExt"
    {
    	Properties
    	{
    		_MainTex("Base (RGB)", 2D ) = "white"{}
    		_Dis("Distance", Range(0.0,0.8)) = 0.1
    	}
    	
    	SubShader
    	{
    		Tags { "RenderType" = "Opaque" }
    	
    		CGPROGRAM
    		
    		
    		#pragma surface surf Lambert vertex:vert
    		
    		sampler2D _MainTex;
    		float _Dis;
    		
    		struct Input{
    			float2 uv_MainTex;
    		};
    		
    		
    		
    		void vert(inout appdata_full v)
    		{
    			v.vertex.xyz+=v.normal*_Dis;
    		}
    		
    		void surf(Input IN, inout SurfaceOutput o)
    		{
    			o.Albedo = tex2D(_MainTex,IN.uv_MainTex);
    		}
    		
    		ENDCG
    	}
    	FallBack "Diffuse"
    }
    

      

  • 相关阅读:
    BOM-DOM
    JavaScript
    CSS(2)
    CSS(1)
    HTML5
    索引
    数据库多表查询
    数据操作
    数据库表操作
    初识Java
  • 原文地址:https://www.cnblogs.com/mrblue/p/4609859.html
Copyright © 2011-2022 走看看