Render Target and Color1 help.
by Taylor Petrick · in Torque Game Engine Advanced · 08/27/2009 (9:51 am) · 1 replies
I'm working on some full screen shader stuff, and I can't seem to pull data from Color1.
I'm rendering the fullscreen shader with this:
For testing purposes, I've got a handful of models in the scene that use this in their pixel shader:
When rendering the full screen shader with the texture set as "mSurface[0]", everything works like it should. If I set the texture as "mSurface[1]", however, the screen is entirely black.
Any suggestions?
I'm rendering the fullscreen shader with this:
GFX->pushActiveRenderTarget();
mRenderTarget = GFX->allocRenderToTextureTarget();
mRenderTarget->attachTexture(GFXTextureTarget::Color0, mSurface[0]);
mRenderTarget->attachTexture(GFXTextureTarget::Color1, mSurface[1]);
mRenderTarget->attachTexture(GFXTextureTarget::DepthStencil, GFXTextureTarget::sDefaultDepthStencil);
GFX->setActiveRenderTarget(mRenderTarget);
gClientSceneGraph->renderScene();
GFX->popActiveRenderTarget();
// Pass transforms to shader, create full-screen quad, render//For testing purposes, I've got a handful of models in the scene that use this in their pixel shader:
struct ConnectData
{
float2 texCoord : TEXCOORD0;
};
struct PS_OUTPUT
{
half4 color0 : COLOR0;
half4 color1 : COLOR1;
};
PS_OUTPUT main( ConnectData IN, uniform sampler2D diffuseMap : register(S0))
{
PS_OUTPUT OUT;
OUT.color0 = tex2D( diffuseMap, IN.texCoord );
OUT.color1 = tex2D( diffuseMap, IN.texCoord );
return OUT;
} When rendering the full screen shader with the texture set as "mSurface[0]", everything works like it should. If I set the texture as "mSurface[1]", however, the screen is entirely black.
Any suggestions?
About the author
Torque Owner Taylor Petrick
its hard-coded to handle COLOR0 only.
EDIT:
I applied the fix in this thread:
http://www.garagegames.com/community/forums/viewthread/81651
And now I get a lovely pink screen. Has anyone gotten MRTs working in TGEA?