Jump to content
  • Advertisement
Sign in to follow this  

Shader Returns Black Screen When Compiling With ps_3_0

This topic is 1162 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'm rendering an image to the screen after processing through a shader. I'm using a very basic shader for testing, to sharpen the output.

sampler2D Texture1Sampler : register(S0);
float Amount : register(C0);
float2 InputSize : register(C1);

float4 main(float2 uv : TEXCOORD) : COLOR
    float2 offset = 1 / InputSize;
    float4 color = tex2D(Texture1Sampler, uv);
    color.rgb += tex2D(Texture1Sampler, uv - offset) * Amount;
    color.rgb -= tex2D(Texture1Sampler, uv + offset) * Amount;
    return color;

It will compile and run perfectly when calling D3DXCompileShaderFromFile with shader model "ps_2_0". If I change the shader model to "ps_3_0", however, it will render a black screen. This shouldn't change anything to the shader or to my code.


Any idea as to what could be going wrong?

Share this post

Link to post
Share on other sites

No, I don't use any vertex shader. Simply running pixel shaders on video frames.


Some people saw flaws in my code in another thread, perhaps this is a random side-effect of one of those flaws.

Share this post

Link to post
Share on other sites
Shader Model 3

If you are implementing shaders in hardware, you may not use vs_3_0 or ps_3_0 with any other shader versions, and you may not use either shader type with the fixed function pipeline.

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!