位置: 编程技术 - 正文

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)

  • 企业清算过程中发生的费用
  • 城市维护建设税优惠政策
  • 建筑业增值税税负预警
  • 出差人员个人原因延迟返回
  • 什么原始凭证可以填写
  • 增值税一般纳税人税率
  • 员工可以签订两份劳动合同吗
  • 存款利息收入需要缴纳所得税吗
  • 每股未分配利润是什么意思
  • 买车支付的车辆购置税怎么入账
  • 期货平仓费用
  • 空调折旧费用科目
  • 自制农产品采摘机器设备
  • 研发废料收入抵研发
  • 期货交易所手续费2023
  • 未缴纳个人所得税承诺书模板
  • 理财产品 会计分录
  • 去国税申请开票需要法人和财务去吗?
  • 农产品发票抵扣需要勾选吗
  • 行政单位租个人房子能用收据下账吗
  • 员工承担补缴社保的责任
  • 生育津贴公司账户怎么维护
  • 企业外购材料的入账价值包括
  • 研发费用的
  • 企业所得税季初人数
  • 新公司值得入职吗
  • 消耗性生物资产是指什么
  • 企业抵押贷款手续办理流程
  • 调整以前年度应付工资怎么调
  • 剑灵2.0win7
  • 餐饮的成本核算表格模板
  • 如何pingip地址
  • 生产经营所得投资者减除费用季度申报填吗
  • 原材料当做废品怎么做
  • i33240配什么主板
  • 在建工程的核算内容和范围是什么
  • 设备租赁费属于固定成本吗
  • 记载资金的账簿印花税的税率是多少
  • 购买车辆的会计分录该怎样做
  • 新注册的外贸公司花名册
  • 结转代销成本
  • 发票打印出来的字太靠下了
  • 固定资产清理销售的收入
  • 接口二次封装
  • 公司提现金用途
  • 全年累计个税扣除公式
  • c++ abort函数
  • 收到抵扣发票怎么做分录
  • python dict.item()方法遍历字典
  • mysql8绿色版
  • 织梦如何做提取卡密
  • 通过法院拍卖取得的土地没有得到执行属于什么案件
  • 扣缴境外公司增值税
  • 未分配利润实际没有钱分配是什么原因
  • 固定资产提前报废当月计提折旧吗
  • 无偿捐赠产品会计分录
  • 应付账款不用付了怎么做账
  • 其他应收款借方负数代表什么意思
  • 应收票据明细表根据什么编制
  • 个人账户打流水需要本人吗
  • 中央空调的维护费一年要多少钱?
  • 财务费用中的利息费用指什么
  • 三证合一怎么看税务登记证
  • 流动比率怎么算出来的
  • 大数据量高并发症有哪些
  • ubuntu的系统设置在哪里
  • ubuntu系统鼠标没反应
  • macbook appstore在哪
  • Linux系统下findmnt命令使用全解
  • mac os 如何备份
  • mac无线打印
  • msdev.exe是什么
  • 两个js文件互相取变量
  • jsp实现ajax
  • 正则表达式/a/g
  • python的特点及应用范围
  • 谈谈我对美国的印象
  • python汉字
  • 前端框架到底是什么
  • 南京国家税务局网上办税服务厅
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设