位置: 编程技术 - 正文

unity3d游戏开发之简单的透明shader技能培训(Unity3D游戏开发培训课程大纲)

编辑:rootadmin

推荐整理分享unity3d游戏开发之简单的透明shader技能培训(Unity3D游戏开发培训课程大纲),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:Unity3D游戏开发培训课程大纲,Unity3D游戏开发毕业论文,unity3D游戏开发,Unity3D游戏开发(第2版)pdf,unity3D游戏开发,Unity3D游戏开发毕业论文,Unity3D游戏开发标准教程,Unity3D游戏开发标准教程,内容如对您有帮助,希望把文章链接给更多的朋友!

下面我们开始今天的Unity3D游戏开发技能透明shader技能培训。 我们学习Unity3D培训目标:让U3D初学者可以更快速的掌握U3D技术,自行制作修改素材,可以独立完成2D、3D小规模游戏及网页游戏开发。

unity3d游戏开发之简单的透明shader技能培训(Unity3D游戏开发培训课程大纲)

[plain] view plaincopy

// Shader created with Shader Forge Beta 0. // Shader Forge (c) Joachim Holmer - // Note: Manually altering this data may prevent you from opening it in Shader Forge /*SF_DATA;ver:0.;sub:START;pass:START;ps:flbk:,lico:1,lgpr:1,nrmq:1,limd:1,uamb:True,mssp:True,lmpd:False,lprd:False,enco:False,frtr:True,vitr:True,dbil:False,rmgx:True,rpth:0,hqsc:True,hqlp:False,blpr:1,bsrc:3,bdst:7,culm:0,dpts:2,wrdp:False,ufog:True,aust:True,igpj:True,qofs:0,qpre:3,rntp:2,fgom:False,fgoc:False,fgod:False,fgor:False,fgmd:0,fgcr:0.5,fgcg:0.5,fgcb:0.5,fgca:1,fgde:0.,fgrn:0,fgrf:,ofsf:0,ofsu:0,f2p0:False;n:type:ShaderForge.SFN_Final,id:3,x:,y:|diff--RGB,alpha--OUT;n:type:ShaderForge.SFN_Fresnel,id:,x:,y:;n:type:ShaderForge.SFN_Color,id:,x:,y:,ptlb:Color,ptin:_Color,glob:False,c1:1,c2:1,c3:1,c4:1;proporder:;pass:END;sub:END;*/ Shader "Custom/Shader1" { Properties { _Color ("Color", Color) = (1,1,1,1) [HideInInspector]_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 } SubShader { Tags { "IgnoreProjector"="True" "Queue"="Transparent" "RenderType"="Transparent" } LOD Pass { Name "ForwardBase" Tags { "LightMode"="ForwardBase" } Blend SrcAlpha OneMinusSrcAlpha ZWrite Off CGPROGRAM #pragma vertex vert #pragma fragment frag #define UNITY_PASS_FORWARDBASE #include "UnityCG.cginc" #pragma multi_compile_fwdbase #pragma exclude_renderers xbox ps3 flash d3d_9x #pragma target 3.0 uniform float4 _LightColor0; uniform float4 _Color; struct VertexInput { float4 vertex : POSITION; float3 normal : NORMAL; }; struct VertexOutput { float4 pos : SV_POSITION; float4 posWorld : TEXCOORD0; float3 normalDir : TEXCOORD1; }; VertexOutput vert (VertexInput v) { VertexOutput o; o.normalDir = mul(float4(v.normal,0), _World2Object).xyz; o.posWorld = mul(_Object2World, v.vertex); o.pos = mul(UNITY_MATRIX_MVP, v.vertex); return o; } fixed4 frag(VertexOutput i) : COLOR { i.normalDir = normalize(i.normalDir); float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz); /////// Normals: float3 normalDirection = i.normalDir; float3 lightDirection = normalize(_WorldSpaceLightPos0.xyz); ////// Lighting: float attenuation = 1; float3 attenColor = attenuation * _LightColor0.xyz; /////// Diffuse: float NdotL = dot( normalDirection, lightDirection ); float3 diffuse = max( 0.0, NdotL) * attenColor &#; UNITY_LIGHTMODEL_AMBIENT.rgb; float3 finalColor = 0; float3 diffuseLight = diffuse; finalColor &#;= diffuseLight * _Color.rgb; /// Final Color: return fixed4(finalColor,(1.0-max(0,dot(normalDirection, viewDirection)))); } ENDCG } Pass { Name "ForwardAdd" Tags { "LightMode"="ForwardAdd" } Blend One One ZWrite Off Fog { Color (0,0,0,0) } CGPROGRAM #pragma vertex vert #pragma fragment frag #define UNITY_PASS_FORWARDADD #include "UnityCG.cginc" #include "AutoLight.cginc" #pragma multi_compile_fwdadd #pragma exclude_renderers xbox ps3 flash d3d_9x #pragma target 3.0 uniform float4 _LightColor0; uniform float4 _Color; struct VertexInput { float4 vertex : POSITION; float3 normal : NORMAL; }; struct VertexOutput { float4 pos : SV_POSITION; float4 posWorld : TEXCOORD0; float3 normalDir : TEXCOORD1; LIGHTING_COORDS(2,3) }; VertexOutput vert (VertexInput v) { VertexOutput o; o.normalDir = mul(float4(v.normal,0), _World2Object).xyz; o.posWorld = mul(_Object2World, v.vertex); o.pos = mul(UNITY_MATRIX_MVP, v.vertex); TRANSFER_VERTEX_TO_FRAGMENT(o) return o; } fixed4 frag(VertexOutput i) : COLOR { i.normalDir = normalize(i.normalDir); float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz); /////// Normals: float3 normalDirection = i.normalDir; float3 lightDirection = normalize(lerp(_WorldSpaceLightPos0.xyz, _WorldSpaceLightPos0.xyz - i.posWorld.xyz,_WorldSpaceLightPos0.w)); ////// Lighting: float attenuation = LIGHT_ATTENUATION(i); float3 attenColor = attenuation * _LightColor0.xyz; /////// Diffuse: float NdotL = dot( normalDirection, lightDirection ); float3 diffuse = max( 0.0, NdotL) * attenColor; float3 finalColor = 0; float3 diffuseLight = diffuse; finalColor &#;= diffuseLight * _Color.rgb; /// Final Color: return fixed4(finalColor * (1.0-max(0,dot(normalDirection, viewDirection))),0); } ENDCG } } FallBack "Diffuse" CustomEditor "ShaderForgeMaterialInspector" }

