随笔分类 - Unity3D
摘要:Shader "Unlit/NewUnlitShader" { Properties { _MainTex ("Texture", 2D) = "white" {} _Color("Tint", Color) = (1,1,1,1) _StencilComp("Stencil Comparison", Float) = 8 ...
阅读全文
摘要://CopyComponent
阅读全文
摘要:效果 原理: 开启摄像机的深度模式,将深度保存到一张名为_CameraDepthTexture(Unity5.0之后才有)内置的纹理中. 如果深度在焦点范围内就用原图,否则就用模糊图。 Shader: C#代码
阅读全文
摘要:原理就是将一张rgba 32的分成两张纹理:一张平台压缩不带alpha和一张为原图1/4大小的压缩图存储alpha信息(用r分量当alpha值),然后修改原材质的Shader传入这两张纹理。 代码如下(这个是比较针对我们项目的,你可以自己手动改下) 注意:NGUI的UIPannel裁剪是需要自己手动
阅读全文
摘要:using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.InteropServices; using System.Security.Cryptography.X509Certificates; using System.Text; using...
阅读全文
摘要://预览图 //原理 一个摄像机CullingMask设置只可见"Distortion"的Layer(需要自己手动加),输入到一张RenderTexture,其实就是用于确定哪里要扭曲。 另外一个摄像机CullingMask设置成对除了"Distortion"的Layer可见,并挂上后期效果脚本。
阅读全文
摘要://效果图 //Shader代码
阅读全文
摘要://效果预览 //Shader代码
阅读全文
摘要:Shader "Custom/FlowColor" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} _FlowColor("Flow Color", Color) = (1,1,1,1) _FlowRange("Flow Range", Float) = 0.01 } SubShader { P...
阅读全文
摘要:Intrinsic Functions (DirectX HLSL) The following table lists the intrinsic functions available in HLSL. Each function has a brief description, and a l
阅读全文
摘要:Shader "Custom/RimColor" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} _RimColor("Rim Color", Color) = (1,1,1,1) _RimRang("Rim Range",range(0,1)) = 0.1 } ...
阅读全文
摘要:把脚本挂在摄像机上 创建一个材质,再创建一个Shader
阅读全文
摘要:1、下载protobuf-net 2、创建Unity工程,创建一个Plugins文件夹,将protobuf-net解压把里面得protobuf-net放到Plugins 3、创建一个名为mcs的文本文件,里面写上-unsafe 4、重启Unity 5、编译自动生成cs代码工具 protogen.ex
阅读全文
摘要:Shader "Custom/Snow" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} _RimColor("Rim Color", Color) = (1,1,1,1) _SnowPower ("Snow Power",range(0,1)) = 0.2//边缘强度 ...
阅读全文
摘要:Shader "Custom/NewShader" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} _RimColor("Rim Color", Color) = (1,1,1,1) _RimPower ("Rim power",range(0,5)) = 2//边缘强度...
阅读全文
摘要:这种办法在iOS下是不让用的,只能在Android下用。用起来也很方便了。 1、先创建一个c#工程,引用到的UnityEngine.dll在Unity的安装目录里找吧 2、将编译的dll放入Unity工程,并打成assetBundle。(要把缀名改成.bytes,这个类型Unity才识别,才能打成a
阅读全文
摘要:Animator控制参数和添加事件
阅读全文