color problem

This topic is 4741 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

So here is my problem. I implemented a skydome in my terrain engine, but the colors of the dome are not as expected. for example if I init the diffuse component like this :
vx.diffuse=D3DCOLOR_ARGB(255,255,255,0);

I get a dark green color. My FVF looks like this :
#define D3DFVF_VERTEX (D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE | D3DFVF_TEX2)

and I turn off lightning before rendering the dome. Has anyone an idea why this isn't working? And one more thing. Would it be useful to use an other FVF for the skydome since I'm not using the texture coords and the normals? Thanks, Spe

Share on other sites
What color do you want it to be? Remeber, that macro expects the colors in ARGB (Alpha, Red, Green, Blue) order. Right now, you have the diffuse set to a bright yellow.

If your terrain doesn't use the tex coords and normals, then you shouldn't have them in your vertex structure, or FVF. This wastes a lot of bandwidth and memory. However, if you want your terrain to look good, you probably will want tex coords and normals at some point. Without texturing and lighting, it would look pretty bland.

Share on other sites
As Dustin already pointed out, you have set a bright yellow for your color. If what you are getting is a dark green, and lighting is turned off, then I would suspect that you have previously set a texture when rendering another object and it is getting sampled. Try clearing your first texture:

pDev->SetTexture(0,NULL);

Also if you had previously set up any multi-stage texture blending operations you will need to reset the texture stage states appropriately.

Share on other sites
Quote:
 Original post by circlesoftWhat color do you want it to be? Remeber, that macro expects the colors in ARGB (Alpha, Red, Green, Blue) order. Right now, you have the diffuse set to a bright yellow.If your terrain doesn't use the tex coords and normals, then you shouldn't have them in your vertex structure, or FVF. This wastes a lot of bandwidth and memory. However, if you want your terrain to look good, you probably will want tex coords and normals at some point. Without texturing and lighting, it would look pretty bland.

My terrain does use the texcoords and normals, but my skydome only uses the diffuse color. Thats why I wonder if I should make an FVF for the dome with only the diffuse.

Quote:
 As Dustin already pointed out, you have set a bright yellow for your color. If what you are getting is a dark green, and lighting is turned off, then I would suspect that you have previously set a texture when rendering another object and it is getting sampled. Try clearing your first texture:pDev->SetTexture(0,NULL);Also if you had previously set up any multi-stage texture blending operations you will need to reset the texture stage states appropriately.

That helped. Thank you guys.

• 10
• 19
• 14
• 19
• 15