// Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject'

// Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject'

Shader "Custom/RadarWave" {
Properties {
_Color ("Color", Color) = (,,,)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Glossiness ("Smoothness", Range(,)) = 0.5
_Metallic ("Metallic", Range(,)) = 0.0
_TransVal("Transparency Value", Range(,)) = 0.5
_StripWidth("Strip Width", Range(0.1,)) = 0.2
_Speed("Speed", Range(,)) =
}
SubShader {
Tags { "RenderType"="Opaque" "Queue" = "Transparent" }
LOD
//Cull Off//关闭背面裁剪
//Lighting Off//此设置在surface shader中不起作用,貌似是在Unlit Shader中使用的
//ZWrite On
//ZTest On
Blend SrcAlpha OneMinusSrcAlpha CGPROGRAM
// Physically based Standard lighting model, and enable shadows on all light types
//#pragma surface surf Standard fullforwardshadows alpha vertex:vert
#pragma surface surf NoLightModel fullforwardshadows alpha vertex:vert // Use shader model 3.0 target, to get nicer looking lighting
#pragma target 3.0 sampler2D _MainTex; struct Input {
float2 uv_MainTex;
float4 modelPos_;
}; half _Glossiness;
half _Metallic;
half _TransVal;
half _StripWidth;
half _Speed;
fixed4 _Color; // Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader.
// See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing.
// #pragma instancing_options assumeuniformscaling
UNITY_INSTANCING_CBUFFER_START(Props)
// put more per-instance properties here
UNITY_INSTANCING_CBUFFER_END void surf(Input IN, inout SurfaceOutput o) {
// Albedo comes from a texture tinted by color
fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
o.Albedo = c.rgb;
//float4 tmp = mul(unity_WorldToObject, IN.modelPos_);
if (fmod(floor((IN.modelPos_.z-_Time.y*_Speed)/ _StripWidth),)!=)
{
//clip(-1);
discard;
}
//o.Alpha = c.a;
o.Alpha = _TransVal;
} void vert(inout appdata_full v, out Input o)
{
UNITY_INITIALIZE_OUTPUT(Input, o);
o.modelPos_ = v.vertex;
} //命名规则:Lighting接#pragma suface之后起的名字
//lightDir :点到光源的单位向量 viewDir:点到摄像机的单位向量 atten:衰减系数
float4 LightingNoLightModel(SurfaceOutput s, float3 lightDir, half3 viewDir, half atten)
{
float4 c;
c.rgb = s.Albedo;
c.a = s.Alpha;
return c;
} ENDCG
}
FallBack "Diffuse"
}

Unity关闭shader中的光照模型以及如何自定义光照模型的更多相关文章

  1. [Unity]在Shader中获取摄像机角度、视线的问题

    又踩了一坑,好在谷歌到了之前的一个人遇到相同的问题,顺利解决. 先说说问题背景,我目前的毕设是体数据渲染,实现的办法是raycast.最基本的一点就是在fragment program里,获取rayc ...

  2. Unity Shader入门教程(三)自制光照模型

    光照模型的概念目前还不明晰,因为笔者也是一个初学者,所以请小心对待笔者介绍的内容.笔者认为光照模型是规定光照算法的模型,比如说前面提到的Lambert光照模型,规定了材质表面的光线的表达式为 环境光+ ...

  3. 【Unity Shaders】Shader中的光照

    写在前面 自己写过Vertex & Fragment Shader的童鞋,大概都会对Unity的光照痛恨不已.当然,我相信这是因为我们写得少...不过这也是由于官方文档对这方面介绍很少的缘故, ...

  4. 【Unity Shaders】Diffuse Shading——在Surface Shader中使用properties

    本系列主要参考<Unity Shaders and Effects Cookbook>一书(感谢原书作者),同时会加上一点个人理解或拓展. 这里是本书所有的插图.这里是本书所需的代码和资源 ...

  5. unity, multi pass shader中的surface pass

    今天尝试写一个multi pass shader,但其中有一个Pass是surface pass,总是莫名奇妙地报错.后来看到下面帖子: http://forum.unity3d.com/thread ...

  6. unity, shader中获得当前像素深度

    frag shader中直接访问i.pos.z就是深度,不必除以i.pos.w,因为系统已经自动进行过了透视除法且已将i.pos.w置为0.

  7. 【淡墨Unity3D Shader计划】五 圣诞用品: Unity在Shader三种形式的控制&amp;混合操作编译

    本系列文章由@浅墨_毛星云 出品,转载请注明出处. 文章链接:http://blog.csdn.net/poem_qianmo/article/details/42060963 作者:毛星云(浅墨)  ...

  8. Unity的shader学习1

    先来看一段我们项目常见的Shader代码,这个是Vertex&Fragment shader,目前已经不常用了,不过还是适合我们理解一些基础知识和理解一些比较老的shader 代码.下次我们再 ...

  9. [转] Draw Call未被批处理?告诉你在Unity 5.6中如何查找原因 [复制链接]

    Unity在5.6之前的版本中并未提供很直接的方式来查找Draw Call未被批处理的原因,但Unity 5.6在Frame Debugger中新增了一项功能,帮助开发者查找相关信息.今天这篇文章就为 ...

随机推荐

  1. 【转】使用sonar为你的代码质量保驾护航

    一. 简介Sonar是一个用于代码质量管理的开放平台,相信大家都不会陌生.Sonar可以集成不同的测试工具,代码分析工具,以及持续集成工具.官方网站https://www.sonarqube.org ...

  2. FaceAlignment blog

    https://blog.csdn.net/app_12062011/article/category/7574425 https://www.jianshu.com/p/e4b9317a817f

  3. "android.uid.systemandroid.view.InflateException: Binary XML file line #7: Error inflating class android.webkit.WebView

    在android源码中编译app通过,运行时出现错误: "android.uid.systemandroid.view.InflateException: Binary XML file l ...

  4. elasticsearch系列五:搜索详解(查询建议介绍、Suggester 介绍)

    一.查询建议介绍 1. 查询建议是什么? 查询建议,为用户提供良好的使用体验.主要包括: 拼写检查: 自动建议查询词(自动补全) 拼写检查如图: 自动建议查询词(自动补全): 2. ES中查询建议的A ...

  5. CentOS 6.x安装配置MongoDB 3.4.x

    说明: 操作系统:CentOS 5.X 64位 IP地址:192.168.21.128 实现目的: 安装配置MongoDB数据库 具体操作: 一.关闭SElinux.配置防火墙 1.vi /etc/s ...

  6. C# WinForm下,隐藏主窗体的方法

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  7. http_build_query用法

    http_build_query (PHP 5) http_build_query -- 生成 url-encoded 之后的请求字符串描述string http_build_query ( arra ...

  8. Tomcat域名绑定

    域名绑定与虚拟目录设置: conf/server.xml 的修改方式如下: 单个域名绑定: 原始: <Engine name="Catalina" defaultHost=& ...

  9. Dominoserver 安装

    domino安装及语言包安装 http://wenku.baidu.com/view/f473600d581b6bd97f19ea9b.html dominoserver 安装后启动配置: http: ...

  10. SqlServer2008基础知识:安全与权限

    分享自 儒雅的男人blog http://www.cnblogs.com/yushaoye201314/archive/2013/04/19/3031203.html 好文,转载收藏 这两天在调用Mi ...