Unreal Tournament 3\Binaries\EditorRes这个下面的做编辑器时就可以复用
Unreal Tournament 3\Engine\Shaders
这个下面的shader能复用吗?
看 SpotLightVertexShader.usf,如下:
/*=============================================================================
SpotLightVertexShader.hlsl: Spot light vertex shader.
Copyright 1998-2007 Epic Games, Inc. All Rights Reserved.
=============================================================================*/
#define NEEDS_LIGHTMAP_COORDINATE STATICLIGHTING_TEXTUREMASK
#include "Common.usf"
#include "Material.usf"
#include "VertexFactory.usf"
float4 LightPositionAndInvRadius; // w = 1.0 / Radius
void Main(
FVertexFactoryInput Input,
#if STATICLIGHTING_VERTEXMASK
float LightMask : BLENDWEIGHT0,
#endif
out FVertexFactoryInterpolants OutFactoryInterpolants,
out float3 OutTangentLightVector : TEXCOORD4,
out float4 OutWorldLightVector : TEXCOORD5,
out float3 OutCameraVector : TEXCOORD6,
out float4 OutScreenPosition : TEXCOORD7,
out float4 OutPosition : POSITION
)
{
float4 WorldPosition = VertexFactoryGetWorldPosition(Input,OutFactoryInterpolants);
OutScreenPosition = OutPosition = MulMatrix(ViewProjectionMatrix,WorldPosition);
float3x3 TangentBasis = VertexFactoryGetTangentBasis(Input);
OutCameraVector = VertexFactoryWorldToTangentSpace(Input,TangentBasis,CameraPosition.xyz - WorldPosition.xyz * CameraPosition.w);
OutTangentLightVector = VertexFactoryWorldToTangentSpace(Input,TangentBasis,LightPositionAndInvRadius.xyz - WorldPosition.xyz);
OutWorldLightVector = float4((LightPositionAndInvRadius.xyz - WorldPosition.xyz) * LightPositionAndInvRadius.w,0);
#if STATICLIGHTING_VERTEXMASK
OutWorldLightVector.w = LightMask;
#endif
}
posted on 2008-01-12 00:31
七星重剑 阅读(1546)
评论(2) 编辑 收藏 引用 所属分类:
Game Engine