Jump to content
  • Advertisement
Sign in to follow this  
Lambdoid

Post screen problem in RenderMonkey 1.71

This topic is 3972 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!