首页 > 代码库 > 顶点纹理shader
顶点纹理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" }
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。