I see black things...

Started by
3 comments, last by MeshMan 20 years ago
glDisable(GL_TEXTURE_2D); glDisable(GL_LIGHT0); glDisable(GL_LIGHTING); glEnable(GL_COLOR_MATERIAL); glColor4f(1,1,1,1); glDrawArrays(...); Im using the above code to render text, models etc... But all i see is black, its only just happened in my engine and ive no idea why. http://meshman.no-ip.com/bmw.jpg The text in that screenshot is usually different colors, and the mouse is textured, but as you see...black. Can someone tell me what states or things could be causing this? Thanks.
Advertisement
Why are you disabling GL_TEXTURE_2D?

GL_COLOR_MATERIAL affects texture coloring only, AFAIK. If you want textures that are colored, comment out the glDisable(2d textures), and if you just want colors, comment out glEnable(material coloring).

That ought to work, but I''m still learning all this.


"TV IS bad Meatwad...but we f***in need it"

If you''re a girl under the age of 12, and you''re high on marijuana...don''t ride your bike. -TRUTH
Things change.
glEnable(GL_TEXTURE_2D);
glDisable(GL_LIGHT0);
glDisable(GL_LIGHTING);
glDisable(GL_BLEND);
glDisable(GL_ALPHA_TEST);
glEnable(GL_COLOR_MATERIAL);
glColor4f(1,1,1,1);

still gives black...
ok, fixed it.

Seems its the fog being applied.
Time to debug through the engine...
quote:Original post by Boku San GL_COLOR_MATERIAL affects texture coloring only, AFAIK.


Not true. It''s what you need to use whenever you enable lighting without setting materials, so imagine how annoying it would be to have to texture all of your lit objects.


"Gay marriage will encourage people to be gay, in the same way that hanging around tall people will make you tall." - Grizwald
-~-The Cow of Darkness-~-

This topic is closed to new replies.

Advertisement