|
我是初学者在FX Composer中写了一段GPU的程序,把一个物体渲染到了纹理ColorTarget上,但是我想把ColorTarget平铺在屏幕上应该怎样做?
谢谢!
//************************************************************************
float Script : STANDARDSGLOBAL <
string UIWidget = "none";
string ScriptClass = "scene";
string ScriptOrder = "postprocess";
string ScriptOutput = "color";
string Script = "Technique=Main;";
> = 0.8;
float4x4 WorldViewProj : WorldViewProjection;
float4 gClearColor = {0,0,0,0};
float gClearDepth = 1.0;
texture ColorTarget : RENDERCOLORTARGET
<
float2 ViewPortRatio = {1.0,1.0};
int MipLevels = 1;
string Format = "X8R8G8B8" ;
>;
sampler2D ColorTargetSampler = sampler_state {
Texture = <ColorTarget>;
};
void ToTexMain(float3 Pos : POSITION,
float3 normal : NORMAL,
out float4 oPOs : POSITION,
out float4 color : COLOR)
{
oPOs=mul(float4(Pos.xyz,1.0),WorldViewProj);
color=float4(0.2,mul(normal,float3(1,0,0)),0.2,1.0);
}
technique Main <
string Script =
"RenderColorTarget0=;"
"RenderDepthStencilTarget=;"
" ass=MakeShadow;";
> {
pass MakeShadow <
string Script =
"RenderColorTarget0=ColorTarget;"
"ClearSetColor=gClearColor;"
"ClearSetDepth=gClearDepth;"
"Clear=Color;"
"Clear=Depth;"
"Draw=geometry;";>
{
VertexShader = compile vs_3_0 ToTexMain();
}
}
//************************************************************************ |
|