Jump to content
  • Advertisement
Sign in to follow this  

Colors flipped in image

This topic is 3145 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 have no idea what's causing this. Left is the photoshop image, right is the image rendered in-game with DirectX it's not two images one on top of the other, it's the same image. The colors of the rectangle are flipped for some reason. http://img42.yfrog.com/img42/3006/wtfcw.png Any idea as to what may be causing this? Thanks.

Share this post

Link to post
Share on other sites
Thats because DirectX uses a different texture coordinates system.

Try this in your vertex shader:

//set vertex shader out texture coordinates
vOut.texC = vIn.texC;
//inverse y value of texture coordinates
vout.texC.y = (1 - vOut.texC.y);

Share this post

Link to post
Share on other sites
I don't think I am using any vertex shaders :S. I am using ID3DXSprite in case it's related.

Edit: solved, for some reason I didn't notice that everything was flipped not just the blue rectangle, sorry.

Though now I am a little confused. Is bottom supposed to be the greater value and top the smaller one?

void direct3d::set_view()
D3DXMATRIX matrix;

0, 2000,
0, 1);
d3d_device->SetTransform(D3DTS_PROJECTION, &matrix);

[Edited by - Antonym on May 1, 2010 5:58:09 PM]

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!