位置: 编程技术 - 正文

Unity——通过Shader 制作精灵动画,瀑布(unityshader)

编辑:rootadmin

推荐整理分享Unity——通过Shader 制作精灵动画,瀑布(unityshader),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:unityshader,unityshader,unity-chan,unity如何用,unity通过tag查找物体,unity如何用,unity通过tag查找物体,unityshader,内容如对您有帮助,希望把文章链接给更多的朋友!

//精灵动画

Shader "zhaoguanghui/spriteAction" {

Properties { _MainTex ("Base (RGB)", 2D) = "white" {} _TexWidth ("Sheet Width", float) = 0.0 _CellAmount ("Cell Amount", float) = 0.0 _Speed ("Speed", Range(0., )) = .0 } SubShader { Tags { "RenderType"="Opaque" } LOD CGPROGRAM // Physically based Standard lighting model, and enable shadows on all light types #pragma surface surf Standard fullforwardshadows // Use shader model 3.0 target, to get nicer looking lighting #pragma target 3.0 sampler2D _MainTex; float _TexWidth; float _CellAmount; fixed _Speed; struct Input { float2 uv_MainTex; }; void surf (Input IN, inout SurfaceOutputStandard o) { float2 spriteUV = IN.uv_MainTex; float cellPixelWidth = _TexWidth/_CellAmount; float cellUVPercentage = cellPixelWidth/_TexWidth; float timeVal = fmod(_Time.y * _Speed, _CellAmount); timeVal = ceil(timeVal); float xValue = spriteUV.x; xValue &#;= cellUVPercentage * timeVal * _CellAmount; xValue *= cellUVPercentage; spriteUV = float2(xValue, spriteUV.y); half4 c = tex2D (_MainTex, spriteUV); o.Albedo = c.rgb; o.Alpha = c.a; } ENDCG } FallBack "Diffuse"Unity——通过Shader 制作精灵动画,瀑布(unityshader)

}

//瀑布

Shader "zhaoguanghui/ControlUV" { Properties { _MainTint ("Diffuse Tint", Color) = (1,1,1,1) _MainTex ("Base (RGB)", 2D) = "white" {} _ScrollXSpeed ("X Scroll Speed", Range(0,)) = 2 _ScrollYSpeed ("Y Scroll Speed", Range(0,)) = 2 } SubShader { Tags { "RenderType"="Opaque" } LOD CGPROGRAM // Physically based Standard lighting model, and enable shadows on all light types #pragma surface surf Standard fullforwardshadows // Use shader model 3.0 target, to get nicer looking lighting #pragma target 3.0 fixed4 _MainTint; fixed _ScrollXSpeed; fixed _ScrollYSpeed; sampler2D _MainTex; struct Input { float2 uv_MainTex; }; void surf (Input IN, inout SurfaceOutputStandard o) { fixed2 scrolledUV = IN.uv_MainTex; fixed xScrollValue = _ScrollXSpeed * _Time; fixed yScrollValue = _ScrollYSpeed * _Time; scrolledUV &#;= fixed2(xScrollValue, yScrollValue); half4 c = tex2D (_MainTex, scrolledUV); o.Albedo = c.rgb * _MainTint; o.Alpha = c.a; } ENDCG } FallBack "Diffuse"}

Unity 编辑器下控制播放Animator 在Unity编辑器的Scene视图进行控制播放Animator,可以借助方法StartPlayback、StopPlayback、StartRecording和StopRecording,具体可以参照以下例子:创建一个带Controller

unity 写批量打包工具时遇到的一个问题 上一篇文章解决了打出来的xcode工程不能append的问题(其实这个问题也解决了)。但是根据一些渠道要求是需要替换游戏Icon和SplashImage的,而defaultIcon和M

NullReferenceException: Object reference not set to an instance of an object 初学unity,遇到问题总是忙来忙去半天找不到解决方法,今天又遇到一个比较坑的问题,记录一下。。voidUpdate(){//KeyCode1:if(Input.GetKeyDown(KeyCode.X)){getIdShow(

标签: unityshader

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

上一篇:Unity中Quaternion的含义及其使用(unity中ngui)

下一篇:Unity 编辑器下控制播放Animator(unity 控件)

  • 生育津贴是否需要申报免税所得
  • 房地产企业土地出让金抵减销项税额
  • 企业开办费可不交税吗
  • 社会团体财务手册怎么写
  • 土增税清算地下室怎么扣除
  • 关联交易所得税规定
  • 预收装修款并开发票如何转成本?
  • 收到政府补贴现金流量表怎么填
  • 应付账款多付了会计分录
  • 共同投资叫什么
  • 房地产并购的税率是多少
  • 租赁业务增值税纳税义务发生时间
  • 以前年度加计扣除的税
  • 集团公司内部无偿借贷增值税
  • 资产负债率高说明长期偿债能力强吗
  • 对赌协议的账务处理流程
  • 失联发票进项税额转出
  • 重装系统最好排名
  • 去除页眉的横线快捷方式
  • 企业生产过程中的一个安全问题必须
  • 跨月冲红发票需收回原发票
  • 报考中级会计师证的条件
  • 支付费用没有发票怎么做账务处理
  • 公司收到发票怎么做账
  • php中字符串函数
  • pavfires.exe - pavfires是什么进程 有什么用
  • w10电脑节能模式
  • 出纳借方
  • elements table
  • php实现数据批量导入
  • framework启动
  • thinkphp 模块
  • mount.nfs an incorrect mount
  • 税款已缴纳后发票怎么查
  • 什么是企业管理的首要职能
  • 债权资产包括哪些会计科目
  • 低值易耗品包括哪些
  • 装卸搬运的设备有哪些
  • 收据的种类是有几种
  • mysql1290报错
  • 劳务发票进什么科目
  • 其他应收款的账龄如何计算时间
  • 广告公司工程部
  • 什么是税后利息支出
  • 小规模纳税人转一般纳税人的条件
  • 产权转移书据印花税减免政策
  • 医院收费票据可以入账吗
  • 无形资产摊销方法应反映其经济利益的预期实现方式
  • 哪些业务可以进入共享服务中心
  • 公司有主营业务收入没有主营业务成本
  • 专用发票怎么网上申领
  • 进项票是服务费怎么做会计分录
  • 出纳账户怎么设置
  • 建造合同收入
  • sql server日期相减
  • mysql 5.7.11 winx64安装配置方法图文教程
  • SQL Server中通过扩展存储过程实现数据库的远程备份与恢复
  • mysql5.7.29安装
  • windows8.
  • 如何最简单的
  • windows7的使用期限
  • winxp系统设置密码
  • win7如何彻底删除软件
  • Win10 Mobile RS2预览版WiFi设置页面将和pc页面相同
  • win7中文显示问号
  • icg是什么文件
  • macbookpro屏幕显示
  • git怎么备份
  • 微软 系统设计
  • win10出现恢复界面0xc000000f
  • png批量转换成jpg
  • 游戏开发吧
  • python的数据
  • JavaScript function函数种类详解
  • javascript如何
  • PreferenceActivity与PreferenceFragment应用
  • 化妆品的消费税率为
  • 增值税和消费税申报对比不符怎么处理
  • 税务总局转变税收征管方式
  • 中国十大经济排名
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设