Unity Shader 画网格

Unity Shader 画网格_第1张图片

   // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "Unlit/Grid"  
{  
    Properties  
    {  
          _gridColor("网格的颜色",Color) = (0.5,0.5,0.5)  
        _tickWidth("网格的间距",Range(0.01,1)) = 0.1  
        _gridWidth("网格的宽度",Range(0.0001,0.01)) = 0.008      
    }  
    SubShader  
    {  
        //选取Alpha混合方式
        //Blend  SrcAlpha SrcAlpha
        //去掉遮挡和深度缓冲  
        //  Cull Off
        // ZWrite Off  
        //开启深度测试  
        // ZTest Always  
        CGINCLUDE  

    ENDCG  

    Pass  
    { 
        CGPROGRAM  
        //敲代码的时候要注意:“CGPROGRAM”和“#pragma...”中的拼写不同,真不知道“pragma”是什么单词  
        #pragma vertex vert  
       

你可能感兴趣的:(Unity,Shader,Unity3d技巧,VR,unity)