更多精彩unity3d技术文章请点击

Unity3D游戏开发之实现血条技能培训 喜欢我的博客请记住我的名字:秦元培,我的博客地址是

Unity3D游戏开发之伤害数值显示 喜欢我的博客请记住我的名字:秦元培,我的博客地址是

unity常见问题之题 欢迎来到unity学习、unity培训、unity企业培训教育专区,这里有很多U3D资源、U3D培训视频、U3D教程、U3D常见问题、U3D项目源码,我们致力于打造业内unity3d

标签: Unity3D游戏开发培训课程大纲

本文链接地址:https://www.jiuchutong.com/biancheng/372915.html 转载请保留说明!

上一篇:Unity3D游戏开发之网络游戏服务器架构设计培训(如何做一名主程)(Unity3D游戏开发引擎)

下一篇:Unity3D游戏开发之实现血条技能培训(Unity3D游戏开发pdf)

  • 增值税专用发票的税率是多少啊
  • 借款合同印花税怎么申报
  • 处置固定资产亏了怎么做账
  • 承兑汇票属于货款吗
  • 垃圾袋发票类别是什么
  • 冲红发票怎么写备注
  • 车辆租赁发票税点
  • 外账成本倒推表格
  • 自然人合伙企业怎么交税
  • 二手房屋增值税税率
  • 制造费用包括哪三类
  • 购买原材料的费用
  • 收到某公司发票会计分录
  • 机器维修费的会计科目
  • 安装费发票开具3%税率国税需要备案吗?
  • 哪些发票可以抵扣成本
  • 含税价标志有无影响
  • 以前年度损益调整贷方余额表示什么
  • 金税盘怎么增加复核人
  • 公司办事处人员配置标准最新
  • 外购产品检验流程
  • 项目顾问是什么意思
  • 公司聚餐计入福利费还是招待费
  • 财产租赁所得个人所得税怎么申报
  • 供应商收费标准
  • 纯净版 win10
  • ThinkPHP中SHOW_RUN_TIME不能正常显示运行时间的解决方法 原创
  • 系统托盘无法隐藏文件夹
  • 已计提但未上缴税款
  • 录制权限怎么打开
  • yolov3与yolov2
  • 伊莎贝尔公主
  • php ajax 实现
  • 异常处理流程为哪几个部分
  • 人工智能机器人的好处
  • 存货盘点会计分录怎么做
  • mac m1 安装windows
  • 固定资产清理的借贷方向表示什么
  • 免税后的商品有什么优势?
  • 发票记账联可以给客户吗
  • mysql select语法的使用
  • php用户登录注册源码
  • 入库时的会计分录
  • access数据保存
  • mysql查询并设置变量
  • 月底主营业务成本会计分录
  • 会计中的明细科目是什么
  • 工程项目需要交5000万保证金合理吗
  • 发票清单用什么章
  • 餐饮会计内账怎么记账
  • 购买的电子承兑公司怎么平账做收据
  • 哪些合同不用交社保
  • 房地产企业账务处理所用科目
  • 机关单位工会经费提取比例
  • 购置一项设备,有两种可供选择
  • 国有控股企业股权转让程序
  • 个人支付宝开票一年可以开多少
  • 企业产值什么意思
  • mysql求两个字段的和
  • win2003系统要求
  • 配置windows server 2008
  • linux 的ll
  • freebsd操作命令
  • 重装win7系统后屏幕变小了
  • win8账户锁定无法登录
  • win10系统无法进入
  • node.js的使用
  • js继承怎么实现
  • 命令行批处理文件
  • w10cmd命令高级命令
  • android.intent.extra.text
  • jquery的实现原理
  • getelementbyid isnotafunction
  • Android ViewPager+Fragment滑动选项卡,tab点击选项卡
  • jquery控制元素的显示与隐藏
  • 税务申报显示重名怎么办
  • 云南国家税务网上开票赋码
  • 税务注销后发现报表报错的怎么办
  • 青海的医疗保险费是多少钱
  • 关于抓落实的诗句
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设