DirectX HLSL Pixel Shader return values
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: DirectX HLSL Pixel Shader return values

  1. #1
    Join Date
    Dec 2010
    Posts
    2

    Unhappy DirectX HLSL Pixel Shader return values

    hello,
    I'm working on an HLSL shader in an fx file.
    I have my data type set to D3DFMT_A8R8G8B8
    my shader looks like this:

    float4 PS(float2 tex0 : TEXCOORD0, float2 tex1 : TEXCOORD1): COLOR
    {
    float4 ret = float4(0.5,0.5,0.5,0.5);
    }

    On 3 of my machines, when I read this texture back, I get 128,128,128,128
    however on one of my machines, I get 64,64,64,64. I have played around with
    the numbers, and have determined that it's because the alpha is being multiplied by all the other
    values, giving me 0.25,0.25,0.25,0.25 as return values.

    is there some kind of render state or something that I can set to make it not do this?

    it's very strange to me because the card on which this happens is an nVidia 8700M GT,
    but it works properly (ie does not multiply the alpha) on machines with 8800GTX and 7950M GT
    (as well as on my ATI radion 5870)

    does anyone have an idea why this might be happening?
    any help would be appreciated.
    thanks!
    -thomas

  2. #2
    Join Date
    Dec 2010
    Posts
    2

    Re: DirectX HLSL Pixel Shader return values

    I also return ret from the shader. sorry.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center