Sign in to follow this  

Post screen problem in RenderMonkey 1.71

This topic is 3669 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been reading Shader Programming for Game Programming and Artists, and have reached the chapter on screen effects. I am trying to write a HLSL shader that renders a textured teapot to a textured quad for further processing. However, all I get is a black screen. The pass which renders the teapot works fine. I have added a Renderable Texture, a ScreenAlignedQuad, a RenderTarget, and have written the appropriate vertex and pixel shaders as shown in the book. There are no problems with compilation. I have even substituted code from the final pass of the MotionBlur.rfx example, but nothing seems to work. This is really frustrating. Can anyone suggest what I might be missing?

Share this post


Link to post
Share on other sites
Vertex Shader:
float fInverseViewportWidth;
float fInverseViewportHeight;


struct VS_OUTPUT
{
float4 Pos : POSITION0;
float2 texCoord : TEXCOORD0;

};

VS_OUTPUT vs_main( float4 Pos : POSITION)
{
VS_OUTPUT Out;

Out.Pos = float4(Pos.xy, 0, 1);
Out.texCoord.x = 0.5 * (1 + Pos.x - fInverseViewportWidth);
Out.texCoord.y = 0.5 * (1 - Pos.y - fInverseViewportHeight);

return( Out );

}



Pixel Shader:
sampler Texture0;

float4 ps_main(float2 texCoord : TEXCOORD0) : COLOR0
{
return tex2D(Texture0, texCoord);
}

Share this post


Link to post
Share on other sites

This topic is 3669 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this