Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Wrong colour in textures

This topic is 6118 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 am having some problems with the colours in my textures coming up wrong. In the image below the stripes and numbers are drawn using the texture, as is the red of the car body. While the red shows up fine, the stripes and numbers should be the same shade of blue as the fins. This is the code that selects the texture for rendering:
	if (pTexture != NULL)
		pDevice->SetTextureStageState (0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
		pDevice->SetTexture (0, pTexture);
		pDevice->SetTextureStageState (0, D3DTSS_COLORARG1, D3DTA_DIFFUSE);
		pDevice->SetTexture (0, NULL);
This is my vertex:
struct imBasicVertex
    float x, y, z;
    float nx, ny, nz;
	DWORD Colour;
	float u,v;

At one point when I turned off lighting the texture would go to it's correct colour, but now it doesn't anymore. Anyone got any ideas? Could it possibly be blending with the diffuse of the vertices when it should be using texture (although I don't know how to stop it doing that if it is)? In this case the vertices under that texture have a red diffuse colour. [edit]I just realised that bad blending probably isn't the problem because I've only just modified my vertices to hold diffuse information yesterday, and this was happening well before then when the vertices didn't have diffuse information.[/edit] -------------------- Never eat anything bigger than your own head. Edited by - Biggles on November 16, 2001 1:05:50 AM Edited by - Biggles on November 16, 2001 1:09:57 AM

Share this post

Link to post
Share on other sites
You are specifying COLORARG1, but not how to use it. Try adding:

pDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);

This will insure that no blending is taking place. Maybe you are selecting a different OP somewhere else in your code?

Share this post

Link to post
Share on other sites

  • 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!