Archived

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

JoeyBlow2

Vertex fog and 2D (XYZRHW)

Recommended Posts

I''m have some trouble getting vertex fog to work with my 2d components (GUI). It appears the 2d is at the back of the projection matrix and is getting fog applied to it. I want it at the beginning so its not all fogged out. It works fine in pixel fog. But vertex fog is not working. I''ve been playing with the Z and RHW values (randomly setting different things to each one) and has no effect. I''m stumped.

Share this post


Link to post
Share on other sites
Turning your fog off before drawing the GUI should be just fine. To paraphrase the MSDN on the topic, you should avoid 1000''s of state changes (such as enabling/disabling fog) per frame. One or two per frame is fine, and often unavoidable.

In fact, you *might* get a speed improvement if you disable things you''re not using, such as lighting, before rendering your GUI. I say might since the transformation & lighting pipeline isn''t applied to pre-transformed vertices anyway, which is what you''re using. Disabling pixel-level tests such as alpha blending and testing will probably give you a slight speed boost, depending on your GUI''s size and complexity.


--
Eric

Share this post


Link to post
Share on other sites