![【原】Shader:Diffuse+CubeMap+LightMap - X-droid - =六道异次元之Ω空间= 【原】Shader:Diffuse+CubeMap+LightMap - X-droid - =六道异次元之Ω空间=](http://img1.ph.126.net/iYWL1KZhesw0OWnx6Tp30Q==/1154891829461007031.jpg)
![【原】Shader:Diffuse+CubeMap+LightMap - X-droid - =六道异次元之Ω空间= 【原】Shader:Diffuse+CubeMap+LightMap - X-droid - =六道异次元之Ω空间=](http://img3.ph.126.net/TtfV4oEmFYNWhM0wl5IrFA==/3080180670161899733.jpg)
![【原】Shader:Diffuse+CubeMap+LightMap - X-droid - =六道异次元之Ω空间= 【原】Shader:Diffuse+CubeMap+LightMap - X-droid - =六道异次元之Ω空间=](http://img9.ph.126.net/WhU4qQhzC74qZQJwLE8kJw==/2585910611057986599.jpg)
Shader "Xdroid/CubeLightmap" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_ReflectColor ("Reflection Color", Color) = (1,1,1,0.5)
_MainTex ("Base (RGB) RefStrength (A)", 2D) = "white" {}
_Cube ("Reflection Cubemap", Cube) = "_Skybox" { TexGen CubeReflect }
_LightMap ("Lightmap (RGB)", 2D) = "lightmap" { LightmapMode }
}
SubShader {
LOD 200
Tags { "RenderType"="Opaque" }
CGPROGRAM
#pragma surface surf Lambert
sampler2D _MainTex;
samplerCUBE _Cube;
sampler2D _LightMap;
fixed4 _Color;
fixed4 _ReflectColor;
struct Input {
float2 uv_MainTex;
float3 worldRefl;
float2 uv2_LightMap;
};
void surf (Input IN, inout SurfaceOutput o) {
fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
fixed4 c = tex * _Color;
o.Albedo = c.rgb;
half4 lm = tex2D(_LightMap,IN.uv2_LightMap);
fixed4 reflcol = texCUBE (_Cube, IN.worldRefl);
reflcol *= tex.a;
o.Emission = lm.rgb * reflcol.rgb * _ReflectColor.rgb;
o.Alpha = reflcol.a * _ReflectColor.a * lm.a;
}
ENDCG
}
FallBack "Reflective/VertexLit"
}