位置: 编程技术 - 正文

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)

  • 主营业务税金及附加大概比例
  • 以现金支付
  • 增值税附加税减免
  • 投资收益包括哪些项目
  • 房产税简易征收的时间
  • 实物投资账务处理
  • 服务收入属于什么会计要素
  • 增值税都有哪些科目
  • 企业销售货物的税率是多少
  • 合作保证金可以退吗
  • 免税和不免税的价格区别
  • 劳务分包异地用预缴税款吗?
  • 资产减值准备所得税申报中要填主表吗
  • 出口退税换汇率多少是正常
  • 职工福利费发票开票范围
  • 工程施工合同暂估价格入账会计分录
  • 小企业财务报表模板免费下载
  • 企业房产税怎么申报缴纳流程
  • 向股东分配股利会影响所有者权益吗
  • 如何玩转win11
  • 内账进项税不设置怎么账务处理
  • 怎么租办公室省钱
  • 原始凭证容易出现错误的原因
  • 阿卡迪亚国家公园景点
  • 未按规定开具发票怎么处罚
  • Android App中DrawerLayout抽屉效果的菜单编写实例
  • php redis常用命令
  • 固定资产清理科目核算内容
  • auto.js 教程
  • opencv教程
  • php如何自学
  • fstrim命令
  • 普通发票可以跨年报销吗
  • 计提工会经费明细表
  • 现金流量表哪些数据和资产负债表一致
  • 持有至到期投资属于流动资产吗
  • mysql数据库高可用方案
  • php命令行模式
  • 生产设备的折旧分录
  • mysql忘了密码
  • 新会计准则有哪三个
  • 增值税普通发票和电子普通发票的区别
  • 公转私户违法吗
  • 工程施工企业收入1750万,利润怎么算
  • 长期借款利息如何计算
  • 代开发票是不是都要扣增值税呢?
  • 营改增后转让土地使用权怎么交增值税
  • 管家婆软件如何做账?
  • 溢价发行可转换债券 利息调整在贷方吗
  • 房地产影响投资和消费,事关民生和发展
  • 公司缴纳社保如何转为个人缴纳
  • 本年利润月末怎么处理
  • 专家咨询费支付标准
  • 餐饮行业招聘方案
  • sql存储过程什么意思
  • Windows10下mysql 5.7.17 安装配置方法图文教程
  • windows预体验版本遇到问题
  • centos6.9关闭防火墙命令
  • 无法进入睡眠状态
  • centos怎么配置yum
  • 此windows副本不是正版黑屏
  • 禁止Windows 打游戏怎么办
  • 怎么修改抖音号
  • linux 使用
  • javascript中循环结构包括
  • linux curl用法
  • 如何让卖家给你乖乖退款
  • bat批处理命令大全
  • 摄像机跟随与摄像的区别
  • unity平移场景视图怎样操作?
  • qt配置opengl
  • windows安装pycharm
  • Unity3D游戏开发标准教程
  • Python 'takes exactly 1 argument (2 given)' Python error
  • 全面解析日本失去的十年
  • 新能源免税申报,车辆类型怎么填
  • 港口的码头用地
  • 光伏电站电力监控系统
  • 江苏国税电子税务局官网
  • 广东省广州市国资委
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设