Traingles coming out black??? WTF!
what renderstates might cause a model to come out pitch black.....i have lighting disabled and diffuse done per vertex and set to 0xFFFFFFFF so I''m fairly sure the problem must be a renderstate but I''m pretty sure i''ve been through them all. Any help?
Are you setting a material for starters? Secondly, what render states are you using? Are your textures loading correctly and being set correctly, are you sure your vertex information is specified in the correct order? A little more info would be handy, but that might help you a little.
yes a pure white material is begin set.
disabling the cull mode and disabling the lighting.
there are no textures nor texture coordinates.
yes the model is formed correctly
the definition is basically
its a basic open flight viewer at the moment using the GLU tesselator to triangulate nionsimple polygons. the resulting triangles are push into one large vb.
there is font rendering as well going on, i'll try disabling all other rendering and see if that helps any.
EDIT: disabling the font rendering gives the correct white but all i'm doing in the font code is setting the texture stage states, enable blending, setting the srcblend and destblend states, setting the texture factor, rendering and then disabling blending. why would this cause this?
EDIT #2: ok setting a texture seems to be the culprit. a texture affects a vertex with no texture coordinates???
[edited by - null_vector on May 7, 2003 5:53:31 PM]
disabling the cull mode and disabling the lighting.
there are no textures nor texture coordinates.
yes the model is formed correctly
the definition is basically
struct vertex { float x, y, z; DWORD diffuse; enum { FVF = D3DFVF_XYZ|D3DFVF_DIFFUSE };};
its a basic open flight viewer at the moment using the GLU tesselator to triangulate nionsimple polygons. the resulting triangles are push into one large vb.
there is font rendering as well going on, i'll try disabling all other rendering and see if that helps any.
EDIT: disabling the font rendering gives the correct white but all i'm doing in the font code is setting the texture stage states, enable blending, setting the srcblend and destblend states, setting the texture factor, rendering and then disabling blending. why would this cause this?
EDIT #2: ok setting a texture seems to be the culprit. a texture affects a vertex with no texture coordinates???
[edited by - null_vector on May 7, 2003 5:53:31 PM]
You say no tex coords, but are they just undefined? they are probably some huge or small number if so...if not...i dont know.
Brian
Brian J
Brian
Brian J
no texture coords as in none present in the structure or the fvf : /
well since i''ve had this laptop i''ve already reported 2 IHV bugs to ATI so I''ll test this on other machine and see what happens?
Is this supposed to work like this?
I''ve gotten around all this by setting the stage 0 texture to null before rendering the model, but I didn''t think that was nessecary.
well since i''ve had this laptop i''ve already reported 2 IHV bugs to ATI so I''ll test this on other machine and see what happens?
Is this supposed to work like this?
I''ve gotten around all this by setting the stage 0 texture to null before rendering the model, but I didn''t think that was nessecary.
I actually think that is how it works...its the same thing as if you turn on mapping without using it...I dont think it uses diffuse color as default if there are no coords in texture mode.
Brian J
Brian J
quote:
I actually think that is how it works...its the same thing as if you turn on mapping without using it...I dont think it uses diffuse color as default if there are no coords in texture mode.
I don''t think I understand you. If you have diffuse but don''t have tex coords, it doesn''t use the diffuse?
Or do you mean set stage 0 texture stage colorarg1 to D3DTA_DIFFUSE?
quote:Original post by null_vector
no texture coords as in none present in the structure or the fvf : /
well since i''ve had this laptop i''ve already reported 2 IHV bugs to ATI so I''ll test this on other machine and see what happens?
Is this supposed to work like this?
I''ve gotten around all this by setting the stage 0 texture to null before rendering the model, but I didn''t think that was nessecary.
If your Texture Stages are set up to use a texture, then you will get undefined behaviour if you have no texture coordinates in your vertices.
COLOROP -> SELECTARG1
COLORARG1 -> DIFFUSE
COLORARG2 -> DIFFUSE (doesn''t really matter, but doesn''t hurt to set it to something sane)
ALPHAOP ->SELECTARG1
ALPHAARG1 ->DIFFUSE
ALPHAARG2 ->DIFFUSE
NOTE: Do NOT disable the alpha processing for an active stage. Some drivers may allow it, but others will fail in bizarre and interesting ways.
This will read from the diffuse colour of your vertices.
Stay Casual,
Ken
Drunken Hyena
Try turn lighting off if it''s on. If the triangles are no longer black then you''ll know that the problem was caused by insuficient lighing or maybe wrong normals.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement