unity_4LightPosX0

作者:追风剑情 发布于:2014-7-10 23:13 分类:Shader

Shader "Custom/LightPosX0" {
	SubShader {
		Pass {
		Tags { "LightMode"="ForwardBase" }

		CGPROGRAM
		#pragma vertex vert
		#pragma fragment frag
		#pragma multi_compile_fwdbase
		#include "UnityCG.cginc"
		#include "Lighting.cginc"
		struct vertOut {
			float4 pos:SV_POSITION;
			float4 color:COLOR;
		};
		vertOut vert(appdata_base v)
		{
			vertOut o;
			o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
			//场景中的光源位置被限制在(0,1)内,因此可放心作为颜色输出
			o.color = unity_4LightPosX0[0];
			return o;
		}
		float4 frag(vertOut i):COLOR
		{
			return i.color;
		}
		ENDCG
		}
	} 
}

测试结果

Rendering Path: Forward 输出黑色

Rendering Path: Deferred Lighting 输出黑色

Rendering Path: VertexLit 什么也没输出

标签: unity_4LightPosX0

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号