Unity3D 脚本:Unity3D 车身与玻璃材质
Posted on 2013 年 01 月 21 日 by U3d / Unity3D 脚本/插件/被围观 279 次
玻璃 shader:
Shader "Reflective/Glass" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1)
_Shininess ("Shininess", Range (0.01, 1)) = 0.078125
_ReflectColor ("Reflect Strength", Color) = (1,1,1,0.5)
_MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {}
_Parallax ("Height", Range (0.005, 0.08)) = 0.02
_Cube ("Reflection Cubemap", Cube) = "_Skybox" { TexGen CubeReflect }
}
SubShader
{
LOD 300
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
Blend one OneMinusDstColor
ZWrite Off
// First pass does reflection cubemap
Pass
{
Name "BASE"
Tags {"LightMode" = "Always"}
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_fog_exp2
#pragma fragmentoption ARB_precision_hint_fastest
#include "UnityCG.cginc"
struct v2f {
V2F_POS_FOG;