Jump to content
  • Advertisement

Archived

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

null_vector

Traingles coming out black??? WTF!

This topic is 5549 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

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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

          
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Oh, pardon me, I see you''ve already disabled lighting. Sorry

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!