![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
unity shader
学者(cloudea)
写前后端就图一乐 算法才是生活
展开
-
unity shader 单层折射
效果:Shader "Unlit/refract"{ Properties { _MainTex ("Texture", 2D) = "white" {} _Cube("Cube", Cube) = "_Skybox"{} _RefractColor("折射颜色", Color) = (1,1,1,1) _Refract("折射度", Rang原创 2019-01-08 11:24:12 · 427 阅读 · 0 评论 -
unity shader 反射贴图
Shader "Unlit/reflex"{ Properties { _MainTex ("Texture", 2D) = "white" {} _Cube("Cube", Cube) = "_Skybox"{} _Relect("反射度", Range(0, 1)) = 1.0 } SubShader { Tags { "RenderType&q原创 2019-01-07 12:01:08 · 1513 阅读 · 0 评论 -
unity shader 自定义shadowcaster基础写法
pass { Tags{ "LightMode" = "ShadowCaster" } CGPROGRAM#pragma vertex vert#pragma fragment frag#pragma multi_compile_shadowcaster#include "UnityCG.cginc" struct v2f { float4 pos:SV_PO...原创 2019-01-17 16:45:44 · 2946 阅读 · 2 评论 -
unity shader 较完整光照(含有多光源阴影)
效果图:shader被附给了球。灯光需要在属性面板开启阴影。// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'Shader "Unlit/lightFull"{ Properties { _MainTex ("Texture", 2D) = "white" {}...原创 2019-01-07 09:58:24 · 6170 阅读 · 23 评论 -
unity shader 玻璃效果 折射效果
Shader "Unlit/render_reflect"{ Properties { _MainTex ("Texture", 2D) = "white" {} } SubShader { Tags {"Queue" = "Transparent" "RenderType"="Opaque" } LOD 100 GrabPass{&quo原创 2019-01-11 11:15:07 · 4021 阅读 · 6 评论 -
unity shader 普通物体接受阴影
Shader "Unlit/shadow"{ Properties { _MainTex ("Texture", 2D) = "white" {} } SubShader { Tags { "RenderType"="Opaque" } LOD 100 Pass { Tags{"LightMode" = "ForwardBase&quo原创 2018-12-31 21:08:57 · 3973 阅读 · 1 评论 -
unity shader 透明的描边效果 镂空描边 空心描边
效果:代码:// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'// Upgrade NOTE: replac...原创 2018-12-31 19:01:07 · 3685 阅读 · 0 评论 -
unity shader 双面透明
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'Shader "Custom/Alpha" { Properties { _UV("贴图", 2D) = "White"{} _Alpha("透明度", Range(0,1)) = 0.5 } SubShader{ ...原创 2018-12-30 16:04:53 · 1418 阅读 · 0 评论