Sign in to follow this  
spe

color problem

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[i].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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites
Quote:
Original post by circlesoft
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.


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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this