|
|
发表于 2007-12-28 13:28:00
|
显示全部楼层
Re:[求助]alphablend算法问题.
//**************************************************************//
// Effect File exported by RenderMonkey 1.6
//
// - Although many improvements were made to RenderMonkey FX
// file export, there are still situations that may cause
// compilation problems once the file is exported, such as
// occasional naming conflicts for methods, since FX format
// does not support any notions of name spaces. You need to
// try to create workspaces in such a way as to minimize
// potential naming conflicts on export.
//
// - Note that to minimize resulting name collisions in the FX
// file, RenderMonkey will mangle names for passes, shaders
// and function names as necessary to reduce name conflicts.
//**************************************************************//
//--------------------------------------------------------------//
// Screen-AlignedQuad
//--------------------------------------------------------------//
//--------------------------------------------------------------//
// Single Pass
//--------------------------------------------------------------//
string Screen_AlignedQuad_Single_Pass_ScreenAlignedQuad : ModelData = "..\\..\\..\\Program Files\\AMD\\RenderMonkey 1.71\\Examples\\Advanced\\HeatHaze\\ScreenAlignedQuad.3ds";
struct VS_OUTPUT
{
float4 pos : POSITION0;
float2 texCoord : TEXCOORD0;
};
VS_OUTPUT Screen_AlignedQuad_Single_Pass_Vertex_Shader_vs_main( float4 inPos: POSITION )
{
VS_OUTPUT o = (VS_OUTPUT) 0;
inPos.xy = sign( inPos.xy);
o.pos = float4( inPos.xy, 0.0f, 1.0f);
// get into range [0,1]
o.texCoord = (float2(o.pos.x, -o.pos.y) + 1.0f)/2.0f;
return o;
}
texture base_Tex
<
string ResourceName = "..\\..\\..\\Program Files\\AMD\\RenderMonkey 1.71\\Examples\\Media\\Textures\\base.tga";
>;
sampler2D Texture0 = sampler_state
{
Texture = (base_Tex);
ADDRESSU = WRAP;
ADDRESSV = WRAP;
ADDRESSW = WRAP;
MINFILTER = LINEAR;
MIPFILTER = LINEAR;
MAGFILTER = LINEAR;
};
texture tex_Tex
<
string ResourceName = "..\\..\\..\\Program Files\\AMD\\RenderMonkey 1.71\\Examples\\Media\\Textures\\Spotlight.jpg";
>;
sampler2D Texture1 = sampler_state
{
Texture = (tex_Tex);
};
float blend
<
string UIName = "blend";
string UIWidget = "Numeric";
bool UIVisible = false;
float UIMin = 0.00;
float UIMax = 1.00;
> = float( 0.50 );
float4 Screen_AlignedQuad_Single_Pass_Pixel_Shader_ps_main( float2 texCoord : TEXCOORD0 ) : COLOR
{
float4 color1,color2,color;
color1=tex2D( Texture0, texCoord );
color2 = tex2D( Texture1,texCoord );
color = lerp(color1,color2,blend);
return color;
}
//--------------------------------------------------------------//
// Technique Section for Screen-AlignedQuad
//--------------------------------------------------------------//
technique Screen_AlignedQuad
{
pass Single_Pass
{
CULLMODE = NONE;
VertexShader = compile vs_2_0 Screen_AlignedQuad_Single_Pass_Vertex_Shader_vs_main();
PixelShader = compile ps_2_0 Screen_AlignedQuad_Single_Pass_Pixel_Shader_ps_main();
}
}
|
|