zoukankan      html  css  js  c++  java
  • 顶点纹理shader

        Shader "Custom/VertDisplace" {
                Properties {
                    _MainTex ("Base (RGB)", 2D) = "white" {}
                }
                SubShader {
                    Tags { "RenderType"="Opaque" }
                    LOD 200
                   
                    CGPROGRAM
        // Upgrade NOTE: excluded shader from OpenGL ES 2.0 because it does not contain a surface program or both vertex and fragment programs.
                    #pragma exclude_renderers gles
         
                    #pragma target 3.0
                    #pragma vertex vert
                    #pragma surface surf BlinnPhong
                   
                    sampler2D _MainTex;
             
                    struct Input {
                        float2 uv_MainTex;
                    };
             
                    void vert (inout appdata_full v) {
                        #if !defined(SHADER_API_OPENGL)
                        float4 tex = tex2Dlod (_MainTex, float4(v.texcoord.xy,0,0));
                        v.vertex.z += tex.r * 0.2;
                        #endif
                    }  
                   
                    void surf (Input IN, inout SurfaceOutput o) {
                        half4 tex = tex2D(_MainTex, IN.uv_MainTex);
                        o.Albedo = tex.rgb;
                        o.Alpha = tex.a;
                    }        
                   
                    ENDCG
                }
                FallBack "Diffuse"
            }
  • 相关阅读:
    最近这段时间
    一元多项式的
    珍藏
    运行命令大全
    Google
    Windows Live Writer插件
    Word写论文的技
    安装Windows Live Writer后Ƃ
    比尔盖茨给人
    不经意的感悟
  • 原文地址:https://www.cnblogs.com/softimagewht/p/3765099.html
Copyright © 2011-2022 走看看