Vertex color not working
Don't you have to set D3DRS_COLORVERTEX renderstate to true to use vertex colors rather than material colours? It's been a while since I did this so I might be wrong
bfarah, ah ok... thanks for description.
Well I really think it's texture fault then. I worked a little in OpenGL too and IIRC the default in OpenGL for an unbound texture was white, for Direct3D in black. Usually the default is for textures stages is modulate texture and color inputs to get result color (check SetTextureStageState documentation).
p.s.
now that I see your code, I don't see any SetTexture. Does DrawHUD leave something bound?
Well I really think it's texture fault then. I worked a little in OpenGL too and IIRC the default in OpenGL for an unbound texture was white, for Direct3D in black. Usually the default is for textures stages is modulate texture and color inputs to get result color (check SetTextureStageState documentation).
p.s.
now that I see your code, I don't see any SetTexture. Does DrawHUD leave something bound?
Quote:Don't you have to set D3DRS_COLORVERTEX renderstate to true to use vertex colors rather than material colours? It's been a while since I did this so I might be wrong
I would have no clue, the teacher i had didn't teach us at all. all he did was talk about his new born child and wasted thousands of dollars.
You only disable lighting if the mesh has a bounding box. Try doing it outside the if statement.
Also, try using the debug runtime.
Also, try using the debug runtime.
its working now, the problem was the vertexelement offset was at 24 and changed it to 32.
The other problem was that hitting F7 wouldn't compile the .h file of the mesh class so when i changed the color vertex to blue or what ever it didn't compile the change. I did a rebuild and ran the program and it did change the color. it still works if it has or doesn't have a texture attached to the object.
Basically i F'd up. You know when people call up technical support and the tech people say is the computer or printer turned on. its like saying before we go in more detail did you do a rebuild of your solution.
Thanks for all your help guys/girls and sorry for my stupid mistake :)
The other problem was that hitting F7 wouldn't compile the .h file of the mesh class so when i changed the color vertex to blue or what ever it didn't compile the change. I did a rebuild and ran the program and it did change the color. it still works if it has or doesn't have a texture attached to the object.
Basically i F'd up. You know when people call up technical support and the tech people say is the computer or printer turned on. its like saying before we go in more detail did you do a rebuild of your solution.
Thanks for all your help guys/girls and sorry for my stupid mistake :)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement